Zachary Ware | 1e8cc88 | 2017-02-15 13:29:16 -0600 | [diff] [blame] | 1 | This is Python version 3.6.1 release candidate 1 |
| 2 | ================================================ |
| 3 | |
| 4 | .. image:: https://travis-ci.org/python/cpython.svg?branch=3.6 |
| 5 | :alt: CPython build status on Travis CI |
| 6 | :target: https://travis-ci.org/python/cpython |
| 7 | |
| 8 | .. image:: https://codecov.io/gh/python/cpython/branch/3.6/graph/badge.svg |
| 9 | :alt: CPython code coverage on Codecov |
| 10 | :target: https://codecov.io/gh/python/cpython |
| 11 | |
| 12 | Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, |
| 13 | 2012, 2013, 2014, 2015, 2016, 2017 Python Software Foundation. All rights |
| 14 | reserved. |
| 15 | |
| 16 | See the end of this file for further copyright and license information. |
| 17 | |
| 18 | |
| 19 | Using Python |
| 20 | ------------ |
| 21 | |
| 22 | Installable Python kits, and information about using Python, are available at |
| 23 | `python.org`_. |
| 24 | |
| 25 | .. _python.org: https://www.python.org/ |
| 26 | |
| 27 | |
| 28 | Build Instructions |
| 29 | ------------------ |
| 30 | |
| 31 | On Unix, Linux, BSD, OSX, and Cygwin:: |
| 32 | |
| 33 | ./configure |
| 34 | make |
| 35 | make test |
| 36 | sudo make install |
| 37 | |
| 38 | This will install Python as python3. |
| 39 | |
| 40 | You can pass many options to the configure script; run ``./configure --help`` |
| 41 | to find out more. On OSX and Cygwin, the executable is called ``python.exe``; |
| 42 | elsewhere it's just ``python``. |
| 43 | |
| 44 | On Mac OS X, if you have configured Python with ``--enable-framework``, you |
| 45 | should use ``make frameworkinstall`` to do the installation. Note that this |
| 46 | installs the Python executable in a place that is not normally on your PATH, |
| 47 | you may want to set up a symlink in ``/usr/local/bin``. |
| 48 | |
| 49 | On Windows, see `PCbuild/readme.txt |
| 50 | <https://github.com/python/cpython/blob/3.6/PCbuild/readme.txt>`_. |
| 51 | |
| 52 | If you wish, you can create a subdirectory and invoke configure from there. |
| 53 | For example:: |
| 54 | |
| 55 | mkdir debug |
| 56 | cd debug |
| 57 | ../configure --with-pydebug |
| 58 | make |
| 59 | make test |
| 60 | |
| 61 | (This will fail if you *also* built at the top-level directory. You should do |
| 62 | a ``make clean`` at the toplevel first.) |
| 63 | |
| 64 | To get an optimized build of Python, ``configure --enable-optimizations`` |
| 65 | before you run ``make``. This sets the default make targets up to enable |
| 66 | Profile Guided Optimization (PGO) and may be used to auto-enable Link Time |
| 67 | Optimization (LTO) on some platforms. For more details, see the sections |
| 68 | below. |
| 69 | |
| 70 | |
| 71 | Profile Guided Optimization |
| 72 | --------------------------- |
| 73 | |
| 74 | PGO takes advantage of recent versions of the GCC or Clang compilers. If ran, |
| 75 | ``make profile-opt`` will do several steps. |
| 76 | |
| 77 | First, the entire Python directory is cleaned of temporary files that may have |
| 78 | resulted in a previous compilation. |
| 79 | |
| 80 | Then, an instrumented version of the interpreter is built, using suitable |
| 81 | compiler flags for each flavour. Note that this is just an intermediary step |
| 82 | and the binary resulted after this step is not good for real life workloads, as |
| 83 | it has profiling instructions embedded inside. |
| 84 | |
| 85 | After this instrumented version of the interpreter is built, the Makefile will |
| 86 | automatically run a training workload. This is necessary in order to profile |
| 87 | the interpreter execution. Note also that any output, both stdout and stderr, |
| 88 | that may appear at this step is suppressed. |
| 89 | |
| 90 | Finally, the last step is to rebuild the interpreter, using the information |
| 91 | collected in the previous one. The end result will be a Python binary that is |
| 92 | optimized and suitable for distribution or production installation. |
| 93 | |
| 94 | |
| 95 | Link Time Optimization |
| 96 | ---------------------- |
| 97 | |
| 98 | Enabled via configure's ``--with-lto`` flag. LTO takes advantage of the |
| 99 | ability of recent compiler toolchains to optimize across the otherwise |
| 100 | arbitrary ``.o`` file boundary when building final executables or shared |
| 101 | libraries for additional performance gains. |
| 102 | |
| 103 | |
| 104 | What's New |
| 105 | ---------- |
| 106 | |
| 107 | We have a comprehensive overview of the changes in the `What's New in Python |
| 108 | 3.6 <https://docs.python.org/3.6/whatsnew/3.6.html>`_ document. For a more |
| 109 | detailed change log, read `Misc/NEWS |
| 110 | <https://github.com/python/cpython/blob/3.6/Misc/NEWS>`_, but a full |
| 111 | accounting of changes can only be gleaned from the `commit history |
| 112 | <https://github.com/python/cpython/commits/3.6>`_. |
| 113 | |
| 114 | If you want to install multiple versions of Python see the section below |
| 115 | entitled "Installing multiple versions". |
| 116 | |
| 117 | |
| 118 | Documentation |
| 119 | ------------- |
| 120 | |
| 121 | `Documentation for Python 3.6 <https://docs.python.org/3.6/>`_ is online, |
| 122 | updated daily. |
| 123 | |
| 124 | It can also be downloaded in many formats for faster access. The documentation |
| 125 | is downloadable in HTML, PDF, and reStructuredText formats; the latter version |
| 126 | is primarily for documentation authors, translators, and people with special |
| 127 | formatting requirements. |
| 128 | |
| 129 | If you would like to contribute to the development of Python, relevant |
| 130 | documentation is available in the `Python Developer's Guide |
| 131 | <https://docs.python.org/devguide/>`_. |
| 132 | |
| 133 | For information about building Python's documentation, refer to `Doc/README.txt |
| 134 | <https://github.com/python/cpython/blob/3.6/Doc/README.txt>`_. |
| 135 | |
| 136 | |
| 137 | Converting From Python 2.x to 3.x |
| 138 | --------------------------------- |
| 139 | |
| 140 | Significant backward incompatible changes were made for the release of Python |
| 141 | 3.0, which may cause programs written for Python 2 to fail when run with Python |
| 142 | 3. For more information about porting your code from Python 2 to Python 3, see |
| 143 | the `Porting HOWTO <https://docs.python.org/3/howto/pyporting.html>`_. |
| 144 | |
| 145 | |
| 146 | Testing |
| 147 | ------- |
| 148 | |
| 149 | To test the interpreter, type ``make test`` in the top-level directory. The |
| 150 | test set produces some output. You can generally ignore the messages about |
| 151 | skipped tests due to optional features which can't be imported. If a message |
| 152 | is printed about a failed test or a traceback or core dump is produced, |
| 153 | something is wrong. |
| 154 | |
| 155 | By default, tests are prevented from overusing resources like disk space and |
| 156 | memory. To enable these tests, run ``make testall``. |
| 157 | |
| 158 | If any tests fail, you can re-run the failing test(s) in verbose mode:: |
| 159 | |
| 160 | make test TESTOPTS="-v test_that_failed" |
| 161 | |
| 162 | If the failure persists and appears to be a problem with Python rather than |
| 163 | your environment, you can `file a bug report <https://bugs.python.org>`_ and |
| 164 | include relevant output from that command to show the issue. |
| 165 | |
| 166 | |
| 167 | Installing multiple versions |
| 168 | ---------------------------- |
| 169 | |
| 170 | On Unix and Mac systems if you intend to install multiple versions of Python |
| 171 | using the same installation prefix (``--prefix`` argument to the configure |
| 172 | script) you must take care that your primary python executable is not |
| 173 | overwritten by the installation of a different version. All files and |
| 174 | directories installed using ``make altinstall`` contain the major and minor |
| 175 | version and can thus live side-by-side. ``make install`` also creates |
| 176 | ``${prefix}/bin/python3`` which refers to ``${prefix}/bin/pythonX.Y``. If you |
| 177 | intend to install multiple versions using the same prefix you must decide which |
| 178 | version (if any) is your "primary" version. Install that version using ``make |
| 179 | install``. Install all other versions using ``make altinstall``. |
| 180 | |
| 181 | For example, if you want to install Python 2.7, 3.5, and 3.6 with 3.6 being the |
| 182 | primary version, you would execute ``make install`` in your 3.6 build directory |
| 183 | and ``make altinstall`` in the others. |
| 184 | |
| 185 | |
| 186 | Issue Tracker and Mailing List |
| 187 | ------------------------------ |
| 188 | |
| 189 | Bug reports are welcome! You can use the `issue tracker |
| 190 | <https://bugs.python.org>`_ to report bugs, and/or submit pull requests `on |
| 191 | GitHub <https://github.com/python/cpython>`_. |
| 192 | |
| 193 | You can also follow development discussion on the `python-dev mailing list |
| 194 | <https://mail.python.org/mailman/listinfo/python-dev/>`_. |
| 195 | |
| 196 | |
| 197 | Proposals for enhancement |
| 198 | ------------------------- |
| 199 | |
| 200 | If you have a proposal to change Python, you may want to send an email to the |
| 201 | comp.lang.python or `python-ideas`_ mailing lists for initial feedback. A |
| 202 | Python Enhancement Proposal (PEP) may be submitted if your idea gains ground. |
| 203 | All current PEPs, as well as guidelines for submitting a new PEP, are listed at |
| 204 | `python.org/dev/peps/ <https://www.python.org/dev/peps/>`_. |
| 205 | |
| 206 | .. _python-ideas: https://mail.python.org/mailman/listinfo/python-ideas/ |
| 207 | |
| 208 | |
| 209 | Release Schedule |
| 210 | ---------------- |
| 211 | |
| 212 | See :pep:`494` for Python 3.6 release details. |
| 213 | |
| 214 | |
| 215 | Copyright and License Information |
| 216 | --------------------------------- |
| 217 | |
| 218 | Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, |
| 219 | 2012, 2013, 2014, 2015, 2016 Python Software Foundation. All rights reserved. |
| 220 | |
| 221 | Copyright (c) 2000 BeOpen.com. All rights reserved. |
| 222 | |
| 223 | Copyright (c) 1995-2001 Corporation for National Research Initiatives. All |
| 224 | rights reserved. |
| 225 | |
| 226 | Copyright (c) 1991-1995 Stichting Mathematisch Centrum. All rights reserved. |
| 227 | |
| 228 | See the file "LICENSE" for information on the history of this software, terms & |
| 229 | conditions for usage, and a DISCLAIMER OF ALL WARRANTIES. |
| 230 | |
| 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. |
| 234 | |
| 235 | All trademarks referenced herein are property of their respective holders. |