Blame README.rst

rpm-build 2bd099
This is Python version 3.6.3
rpm-build 2bd099
============================
rpm-build 2bd099
rpm-build 2bd099
.. image:: https://travis-ci.org/python/cpython.svg?branch=3.6
rpm-build 2bd099
   :alt: CPython build status on Travis CI
rpm-build 2bd099
   :target: https://travis-ci.org/python/cpython
rpm-build 2bd099
rpm-build 2bd099
.. image:: https://ci.appveyor.com/api/projects/status/4mew1a93xdkbf5ua/branch/3.6?svg=true
rpm-build 2bd099
   :alt: CPython build status on Appveyor
rpm-build 2bd099
   :target: https://ci.appveyor.com/project/python/cpython/branch/3.6
rpm-build 2bd099
rpm-build 2bd099
.. image:: https://codecov.io/gh/python/cpython/branch/3.6/graph/badge.svg
rpm-build 2bd099
   :alt: CPython code coverage on Codecov
rpm-build 2bd099
   :target: https://codecov.io/gh/python/cpython
rpm-build 2bd099
rpm-build 2bd099
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
rpm-build 2bd099
2012, 2013, 2014, 2015, 2016, 2017 Python Software Foundation.  All rights
rpm-build 2bd099
reserved.
rpm-build 2bd099
rpm-build 2bd099
See the end of this file for further copyright and license information.
rpm-build 2bd099
rpm-build 2bd099
General Information
rpm-build 2bd099
-------------------
rpm-build 2bd099
rpm-build 2bd099
- Website: https://www.python.org
rpm-build 2bd099
- Source code: https://github.com/python/cpython
rpm-build 2bd099
- Issue tracker: https://bugs.python.org
rpm-build 2bd099
- Documentation: https://docs.python.org
rpm-build 2bd099
- Developer's Guide: https://devguide.python.org/
rpm-build 2bd099
rpm-build 2bd099
Contributing to CPython
rpm-build 2bd099
-----------------------
rpm-build 2bd099
rpm-build 2bd099
For more complete instructions on contributing to CPython development,
rpm-build 2bd099
see the `Developer Guide`_.
rpm-build 2bd099
rpm-build 2bd099
.. _Developer Guide: https://devguide.python.org/
rpm-build 2bd099
rpm-build 2bd099
Using Python
rpm-build 2bd099
------------
rpm-build 2bd099
rpm-build 2bd099
Installable Python kits, and information about using Python, are available at
rpm-build 2bd099
`python.org`_.
rpm-build 2bd099
rpm-build 2bd099
.. _python.org: https://www.python.org/
rpm-build 2bd099
rpm-build 2bd099
rpm-build 2bd099
Build Instructions
rpm-build 2bd099
------------------
rpm-build 2bd099
rpm-build 2bd099
On Unix, Linux, BSD, macOS, and Cygwin::
rpm-build 2bd099
rpm-build 2bd099
    ./configure
rpm-build 2bd099
    make
rpm-build 2bd099
    make test
rpm-build 2bd099
    sudo make install
rpm-build 2bd099
rpm-build 2bd099
This will install Python as python3.
rpm-build 2bd099
rpm-build 2bd099
You can pass many options to the configure script; run ``./configure --help``
rpm-build 2bd099
to find out more.  On macOS and Cygwin, the executable is called ``python.exe``;
rpm-build 2bd099
elsewhere it's just ``python``.
rpm-build 2bd099
rpm-build 2bd099
On macOS, if you have configured Python with ``--enable-framework``, you
rpm-build 2bd099
should use ``make frameworkinstall`` to do the installation.  Note that this
rpm-build 2bd099
installs the Python executable in a place that is not normally on your PATH,
rpm-build 2bd099
you may want to set up a symlink in ``/usr/local/bin``.
rpm-build 2bd099
rpm-build 2bd099
On Windows, see `PCbuild/readme.txt
rpm-build 2bd099
<https://github.com/python/cpython/blob/3.6/PCbuild/readme.txt>`_.
rpm-build 2bd099
rpm-build 2bd099
If you wish, you can create a subdirectory and invoke configure from there.
rpm-build 2bd099
For example::
rpm-build 2bd099
rpm-build 2bd099
    mkdir debug
rpm-build 2bd099
    cd debug
rpm-build 2bd099
    ../configure --with-pydebug
rpm-build 2bd099
    make
rpm-build 2bd099
    make test
rpm-build 2bd099
rpm-build 2bd099
(This will fail if you *also* built at the top-level directory.  You should do
rpm-build 2bd099
a ``make clean`` at the toplevel first.)
rpm-build 2bd099
rpm-build 2bd099
To get an optimized build of Python, ``configure --enable-optimizations``
rpm-build 2bd099
before you run ``make``.  This sets the default make targets up to enable
rpm-build 2bd099
Profile Guided Optimization (PGO) and may be used to auto-enable Link Time
rpm-build 2bd099
Optimization (LTO) on some platforms.  For more details, see the sections
rpm-build 2bd099
below.
rpm-build 2bd099
rpm-build 2bd099
rpm-build 2bd099
Profile Guided Optimization
rpm-build 2bd099
---------------------------
rpm-build 2bd099
rpm-build 2bd099
PGO takes advantage of recent versions of the GCC or Clang compilers.  If ran,
rpm-build 2bd099
``make profile-opt`` will do several steps.
rpm-build 2bd099
rpm-build 2bd099
First, the entire Python directory is cleaned of temporary files that may have
rpm-build 2bd099
resulted in a previous compilation.
rpm-build 2bd099
rpm-build 2bd099
Then, an instrumented version of the interpreter is built, using suitable
rpm-build 2bd099
compiler flags for each flavour. Note that this is just an intermediary step
rpm-build 2bd099
and the binary resulted after this step is not good for real life workloads, as
rpm-build 2bd099
it has profiling instructions embedded inside.
rpm-build 2bd099
rpm-build 2bd099
After this instrumented version of the interpreter is built, the Makefile will
rpm-build 2bd099
automatically run a training workload. This is necessary in order to profile
rpm-build 2bd099
the interpreter execution. Note also that any output, both stdout and stderr,
rpm-build 2bd099
that may appear at this step is suppressed.
rpm-build 2bd099
rpm-build 2bd099
Finally, the last step is to rebuild the interpreter, using the information
rpm-build 2bd099
collected in the previous one. The end result will be a Python binary that is
rpm-build 2bd099
optimized and suitable for distribution or production installation.
rpm-build 2bd099
rpm-build 2bd099
rpm-build 2bd099
Link Time Optimization
rpm-build 2bd099
----------------------
rpm-build 2bd099
rpm-build 2bd099
Enabled via configure's ``--with-lto`` flag.  LTO takes advantage of the
rpm-build 2bd099
ability of recent compiler toolchains to optimize across the otherwise
rpm-build 2bd099
arbitrary ``.o`` file boundary when building final executables or shared
rpm-build 2bd099
libraries for additional performance gains.
rpm-build 2bd099
rpm-build 2bd099
rpm-build 2bd099
What's New
rpm-build 2bd099
----------
rpm-build 2bd099
rpm-build 2bd099
We have a comprehensive overview of the changes in the `What's New in Python
rpm-build 2bd099
3.6 <https://docs.python.org/3.6/whatsnew/3.6.html>`_ document.  For a more
rpm-build 2bd099
detailed change log, read `Misc/NEWS
rpm-build 2bd099
<https://github.com/python/cpython/blob/3.6/Misc/NEWS.d>`_, but a full
rpm-build 2bd099
accounting of changes can only be gleaned from the `commit history
rpm-build 2bd099
<https://github.com/python/cpython/commits/3.6>`_.
rpm-build 2bd099
rpm-build 2bd099
If you want to install multiple versions of Python see the section below
rpm-build 2bd099
entitled "Installing multiple versions".
rpm-build 2bd099
rpm-build 2bd099
rpm-build 2bd099
Documentation
rpm-build 2bd099
-------------
rpm-build 2bd099
rpm-build 2bd099
`Documentation for Python 3.6 <https://docs.python.org/3.6/>`_ is online,
rpm-build 2bd099
updated daily.
rpm-build 2bd099
rpm-build 2bd099
It can also be downloaded in many formats for faster access.  The documentation
rpm-build 2bd099
is downloadable in HTML, PDF, and reStructuredText formats; the latter version
rpm-build 2bd099
is primarily for documentation authors, translators, and people with special
rpm-build 2bd099
formatting requirements.
rpm-build 2bd099
rpm-build 2bd099
For information about building Python's documentation, refer to `Doc/README.rst
rpm-build 2bd099
<https://github.com/python/cpython/blob/3.6/Doc/README.rst>`_.
rpm-build 2bd099
rpm-build 2bd099
rpm-build 2bd099
Converting From Python 2.x to 3.x
rpm-build 2bd099
---------------------------------
rpm-build 2bd099
rpm-build 2bd099
Significant backward incompatible changes were made for the release of Python
rpm-build 2bd099
3.0, which may cause programs written for Python 2 to fail when run with Python
rpm-build 2bd099
3.  For more information about porting your code from Python 2 to Python 3, see
rpm-build 2bd099
the `Porting HOWTO <https://docs.python.org/3/howto/pyporting.html>`_.
rpm-build 2bd099
rpm-build 2bd099
rpm-build 2bd099
Testing
rpm-build 2bd099
-------
rpm-build 2bd099
rpm-build 2bd099
To test the interpreter, type ``make test`` in the top-level directory.  The
rpm-build 2bd099
test set produces some output.  You can generally ignore the messages about
rpm-build 2bd099
skipped tests due to optional features which can't be imported.  If a message
rpm-build 2bd099
is printed about a failed test or a traceback or core dump is produced,
rpm-build 2bd099
something is wrong.
rpm-build 2bd099
rpm-build 2bd099
By default, tests are prevented from overusing resources like disk space and
rpm-build 2bd099
memory.  To enable these tests, run ``make testall``.
rpm-build 2bd099
rpm-build 2bd099
If any tests fail, you can re-run the failing test(s) in verbose mode::
rpm-build 2bd099
rpm-build 2bd099
    make test TESTOPTS="-v test_that_failed"
rpm-build 2bd099
rpm-build 2bd099
If the failure persists and appears to be a problem with Python rather than
rpm-build 2bd099
your environment, you can `file a bug report <https://bugs.python.org>`_ and
rpm-build 2bd099
include relevant output from that command to show the issue.
rpm-build 2bd099
rpm-build 2bd099
rpm-build 2bd099
Installing multiple versions
rpm-build 2bd099
----------------------------
rpm-build 2bd099
rpm-build 2bd099
On Unix and Mac systems if you intend to install multiple versions of Python
rpm-build 2bd099
using the same installation prefix (``--prefix`` argument to the configure
rpm-build 2bd099
script) you must take care that your primary python executable is not
rpm-build 2bd099
overwritten by the installation of a different version.  All files and
rpm-build 2bd099
directories installed using ``make altinstall`` contain the major and minor
rpm-build 2bd099
version and can thus live side-by-side.  ``make install`` also creates
rpm-build 2bd099
``${prefix}/bin/python3`` which refers to ``${prefix}/bin/pythonX.Y``.  If you
rpm-build 2bd099
intend to install multiple versions using the same prefix you must decide which
rpm-build 2bd099
version (if any) is your "primary" version.  Install that version using ``make
rpm-build 2bd099
install``.  Install all other versions using ``make altinstall``.
rpm-build 2bd099
rpm-build 2bd099
For example, if you want to install Python 2.7, 3.5, and 3.6 with 3.6 being the
rpm-build 2bd099
primary version, you would execute ``make install`` in your 3.6 build directory
rpm-build 2bd099
and ``make altinstall`` in the others.
rpm-build 2bd099
rpm-build 2bd099
rpm-build 2bd099
Issue Tracker and Mailing List
rpm-build 2bd099
------------------------------
rpm-build 2bd099
rpm-build 2bd099
Bug reports are welcome!  You can use the `issue tracker
rpm-build 2bd099
<https://bugs.python.org>`_ to report bugs, and/or submit pull requests `on
rpm-build 2bd099
GitHub <https://github.com/python/cpython>`_.
rpm-build 2bd099
rpm-build 2bd099
You can also follow development discussion on the `python-dev mailing list
rpm-build 2bd099
<https://mail.python.org/mailman/listinfo/python-dev/>`_.
rpm-build 2bd099
rpm-build 2bd099
rpm-build 2bd099
Proposals for enhancement
rpm-build 2bd099
-------------------------
rpm-build 2bd099
rpm-build 2bd099
If you have a proposal to change Python, you may want to send an email to the
rpm-build 2bd099
comp.lang.python or `python-ideas`_ mailing lists for initial feedback.  A
rpm-build 2bd099
Python Enhancement Proposal (PEP) may be submitted if your idea gains ground.
rpm-build 2bd099
All current PEPs, as well as guidelines for submitting a new PEP, are listed at
rpm-build 2bd099
`python.org/dev/peps/ <https://www.python.org/dev/peps/>`_.
rpm-build 2bd099
rpm-build 2bd099
.. _python-ideas: https://mail.python.org/mailman/listinfo/python-ideas/
rpm-build 2bd099
rpm-build 2bd099
rpm-build 2bd099
Release Schedule
rpm-build 2bd099
----------------
rpm-build 2bd099
rpm-build 2bd099
See :pep:`494` for Python 3.6 release details.
rpm-build 2bd099
rpm-build 2bd099
rpm-build 2bd099
Copyright and License Information
rpm-build 2bd099
---------------------------------
rpm-build 2bd099
rpm-build 2bd099
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
rpm-build 2bd099
2012, 2013, 2014, 2015, 2016, 2017 Python Software Foundation.  All rights
rpm-build 2bd099
reserved.
rpm-build 2bd099
rpm-build 2bd099
Copyright (c) 2000 BeOpen.com.  All rights reserved.
rpm-build 2bd099
rpm-build 2bd099
Copyright (c) 1995-2001 Corporation for National Research Initiatives.  All
rpm-build 2bd099
rights reserved.
rpm-build 2bd099
rpm-build 2bd099
Copyright (c) 1991-1995 Stichting Mathematisch Centrum.  All rights reserved.
rpm-build 2bd099
rpm-build 2bd099
See the file "LICENSE" for information on the history of this software, terms &
rpm-build 2bd099
conditions for usage, and a DISCLAIMER OF ALL WARRANTIES.
rpm-build 2bd099
rpm-build 2bd099
This Python distribution contains *no* GNU General Public License (GPL) code,
rpm-build 2bd099
so it may be used in proprietary projects.  There are interfaces to some GNU
rpm-build 2bd099
code but these are entirely optional.
rpm-build 2bd099
rpm-build 2bd099
All trademarks referenced herein are property of their respective holders.