8000 bpo-45442: Add deactivate step to venv tutorial. by ShivnarenSrinivasan · Pull Request #28959 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-45442: Add deactivate step to venv tutorial. #28959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
b057f99
bpo-45442: Add deactivate step to venv tutorial.
ShivnarenSrinivasan Oct 14, 2021
11150a4
bpo-45442: Fix indentation/syntax error
ShivnarenSrinivasan Oct 15, 2021
8813d6a
bpo-45442: Remove explanation of implementation detail.
ShivnarenSrinivasan Oct 15, 2021
dcff25a
bpo-45474: Fix the limited C API of marshal.h (GH-28956)
vstinner Oct 14, 2021
e64410b
bpo-45434: Limited Python.h no longer includes stdio.h (GH-28960)
vstinner Oct 14, 2021
46c18f2
bpo-41710: Fix What's New Entry credit (GH-28962)
vstinner Oct 14, 2021
5c8be2b
bpo-45434: Remove useless space in includes (GH-28963)
vstinner Oct 14, 2021
37e1a68
po-35134: Move Include/funcobject.h to Include/cpython/ (GH-28958)
vstinner Oct 14, 2021
96805ce
bpo-35134: Move Include/cellobject.h to Include/cpython/ (GH-28964)
vstinner Oct 15, 2021
6adbd0f
closes bpo-45479: Degunkify Py_UniversalNewlineFgets. (GH-28965)
benjaminp Oct 15, 2021
a119c0c
bpo-45479: Futher simplify Py_UniversalNewlineFgets. (GH-28967)
benjaminp Oct 15, 2021
c82f6be
bpo-35134: Move classobject.h to Include/cpython/ (GH-28968)
vstinner Oct 15, 2021
c50770d
bpo-45428: Fix reading filenames from stdin in py_compile (GH-28848)
ginggs Oct 15, 2021
d0d02d1
bpo-35081: Move interpreteridobject.h to Include/internal/ (GH-28969)
vstinner Oct 15, 2021
50818d2
bpo-45434: Remove Include/eval.h header file (GH-28973)
vstinner Oct 15, 2021
1856e8c
bpo-45445: Remove incorrectly commited test file (GH-28972)
pablogsal Oct 15, 2021
7dad45b
bpo-44113: Move the What's New entry to Deprecate section (GH-28974)
8000 vstinner Oct 15, 2021
675ff5d
bpo-45482: Rename namespaceobject.h to pycore_namespace.h (GH-28975)
vstinner Oct 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Doc/faq/extending.rst
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,6 @@ complete example using the GNU readline library (you may want to ignore

#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <object.h>
#include <compile.h>
#include <eval.h>

int main (int argc, char* argv[])
{
Expand Down
2 changes: 1 addition & 1 deletion Doc/faq/windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ Embedding the Python interpreter in a Windows app can be summarized as follows:

.. code-block:: c

#include "python.h"
#include <Python.h>
...
Py_Initialize(); // Initialize Python.
initmyAppc(); // Initialize (import) the helper class.
Expand Down
4 changes: 4 additions & 0 deletions Doc/tutorial/venv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ For example:
'~/envs/tutorial-env/lib/python3.5/site-packages']
>>>

To deactivate a virtual environment, type::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error in CI : https://dev.azure.com/Python/cpython/_build/results?buildId=89615&view=logs&j=4db1505a-29e5-5cc0-240b-53a8a2681f75&t=a975920c-8356-5388-147c-613d5fab0171&l=517

Warning, treated as error:
/home/vsts/work/1/s/Doc/tutorial/venv.rst:93:Definition list ends without a blank line; unexpected unindent.
make: *** [Makefile:51: build] Error 2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully fixed with the second commit


deactivate
into the terminal.

Managing Packages with pip
==========================
Expand Down
41 changes: 33 additions & 8 deletions Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ threading
the monotonic clock (:data:`time.CLOCK_MONOTONIC`) for the timeout, rather
than using the system clock (:data:`time.CLOCK_REALTIME`), to not be affected
by system clock changes.
(Contributed by Livius and Victor Stinner in :issue:`41710`.)
(Contributed by Victor Stinner in :issue:`41710`.)

time
----
Expand Down Expand Up @@ -565,15 +565,23 @@ Porting to Python 3.11
``exit()`` and ``abort()``.
(Contributed by Victor Stinner in :issue:`45434`.)

Deprecated
----------
* The ``<Python.h>`` header file no longer includes ``<stdio.h>`` if the
``Py_LIMITED_API`` macro is defined. Functions expecting ``FILE*`` are
excluded from the limited C API (:pep:`384`). C extensions using
``<stdio.h>`` must now include it explicitly. The system ``<stdio.h>``
header provides functions like ``printf()`` and ``fopen()``.
(Contributed by Victor Stinner in :issue:`45434`.)

Removed
-------
* The non-limited API files ``cellobject.h``, ``classobject.h``, ``context.h``,
``funcobject.h``, ``genobject.h`` and ``longintrepr.h`` have been moved to
the ``Include/cpython`` directory. Moreover, the ``eval.h`` header file was
removed. These files must not be included directly, as they are already
included in ``Python.h``: :ref:`Include Files <api-includes>`. If they have
been included directly, consider including ``Python.h`` instead.
(Contributed by Victor Stinner in :issue:`35134`.)

* :c:func:`PyFrame_BlockSetup` and :c:func:`PyFrame_BlockPop` have been
removed.
(Contributed by Mark Shannon in :issue:`40222`.)
Deprecated
----------

* Deprecate the following functions to configure the Python initialization:

Expand All @@ -591,6 +599,13 @@ Removed
<init-config>` instead (:pep:`587`).
(Contributed by Victor Stinner in :issue:`44113`.)

Removed
-------

* :c:func:`PyFrame_BlockSetup` and :c:func:`PyFrame_BlockPop` have been
removed.
(Contributed by Mark Shannon in :issue:`40222`.)

* Remove the following math macros using the ``errno`` variable:

* ``Py_ADJUST_ERANGE1()``
Expand All @@ -613,3 +628,13 @@ Removed
* Remove the ``Py_FORCE_DOUBLE()`` macro. It was used by the
``Py_IS_INFINITY()`` macro.
(Contributed by Victor Stinner in :issue:`45440`.)

* Remove two functions from the limited C API:

* :c:func:`PyMarshal_WriteLongToFile`
* :c:func:`PyMarshal_WriteObjectToFile`

The :pep:`384` excludes functions expecting ``FILE*`` from the stable ABI.

Remove also the ``Py_MARSHAL_VERSION`` macro from the limited C API.
(Contributed by Victor Stinner in :issue:`45474`.)
27 changes: 11 additions & 16 deletions Include/Python.h
EED3
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,18 @@
# define _SGI_MP_SOURCE
#endif

#include <stdio.h> // NULL, FILE*
#ifndef NULL
# error "Python.h requires that stdio.h define NULL."
#endif

#include <string.h> // memcpy()
#ifndef Py_LIMITED_API
# include <stdio.h> // FILE*
#endif
#ifdef HAVE_ERRNO_H
# include <errno.h> // errno
#endif
#ifndef MS_WINDOWS
# include <unistd.h>
#endif
#ifdef HAVE_STDDEF_H
// For size_t
# include <stddef.h>
# include <stddef.h> // size_t
#endif

#include <assert.h> // assert()
Expand All @@ -49,7 +46,7 @@
#include "bytesobject.h"
#include "unicodeobject.h"
#include "longobject.h"
#include "longintrepr.h"
#include "cpython/longintrepr.h"
#include "boolobject.h"
#include "floatobject.h"
#include "complexobject.h"
Expand All @@ -63,31 +60,30 @@
#include "setobject.h"
#include "methodobject.h"
#include "moduleobject.h"
#include "funcobject.h"
#include "classobject.h"
#include "cpython/funcobject.h"
#include "cpython/classobject.h"
#include "fileobject.h"
#include "pycapsule.h"
#include "code.h"
#include "pyframe.h"
#include "traceback.h"
#include "sliceobject.h"
#include "cellobject.h"
#include "cpython/cellobject.h"
#include "iterobject.h"
#include "genobject.h"
#include "pystate.h"
#include "cpython/genobject.h"
#include "descrobject.h"
#include "genericaliasobject.h"
#include "warnings.h"
#include "weakrefobject.h"
#include "structseq.h"
#include "namespaceobject.h"
#include "cpython/picklebufobject.h"
#include "cpython/pytime.h"
#include "codecs.h"
#include "pyerrors.h"
#include "cpython/initconfig.h"
#include "pythread.h"
#include "pystate.h"
#include "context.h"
#include "cpython/context.h"
#include "modsupport.h"
#include "compile.h"
#include "pythonrun.h"
Expand All @@ -99,7 +95,6 @@
#include "import.h"
#include "abstract.h"
#include "bltinmodule.h"
#include "eval.h"
#include "cpython/pyctype.h"
#include "pystrtod.h"
#include "pystrcmp.h"
Expand Down
2 changes: 1 addition & 1 deletion Include/abstract.h
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ PyAPI_FUNC(int) PyObject_IsSubclass(PyObject *object, PyObject *typeorclass);

#ifndef Py_LIMITED_API
# define Py_CPYTHON_ABSTRACTOBJECT_H
# include "cpython/abstract.h"
# include "cpython/abstract.h"
# undef Py_CPYTHON_ABSTRACTOBJECT_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/bytearrayobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ PyAPI_FUNC(int) PyByteArray_Resize(PyObject *, Py_ssize_t);

#ifndef Py_LIMITED_API
# define Py_CPYTHON_BYTEARRAYOBJECT_H
# include "cpython/bytearrayobject.h"
# include "cpython/bytearrayobject.h"
# undef Py_CPYTHON_BYTEARRAYOBJECT_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/bytesobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ PyAPI_FUNC(int) PyBytes_AsStringAndSize(

#ifndef Py_LIMITED_API
# define Py_CPYTHON_BYTESOBJECT_H
# include "cpython/bytesobject.h"
# include "cpython/bytesobject.h"
# undef Py_CPYTHON_BYTESOBJECT_H
#endif

Expand Down
14 changes: 12 additions & 2 deletions Include/ceval.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
/* Interface to random parts in ceval.c */

#ifndef Py_CEVAL_H
#define Py_CEVAL_H
#ifdef __cplusplus
extern "C" {
#endif


/* Interface to random parts in ceval.c */
PyAPI_FUNC(PyObject *) PyEval_EvalCode(PyObject *, PyObject *, PyObject *);

PyAPI_FUNC(PyObject *) PyEval_EvalCodeEx(PyObject *co,
PyObject *globals,
PyObject *locals,
PyObject *const *args, int argc,
PyObject *const *kwds, int kwdc,
PyObject *const *defs, int defc,
PyObject *kwdefs, PyObject *closure);

/* PyEval_CallObjectWithKeywords(), PyEval_CallObject(), PyEval_CallFunction
* and PyEval_CallMethod are deprecated. Since they are officially part of the
Expand Down Expand Up @@ -148,7 +158,7 @@ PyAPI_FUNC(void) PyEval_ReleaseThread(PyThreadState *tstate);

#ifndef Py_LIMITED_API
# define Py_CPYTHON_CEVAL_H
# include "cpython/ceval.h"
# include "cpython/ceval.h"
# undef Py_CPYTHON_CEVAL_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/code.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ typedef struct PyCodeObject PyCodeObject;

#ifndef Py_LIMITED_API
# define Py_CPYTHON_CODE_H
# include "cpython/code.h"
# include "cpython/code.h"
# undef Py_CPYTHON_CODE_H
#endif

Expand Down
4 changes: 3 additions & 1 deletion Include/cellobject.h → Include/cpython/cellobject.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Cell object interface */

#ifndef Py_LIMITED_API
#ifndef Py_CELLOBJECT_H
#define Py_CELLOBJECT_H
Expand All @@ -8,7 +9,8 @@ extern "C" {

typedef struct {
PyObject_HEAD
PyObject *ob_ref; /* Content of the cell or NULL when empty */
/* Content of the cell or NULL when empty */
PyObject *ob_ref;
} PyCellObject;

PyAPI_DATA(PyTypeObject) PyCell_Type;
Expand Down
2 changes: 2 additions & 0 deletions Include/cpython/ceval.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# error "this header file must not be included directly"
#endif

PyAPI_FUNC(PyObject *) _PyEval_CallTracing(PyObject *func, PyObject *args);

PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *);
PyAPI_DATA(int) _PyEval_SetProfile(PyThreadState *tstate, Py_tracefunc func, PyObject *arg);
PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *);
Expand Down
4 changes: 2 additions & 2 deletions Include/classobject.h → Include/cpython/classobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ PyAPI_FUNC(PyObject *) PyInstanceMethod_Function(PyObject *);
#ifdef __cplusplus
}
#endif
#endif /* !Py_CLASSOBJECT_H */
#endif /* Py_LIMITED_API */
#endif // !Py_CLASSOBJECT_H
#endif // !Py_LIMITED_API
7 changes: 2 additions & 5 deletions Include/context.h → Include/cpython/context.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#ifndef Py_LIMITED_API
#ifndef Py_CONTEXT_H
#define Py_CONTEXT_H
#ifdef __cplusplus
extern "C" {
#endif

#ifndef Py_LIMITED_API


PyAPI_DATA(PyTypeObject) PyContext_Type;
typedef struct _pycontextobject PyContext;

Expand Down Expand Up @@ -73,9 +71,8 @@ PyAPI_FUNC(int) PyContextVar_Reset(PyObject *var, PyObject *token);
PyAPI_FUNC(PyObject *) _PyContext_NewHamtForTests(void);


#endif /* !Py_LIMITED_API */

#ifdef __cplusplus
}
#endif
#endif /* !Py_CONTEXT_H */
#endif /* !Py_LIMITED_API */
4 changes: 1 addition & 3 deletions Include/funcobject.h → Include/cpython/funcobject.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

/* Function object interface */

#ifndef Py_LIMITED_API
#ifndef Py_FUNCOBJECT_H
#define Py_FUNCOBJECT_H
Expand Down Expand Up @@ -76,15 +76,13 @@ PyAPI_FUNC(int) PyFunction_SetClosure(PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) PyFunction_GetAnnotations(PyObject *);
PyAPI_FUNC(int) PyFunction_SetAnnotations(PyObject *, PyObject *);

#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyFunction_Vectorcall(
PyObject *func,
PyObject *const *stack,
size_t nargsf,
PyObject *kwnames);

uint32_t _PyFunction_GetVersionForCurrentState(PyFunctionObject *func);
#endif

/* Macros for direct access to these values. Type checks are *not*
done, so use with care. */
Expand Down
12 changes: 6 additions & 6 deletions Include/genobject.h → Include/cpython/genobject.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/* Generator object interface */

#ifndef Py_LIMITED_API
Expand All @@ -8,8 +7,7 @@
extern "C" {
#endif

#include "pystate.h" /* _PyErr_StackItem */
#include "abstract.h" /* PySendResult */
/* --- Generators --------------------------------------------------------- */

/* _PyGenObject_HEAD defines the initial segment of generator
and coroutine objects. */
Expand Down Expand Up @@ -45,7 +43,9 @@ PyAPI_FUNC(int) _PyGen_FetchStopIterationValue(PyObject **);
PyObject *_PyGen_yf(PyGenObject *);
PyAPI_FUNC(void) _PyGen_Finalize(PyObject *self);

#ifndef Py_LIMITED_API

/* --- PyCoroObject ------------------------------------------------------- */

typedef struct {
_PyGenObject_HEAD(cr)
PyObject *cr_origin;
Expand All @@ -59,7 +59,8 @@ PyObject *_PyCoro_GetAwaitableIter(PyObject *o);
PyAPI_FUNC(PyObject *) PyCoro_New(PyFrameObject *,
PyObject *name, PyObject *qualname);

/* Asynchronous Generators */

/* --- Asynchronous Generators -------------------------------------------- */

typedef struct {
_PyGenObject_HEAD(ag)
Expand Down Expand Up @@ -89,7 +90,6 @@ PyAPI_FUNC(PyObject *) PyAsyncGen_New(PyFrameObject *,

PyObject *_PyAsyncGenValueWrapperNew(PyObject *);

#endif

#undef _PyGenObject_HEAD

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion Include/dictobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ PyAPI_DATA(PyTypeObject) PyDictRevIterValue_Type;

#ifndef Py_LIMITED_API
# define Py_CPYTHON_DICTOBJECT_H
# include "cpython/dictobject.h"
# include "cpython/dictobject.h"
# undef Py_CPYTHON_DICTOBJECT_H
#endif

Expand Down
Loading
0