]>
Commit | Line | Data |
---|---|---|
57aee2a0 | 1 | This is Python version 3.13.0 alpha 6 |
e8511775 | 2 | ===================================== |
9144763a | 3 | |
6a263cf1 SD |
4 | .. image:: https://github.com/python/cpython/workflows/Tests/badge.svg |
5 | :alt: CPython build status on GitHub Actions | |
6 | :target: https://github.com/python/cpython/actions | |
7 | ||
2fc857a5 | 8 | .. image:: https://dev.azure.com/python/cpython/_apis/build/status/Azure%20Pipelines%20CI?branchName=main |
680d26e3 | 9 | :alt: CPython build status on Azure DevOps |
2fc857a5 | 10 | :target: https://dev.azure.com/python/cpython/_build/latest?definitionId=4&branchName=main |
757b73cf | 11 | |
bef7b26f EEA |
12 | .. image:: https://img.shields.io/badge/discourse-join_chat-brightgreen.svg |
13 | :alt: Python Discourse chat | |
14 | :target: https://discuss.python.org/ | |
757b73cf | 15 | |
b57eea16 | 16 | |
c86571e4 | 17 | Copyright © 2001-2024 Python Software Foundation. All rights reserved. |
4405cf3c | 18 | |
d50f188b ZW |
19 | See the end of this file for further copyright and license information. |
20 | ||
7c8b3fa3 IN |
21 | .. contents:: |
22 | ||
e32ec933 M |
23 | General Information |
24 | ------------------- | |
25 | ||
26 | - Website: https://www.python.org | |
27 | - Source code: https://github.com/python/cpython | |
672e7de9 | 28 | - Issue tracker: https://github.com/python/cpython/issues |
e32ec933 | 29 | - Documentation: https://docs.python.org |
384899df | 30 | - Developer's Guide: https://devguide.python.org/ |
e32ec933 | 31 | |
1b3d88eb NC |
32 | Contributing to CPython |
33 | ----------------------- | |
34 | ||
35 | For more complete instructions on contributing to CPython development, | |
36 | see the `Developer Guide`_. | |
37 | ||
384899df | 38 | .. _Developer Guide: https://devguide.python.org/ |
50e9fb9e | 39 | |
3cdbd68c NB |
40 | Using Python |
41 | ------------ | |
42 | ||
43 | Installable Python kits, and information about using Python, are available at | |
44 | `python.org`_. | |
45 | ||
46 | .. _python.org: https://www.python.org/ | |
47 | ||
1da43e5e BP |
48 | Build Instructions |
49 | ------------------ | |
71dcc3e9 | 50 | |
c0866855 | 51 | On Unix, Linux, BSD, macOS, and Cygwin:: |
8d90f9d5 | 52 | |
1da43e5e BP |
53 | ./configure |
54 | make | |
55 | make test | |
56 | sudo make install | |
f501b4e5 | 57 | |
7e3fb40b | 58 | This will install Python as ``python3``. |
91cb9d2f | 59 | |
d50f188b | 60 | You can pass many options to the configure script; run ``./configure --help`` |
19d6842c ND |
61 | to find out more. On macOS case-insensitive file systems and on Cygwin, |
62 | the executable is called ``python.exe``; elsewhere it's just ``python``. | |
477c8d5e | 63 | |
19d6842c ND |
64 | Building a complete Python installation requires the use of various |
65 | additional third-party libraries, depending on your build platform and | |
66 | configure options. Not all standard library modules are buildable or | |
67 | useable on all platforms. Refer to the | |
fc342c62 | 68 | `Install dependencies <https://devguide.python.org/getting-started/setup-building.html#build-dependencies>`_ |
19d6842c ND |
69 | section of the `Developer Guide`_ for current detailed information on |
70 | dependencies for various Linux distributions and macOS. | |
ee994d74 | 71 | |
19d6842c ND |
72 | On macOS, there are additional configure and build options related |
73 | to macOS framework and universal builds. Refer to `Mac/README.rst | |
2fc857a5 | 74 | <https://github.com/python/cpython/blob/main/Mac/README.rst>`_. |
dabed752 | 75 | |
d50f188b | 76 | On Windows, see `PCbuild/readme.txt |
2fc857a5 | 77 | <https://github.com/python/cpython/blob/main/PCbuild/readme.txt>`_. |
1da43e5e | 78 | |
0050670d AS |
79 | To build Windows installer, see `Tools/msi/README.txt |
80 | <https://github.com/python/cpython/blob/main/Tools/msi/README.txt>`_. | |
81 | ||
f92f6c8e | 82 | If you wish, you can create a subdirectory and invoke configure from there. |
d783b01f | 83 | For example:: |
1da43e5e BP |
84 | |
85 | mkdir debug | |
86 | cd debug | |
87 | ../configure --with-pydebug | |
88 | make | |
89 | make test | |
90 | ||
d50f188b | 91 | (This will fail if you *also* built at the top-level directory. You should do |
5f2b3b03 | 92 | a ``make clean`` at the top-level first.) |
2a691a81 | 93 | |
d50f188b ZW |
94 | To get an optimized build of Python, ``configure --enable-optimizations`` |
95 | before you run ``make``. This sets the default make targets up to enable | |
96 | Profile Guided Optimization (PGO) and may be used to auto-enable Link Time | |
97 | Optimization (LTO) on some platforms. For more details, see the sections | |
98 | below. | |
7188a3ef | 99 | |
7188a3ef | 100 | Profile Guided Optimization |
6db764ad | 101 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
7188a3ef | 102 | |
b87c1c92 | 103 | PGO takes advantage of recent versions of the GCC or Clang compilers. If used, |
93f9a8a5 GS |
104 | either via ``configure --enable-optimizations`` or by manually running |
105 | ``make profile-opt`` regardless of configure flags, the optimized build | |
106 | process will perform the following steps: | |
107 | ||
108 | The entire Python directory is cleaned of temporary files that may have | |
109 | resulted from a previous compilation. | |
110 | ||
111 | An instrumented version of the interpreter is built, using suitable compiler | |
acac6c71 AP |
112 | flags for each flavor. Note that this is just an intermediary step. The |
113 | binary resulting from this step is not good for real-life workloads as it has | |
93f9a8a5 GS |
114 | profiling instructions embedded inside. |
115 | ||
116 | After the instrumented interpreter is built, the Makefile will run a training | |
acac6c71 | 117 | workload. This is necessary in order to profile the interpreter's execution. |
93f9a8a5 GS |
118 | Note also that any output, both stdout and stderr, that may appear at this step |
119 | is suppressed. | |
120 | ||
121 | The final step is to build the actual interpreter, using the information | |
122 | collected from the instrumented one. The end result will be a Python binary | |
123 | that is optimized; suitable for distribution or production installation. | |
7188a3ef | 124 | |
1c4523f0 | 125 | |
014d52ff | 126 | Link Time Optimization |
6db764ad | 127 | ^^^^^^^^^^^^^^^^^^^^^^ |
014d52ff | 128 | |
d50f188b ZW |
129 | Enabled via configure's ``--with-lto`` flag. LTO takes advantage of the |
130 | ability of recent compiler toolchains to optimize across the otherwise | |
131 | arbitrary ``.o`` file boundary when building final executables or shared | |
132 | libraries for additional performance gains. | |
014d52ff GS |
133 | |
134 | ||
1c896e3f | 135 | What's New |
91cb9d2f GR |
136 | ---------- |
137 | ||
d50f188b | 138 | We have a comprehensive overview of the changes in the `What's New in Python |
500b0f48 | 139 | 3.13 <https://docs.python.org/3.13/whatsnew/3.13.html>`_ document. For a more |
d50f188b | 140 | detailed change log, read `Misc/NEWS |
fc342c62 | 141 | <https://github.com/python/cpython/tree/main/Misc/NEWS.d>`_, but a full |
d50f188b | 142 | accounting of changes can only be gleaned from the `commit history |
2fc857a5 | 143 | <https://github.com/python/cpython/commits/main>`_. |
99533a95 | 144 | |
5f2b3b03 | 145 | If you want to install multiple versions of Python, see the section below |
160b9a3c BW |
146 | entitled "Installing multiple versions". |
147 | ||
148 | ||
1da43e5e BP |
149 | Documentation |
150 | ------------- | |
2a691a81 | 151 | |
500b0f48 | 152 | `Documentation for Python 3.13 <https://docs.python.org/3.13/>`_ is online, |
d783b01f | 153 | updated daily. |
1da43e5e | 154 | |
62069d3c GB |
155 | It can also be downloaded in many formats for faster access. The documentation |
156 | is downloadable in HTML, PDF, and reStructuredText formats; the latter version | |
157 | is primarily for documentation authors, translators, and people with special | |
158 | formatting requirements. | |
99533a95 | 159 | |
b3f1f59c | 160 | For information about building Python's documentation, refer to `Doc/README.rst |
2fc857a5 | 161 | <https://github.com/python/cpython/blob/main/Doc/README.rst>`_. |
802bf8ae | 162 | |
160b9a3c | 163 | |
ad3d5c22 BP |
164 | Testing |
165 | ------- | |
166 | ||
d50f188b ZW |
167 | To test the interpreter, type ``make test`` in the top-level directory. The |
168 | test set produces some output. You can generally ignore the messages about | |
169 | skipped tests due to optional features which can't be imported. If a message | |
170 | is printed about a failed test or a traceback or core dump is produced, | |
171 | something is wrong. | |
ad3d5c22 BP |
172 | |
173 | By default, tests are prevented from overusing resources like disk space and | |
9c91141f | 174 | memory. To enable these tests, run ``make buildbottest``. |
ad3d5c22 | 175 | |
0f914b5b AA |
176 | If any tests fail, you can re-run the failing test(s) in verbose mode. For |
177 | example, if ``test_os`` and ``test_gdb`` failed, you can run:: | |
ad3d5c22 | 178 | |
0f914b5b | 179 | make test TESTOPTS="-v test_os test_gdb" |
ad3d5c22 | 180 | |
d50f188b | 181 | If the failure persists and appears to be a problem with Python rather than |
672e7de9 ŁL |
182 | your environment, you can `file a bug report |
183 | <https://github.com/python/cpython/issues>`_ and include relevant output from | |
184 | that command to show the issue. | |
ad3d5c22 | 185 | |
fc342c62 | 186 | See `Running & Writing Tests <https://devguide.python.org/testing/run-write-tests.html>`_ |
cae8ff93 | 187 | for more on running tests. |
ad3d5c22 | 188 | |
dd15f6c3 CH |
189 | Installing multiple versions |
190 | ---------------------------- | |
191 | ||
192 | On Unix and Mac systems if you intend to install multiple versions of Python | |
d50f188b ZW |
193 | using the same installation prefix (``--prefix`` argument to the configure |
194 | script) you must take care that your primary python executable is not | |
195 | overwritten by the installation of a different version. All files and | |
196 | directories installed using ``make altinstall`` contain the major and minor | |
197 | version and can thus live side-by-side. ``make install`` also creates | |
3abda7a3 | 198 | ``${prefix}/bin/python3`` which refers to ``${prefix}/bin/python3.X``. If you |
d50f188b | 199 | intend to install multiple versions using the same prefix you must decide which |
0b234026 | 200 | version (if any) is your "primary" version. Install that version using |
201 | ``make install``. Install all other versions using ``make altinstall``. | |
dd15f6c3 | 202 | |
500b0f48 TW |
203 | For example, if you want to install Python 2.7, 3.6, and 3.13 with 3.13 being the |
204 | primary version, you would execute ``make install`` in your 3.13 build directory | |
d783b01f | 205 | and ``make altinstall`` in the others. |
dd15f6c3 CH |
206 | |
207 | ||
1da43e5e BP |
208 | Release Schedule |
209 | ---------------- | |
91cb9d2f | 210 | |
abe4ca5e | 211 | See :pep:`719` for Python 3.13 release details. |
ef0f1291 GR |
212 | |
213 | ||
214 | Copyright and License Information | |
215 | --------------------------------- | |
216 | ||
ef0f1291 | 217 | |
c86571e4 | 218 | Copyright © 2001-2024 Python Software Foundation. All rights reserved. |
ef0f1291 | 219 | |
965be0e9 M |
220 | Copyright © 2000 BeOpen.com. All rights reserved. |
221 | ||
222 | Copyright © 1995-2001 Corporation for National Research Initiatives. All | |
260a7887 | 223 | rights reserved. |
ef0f1291 | 224 | |
965be0e9 | 225 | Copyright © 1991-1995 Stichting Mathematisch Centrum. All rights reserved. |
ef0f1291 | 226 | |
2fc857a5 | 227 | See the `LICENSE <https://github.com/python/cpython/blob/main/LICENSE>`_ for |
3112aab3 WB |
228 | information on the history of this software, terms & conditions for usage, and a |
229 | DISCLAIMER OF ALL WARRANTIES. | |
ef0f1291 | 230 | |
f92f6c8e LH |
231 | This Python distribution contains *no* GNU General Public License (GPL) code, |
232 | so it may be used in proprietary projects. There are interfaces to some GNU | |
233 | code but these are entirely optional. | |
ef0f1291 | 234 | |
260a7887 | 235 | All trademarks referenced herein are property of their respective holders. |