From 859aad6a36262383b98ddd45fe3253a882b87ce8 Mon Sep 17 00:00:00 2001
From: =?utf8?q?=C3=89ric=20Araujo?=
Date: Sun, 24 Jun 2012 00:07:41 -0400
Subject: [PATCH] Remove packaging from the standard library.
Distutils2 will live on on PyPI and be included in the stdlib when it
is ready. See discussion starting at
http://mail.python.org/pipermail/python-dev/2012-June/120430.html
---
Doc/contents.rst | 2 +-
Doc/distutils/index.rst | 12 +-
Doc/install/index.rst | 56 -
Doc/install/install.rst | 1119 -------------
Doc/install/pysetup-config.rst | 44 -
Doc/install/pysetup-servers.rst | 61 -
Doc/install/pysetup.rst | 164 --
Doc/library/distutils.rst | 12 -
Doc/library/packaging-misc.rst | 27 -
Doc/library/packaging.command.rst | 111 --
Doc/library/packaging.compiler.rst | 681 --------
Doc/library/packaging.database.rst | 345 ----
Doc/library/packaging.depgraph.rst | 199 ---
Doc/library/packaging.dist.rst | 108 --
Doc/library/packaging.fancy_getopt.rst | 75 -
Doc/library/packaging.install.rst | 112 --
Doc/library/packaging.metadata.rst | 122 --
Doc/library/packaging.pypi.dist.rst | 114 --
Doc/library/packaging.pypi.rst | 74 -
Doc/library/packaging.pypi.simple.rst | 218 ---
Doc/library/packaging.pypi.xmlrpc.rst | 143 --
Doc/library/packaging.rst | 75 -
Doc/library/packaging.tests.pypi_server.rst | 105 --
Doc/library/packaging.util.rst | 155 --
Doc/library/packaging.version.rst | 104 --
Doc/library/python.rst | 1 -
Doc/library/site.rst | 4 +-
Doc/library/venv.rst | 3 +-
Doc/packaging/builtdist.rst | 302 ----
Doc/packaging/commandhooks.rst | 47 -
Doc/packaging/commandref.rst | 374 -----
Doc/packaging/configfile.rst | 125 --
Doc/packaging/examples.rst | 334 ----
Doc/packaging/extending.rst | 95 --
Doc/packaging/index.rst | 45 -
Doc/packaging/introduction.rst | 193 ---
Doc/packaging/packageindex.rst | 104 --
Doc/packaging/setupcfg.rst | 890 ----------
Doc/packaging/setupscript.rst | 693 --------
Doc/packaging/sourcedist.rst | 266 ---
Doc/packaging/tutorial.rst | 112 --
Doc/packaging/uploading.rst | 80 -
Doc/tools/sphinxext/indexcontent.html | 8 +-
Doc/tools/sphinxext/susp-ignored.csv | 22 -
Doc/using/cmdline.rst | 4 +-
Doc/using/scripts.rst | 3 +-
Doc/whatsnew/3.3.rst | 47 +-
Lib/packaging/__init__.py | 17 -
Lib/packaging/_trove.py | 571 -------
Lib/packaging/command/__init__.py | 53 -
Lib/packaging/command/bdist.py | 141 --
Lib/packaging/command/bdist_dumb.py | 139 --
Lib/packaging/command/bdist_msi.py | 743 ---------
Lib/packaging/command/bdist_wininst.py | 345 ----
Lib/packaging/command/build.py | 151 --
Lib/packaging/command/build_clib.py | 197 ---
Lib/packaging/command/build_ext.py | 644 -------
Lib/packaging/command/build_py.py | 392 -----
Lib/packaging/command/build_scripts.py | 154 --
Lib/packaging/command/check.py | 88 -
Lib/packaging/command/clean.py | 76 -
Lib/packaging/command/cmd.py | 461 -----
Lib/packaging/command/command_template | 35 -
Lib/packaging/command/config.py | 349 ----
Lib/packaging/command/install_data.py | 79 -
Lib/packaging/command/install_dist.py | 605 -------
Lib/packaging/command/install_distinfo.py | 143 --
Lib/packaging/command/install_headers.py | 43 -
Lib/packaging/command/install_lib.py | 188 ---
Lib/packaging/command/install_scripts.py | 59 -
Lib/packaging/command/register.py | 263 ---
Lib/packaging/command/sdist.py | 347 ----
Lib/packaging/command/test.py | 80 -
Lib/packaging/command/upload.py | 168 --
Lib/packaging/command/upload_docs.py | 131 --
Lib/packaging/command/wininst-10.0-amd64.exe | Bin 222208 -> 0 bytes
Lib/packaging/command/wininst-10.0.exe | Bin 190464 -> 0 bytes
Lib/packaging/command/wininst-6.0.exe | Bin 61440 -> 0 bytes
Lib/packaging/command/wininst-7.1.exe | Bin 65536 -> 0 bytes
Lib/packaging/command/wininst-8.0.exe | Bin 61440 -> 0 bytes
Lib/packaging/command/wininst-9.0-amd64.exe | Bin 223744 -> 0 bytes
Lib/packaging/command/wininst-9.0.exe | Bin 196096 -> 0 bytes
Lib/packaging/compat.py | 50 -
Lib/packaging/compiler/__init__.py | 274 ---
Lib/packaging/compiler/bcppcompiler.py | 355 ----
Lib/packaging/compiler/ccompiler.py | 863 ----------
Lib/packaging/compiler/cygwinccompiler.py | 355 ----
Lib/packaging/compiler/extension.py | 121 --
Lib/packaging/compiler/msvc9compiler.py | 721 --------
Lib/packaging/compiler/msvccompiler.py | 635 -------
Lib/packaging/compiler/unixccompiler.py | 339 ----
Lib/packaging/config.py | 391 -----
Lib/packaging/create.py | 682 --------
Lib/packaging/database.py | 651 --------
Lib/packaging/depgraph.py | 270 ---
Lib/packaging/dist.py | 769 ---------
Lib/packaging/errors.py | 138 --
Lib/packaging/fancy_getopt.py | 388 -----
Lib/packaging/install.py | 529 ------
Lib/packaging/manifest.py | 381 -----
Lib/packaging/markers.py | 189 ---
Lib/packaging/metadata.py | 570 -------
Lib/packaging/pypi/__init__.py | 9 -
Lib/packaging/pypi/base.py | 48 -
Lib/packaging/pypi/dist.py | 544 ------
Lib/packaging/pypi/errors.py | 39 -
Lib/packaging/pypi/mirrors.py | 52 -
Lib/packaging/pypi/simple.py | 462 -----
Lib/packaging/pypi/wrapper.py | 99 --
Lib/packaging/pypi/xmlrpc.py | 200 ---
Lib/packaging/run.py | 663 --------
Lib/packaging/tests/LONG_DESC.txt | 44 -
Lib/packaging/tests/PKG-INFO | 57 -
Lib/packaging/tests/SETUPTOOLS-PKG-INFO | 182 --
Lib/packaging/tests/SETUPTOOLS-PKG-INFO2 | 183 --
Lib/packaging/tests/__init__.py | 28 -
Lib/packaging/tests/__main__.py | 24 -
.../fake_dists/babar-0.1.dist-info/INSTALLER | 0
.../fake_dists/babar-0.1.dist-info/METADATA | 4 -
.../fake_dists/babar-0.1.dist-info/RECORD | 0
.../fake_dists/babar-0.1.dist-info/REQUESTED | 0
.../fake_dists/babar-0.1.dist-info/RESOURCES | 2 -
Lib/packaging/tests/fake_dists/babar.cfg | 1 -
Lib/packaging/tests/fake_dists/babar.png | 0
.../fake_dists/bacon-0.1.egg-info/PKG-INFO | 6 -
.../banana-0.4.egg/EGG-INFO/PKG-INFO | 18 -
.../banana-0.4.egg/EGG-INFO/SOURCES.txt | 0
.../EGG-INFO/dependency_links.txt | 1 -
.../banana-0.4.egg/EGG-INFO/entry_points.txt | 3 -
.../banana-0.4.egg/EGG-INFO/not-zip-safe | 1 -
.../banana-0.4.egg/EGG-INFO/requires.txt | 6 -
.../banana-0.4.egg/EGG-INFO/top_level.txt | 0
.../tests/fake_dists/cheese-2.0.2.egg-info | 5 -
.../choxie-2.0.0.9.dist-info/INSTALLER | 0
.../choxie-2.0.0.9.dist-info/METADATA | 9 -
.../choxie-2.0.0.9.dist-info/RECORD | 0
.../choxie-2.0.0.9.dist-info/REQUESTED | 0
.../choxie-2.0.0.9/choxie/__init__.py | 1 -
.../choxie-2.0.0.9/choxie/chocolate.py | 10 -
.../fake_dists/choxie-2.0.0.9/truffles.py | 5 -
.../coconuts-aster-10.3.egg-info/PKG-INFO | 5 -
.../grammar-1.0a4.dist-info/INSTALLER | 0
.../grammar-1.0a4.dist-info/METADATA | 5 -
.../fake_dists/grammar-1.0a4.dist-info/RECORD | 0
.../grammar-1.0a4.dist-info/REQUESTED | 0
.../grammar-1.0a4/grammar/__init__.py | 1 -
.../fake_dists/grammar-1.0a4/grammar/utils.py | 8 -
.../fake_dists/nut-funkyversion.egg-info | 3 -
.../tests/fake_dists/strawberry-0.6.egg | Bin 1402 -> 0 bytes
.../towel_stuff-0.1.dist-info/INSTALLER | 0
.../towel_stuff-0.1.dist-info/METADATA | 7 -
.../towel_stuff-0.1.dist-info/RECORD | 0
.../towel_stuff-0.1.dist-info/REQUESTED | 0
.../towel_stuff-0.1/towel_stuff/__init__.py | 18 -
.../tests/fake_dists/truffles-5.0.egg-info | 3 -
Lib/packaging/tests/fixer/__init__.py | 0
Lib/packaging/tests/fixer/fix_echo.py | 16 -
Lib/packaging/tests/fixer/fix_echo2.py | 16 -
Lib/packaging/tests/pypi_server.py | 449 -----
Lib/packaging/tests/pypi_test_server.py | 59 -
.../source/f/foobar/foobar-0.1.tar.gz | Bin 110 -> 0 bytes
.../simple/badmd5/badmd5-0.1.tar.gz | 0
.../simple/badmd5/index.html | 3 -
.../simple/foobar/index.html | 3 -
.../downloads_with_md5/simple/index.html | 2 -
.../foo_bar_baz/simple/bar/index.html | 6 -
.../foo_bar_baz/simple/baz/index.html | 6 -
.../foo_bar_baz/simple/foo/index.html | 6 -
.../pypiserver/foo_bar_baz/simple/index.html | 3 -
.../pypiserver/project_list/simple/index.html | 5 -
.../test_found_links/simple/foobar/index.html | 6 -
.../test_found_links/simple/index.html | 1 -
.../test_pypi_server/external/index.html | 1 -
.../test_pypi_server/simple/index.html | 1 -
.../with_externals/external/external.html | 3 -
.../with_externals/simple/foobar/index.html | 4 -
.../with_externals/simple/index.html | 1 -
.../with_norel_links/external/homepage.html | 7 -
.../with_norel_links/external/nonrel.html | 1 -
.../with_norel_links/simple/foobar/index.html | 6 -
.../with_norel_links/simple/index.html | 1 -
.../simple/foobar/index.html | 4 -
.../with_real_externals/simple/index.html | 1 -
Lib/packaging/tests/support.py | 400 -----
Lib/packaging/tests/test_ccompiler.py | 15 -
Lib/packaging/tests/test_command_bdist.py | 61 -
.../tests/test_command_bdist_dumb.py | 91 -
Lib/packaging/tests/test_command_bdist_msi.py | 25 -
.../tests/test_command_bdist_wininst.py | 32 -
Lib/packaging/tests/test_command_build.py | 56 -
.../tests/test_command_build_clib.py | 141 --
Lib/packaging/tests/test_command_build_ext.py | 394 -----
Lib/packaging/tests/test_command_build_py.py | 146 --
.../tests/test_command_build_scripts.py | 109 --
Lib/packaging/tests/test_command_check.py | 161 --
Lib/packaging/tests/test_command_clean.py | 46 -
Lib/packaging/tests/test_command_cmd.py | 102 --
Lib/packaging/tests/test_command_config.py | 76 -
.../tests/test_command_install_data.py | 148 --
.../tests/test_command_install_dist.py | 241 ---
.../tests/test_command_install_distinfo.py | 252 ---
.../tests/test_command_install_headers.py | 38 -
.../tests/test_command_install_lib.py | 110 --
.../tests/test_command_install_scripts.py | 75 -
Lib/packaging/tests/test_command_register.py | 260 ---
Lib/packaging/tests/test_command_sdist.py | 394 -----
Lib/packaging/tests/test_command_test.py | 224 ---
Lib/packaging/tests/test_command_upload.py | 159 --
.../tests/test_command_upload_docs.py | 186 ---
Lib/packaging/tests/test_compiler.py | 66 -
Lib/packaging/tests/test_config.py | 519 ------
Lib/packaging/tests/test_create.py | 233 ---
Lib/packaging/tests/test_cygwinccompiler.py | 88 -
Lib/packaging/tests/test_database.py | 686 --------
Lib/packaging/tests/test_depgraph.py | 310 ----
Lib/packaging/tests/test_dist.py | 264 ---
Lib/packaging/tests/test_extension.py | 15 -
Lib/packaging/tests/test_install.py | 391 -----
Lib/packaging/tests/test_manifest.py | 331 ----
Lib/packaging/tests/test_markers.py | 75 -
Lib/packaging/tests/test_metadata.py | 454 -----
Lib/packaging/tests/test_mixin2to3.py | 87 -
Lib/packaging/tests/test_msvc9compiler.py | 140 --
Lib/packaging/tests/test_pypi_dist.py | 287 ----
Lib/packaging/tests/test_pypi_server.py | 88 -
Lib/packaging/tests/test_pypi_simple.py | 353 ----
Lib/packaging/tests/test_pypi_xmlrpc.py | 101 --
Lib/packaging/tests/test_run.py | 92 -
Lib/packaging/tests/test_support.py | 78 -
Lib/packaging/tests/test_uninstall.py | 124 --
Lib/packaging/tests/test_unixccompiler.py | 132 --
Lib/packaging/tests/test_util.py | 1013 -----------
Lib/packaging/tests/test_version.py | 271 ---
Lib/packaging/util.py | 1480 -----------------
Lib/packaging/version.py | 451 -----
Lib/sysconfig.cfg | 3 +-
Lib/sysconfig.py | 2 +-
Lib/test/regrtest.py | 41 -
Lib/test/test_packaging.py | 5 -
Lib/test/test_venv.py | 4 -
Lib/venv/scripts/nt/pysetup3.py | 11 -
Lib/venv/scripts/posix/pysetup3 | 11 -
Makefile.pre.in | 54 -
Misc/NEWS | 2 +
Tools/scripts/pysetup3 | 4 -
setup.py | 3 +-
246 files changed, 35 insertions(+), 38866 deletions(-)
delete mode 100644 Doc/install/index.rst
delete mode 100644 Doc/install/install.rst
delete mode 100644 Doc/install/pysetup-config.rst
delete mode 100644 Doc/install/pysetup-servers.rst
delete mode 100644 Doc/install/pysetup.rst
delete mode 100644 Doc/library/packaging-misc.rst
delete mode 100644 Doc/library/packaging.command.rst
delete mode 100644 Doc/library/packaging.compiler.rst
delete mode 100644 Doc/library/packaging.database.rst
delete mode 100644 Doc/library/packaging.depgraph.rst
delete mode 100644 Doc/library/packaging.dist.rst
delete mode 100644 Doc/library/packaging.fancy_getopt.rst
delete mode 100644 Doc/library/packaging.install.rst
delete mode 100644 Doc/library/packaging.metadata.rst
delete mode 100644 Doc/library/packaging.pypi.dist.rst
delete mode 100644 Doc/library/packaging.pypi.rst
delete mode 100644 Doc/library/packaging.pypi.simple.rst
delete mode 100644 Doc/library/packaging.pypi.xmlrpc.rst
delete mode 100644 Doc/library/packaging.rst
delete mode 100644 Doc/library/packaging.tests.pypi_server.rst
delete mode 100644 Doc/library/packaging.util.rst
delete mode 100644 Doc/library/packaging.version.rst
delete mode 100644 Doc/packaging/builtdist.rst
delete mode 100644 Doc/packaging/commandhooks.rst
delete mode 100644 Doc/packaging/commandref.rst
delete mode 100644 Doc/packaging/configfile.rst
delete mode 100644 Doc/packaging/examples.rst
delete mode 100644 Doc/packaging/extending.rst
delete mode 100644 Doc/packaging/index.rst
delete mode 100644 Doc/packaging/introduction.rst
delete mode 100644 Doc/packaging/packageindex.rst
delete mode 100644 Doc/packaging/setupcfg.rst
delete mode 100644 Doc/packaging/setupscript.rst
delete mode 100644 Doc/packaging/sourcedist.rst
delete mode 100644 Doc/packaging/tutorial.rst
delete mode 100644 Doc/packaging/uploading.rst
delete mode 100644 Lib/packaging/__init__.py
delete mode 100644 Lib/packaging/_trove.py
delete mode 100644 Lib/packaging/command/__init__.py
delete mode 100644 Lib/packaging/command/bdist.py
delete mode 100644 Lib/packaging/command/bdist_dumb.py
delete mode 100644 Lib/packaging/command/bdist_msi.py
delete mode 100644 Lib/packaging/command/bdist_wininst.py
delete mode 100644 Lib/packaging/command/build.py
delete mode 100644 Lib/packaging/command/build_clib.py
delete mode 100644 Lib/packaging/command/build_ext.py
delete mode 100644 Lib/packaging/command/build_py.py
delete mode 100644 Lib/packaging/command/build_scripts.py
delete mode 100644 Lib/packaging/command/check.py
delete mode 100644 Lib/packaging/command/clean.py
delete mode 100644 Lib/packaging/command/cmd.py
delete mode 100644 Lib/packaging/command/command_template
delete mode 100644 Lib/packaging/command/config.py
delete mode 100644 Lib/packaging/command/install_data.py
delete mode 100644 Lib/packaging/command/install_dist.py
delete mode 100644 Lib/packaging/command/install_distinfo.py
delete mode 100644 Lib/packaging/command/install_headers.py
delete mode 100644 Lib/packaging/command/install_lib.py
delete mode 100644 Lib/packaging/command/install_scripts.py
delete mode 100644 Lib/packaging/command/register.py
delete mode 100644 Lib/packaging/command/sdist.py
delete mode 100644 Lib/packaging/command/test.py
delete mode 100644 Lib/packaging/command/upload.py
delete mode 100644 Lib/packaging/command/upload_docs.py
delete mode 100644 Lib/packaging/command/wininst-10.0-amd64.exe
delete mode 100644 Lib/packaging/command/wininst-10.0.exe
delete mode 100644 Lib/packaging/command/wininst-6.0.exe
delete mode 100644 Lib/packaging/command/wininst-7.1.exe
delete mode 100644 Lib/packaging/command/wininst-8.0.exe
delete mode 100644 Lib/packaging/command/wininst-9.0-amd64.exe
delete mode 100644 Lib/packaging/command/wininst-9.0.exe
delete mode 100644 Lib/packaging/compat.py
delete mode 100644 Lib/packaging/compiler/__init__.py
delete mode 100644 Lib/packaging/compiler/bcppcompiler.py
delete mode 100644 Lib/packaging/compiler/ccompiler.py
delete mode 100644 Lib/packaging/compiler/cygwinccompiler.py
delete mode 100644 Lib/packaging/compiler/extension.py
delete mode 100644 Lib/packaging/compiler/msvc9compiler.py
delete mode 100644 Lib/packaging/compiler/msvccompiler.py
delete mode 100644 Lib/packaging/compiler/unixccompiler.py
delete mode 100644 Lib/packaging/config.py
delete mode 100644 Lib/packaging/create.py
delete mode 100644 Lib/packaging/database.py
delete mode 100644 Lib/packaging/depgraph.py
delete mode 100644 Lib/packaging/dist.py
delete mode 100644 Lib/packaging/errors.py
delete mode 100644 Lib/packaging/fancy_getopt.py
delete mode 100644 Lib/packaging/install.py
delete mode 100644 Lib/packaging/manifest.py
delete mode 100644 Lib/packaging/markers.py
delete mode 100644 Lib/packaging/metadata.py
delete mode 100644 Lib/packaging/pypi/__init__.py
delete mode 100644 Lib/packaging/pypi/base.py
delete mode 100644 Lib/packaging/pypi/dist.py
delete mode 100644 Lib/packaging/pypi/errors.py
delete mode 100644 Lib/packaging/pypi/mirrors.py
delete mode 100644 Lib/packaging/pypi/simple.py
delete mode 100644 Lib/packaging/pypi/wrapper.py
delete mode 100644 Lib/packaging/pypi/xmlrpc.py
delete mode 100644 Lib/packaging/run.py
delete mode 100644 Lib/packaging/tests/LONG_DESC.txt
delete mode 100644 Lib/packaging/tests/PKG-INFO
delete mode 100644 Lib/packaging/tests/SETUPTOOLS-PKG-INFO
delete mode 100644 Lib/packaging/tests/SETUPTOOLS-PKG-INFO2
delete mode 100644 Lib/packaging/tests/__init__.py
delete mode 100644 Lib/packaging/tests/__main__.py
delete mode 100644 Lib/packaging/tests/fake_dists/babar-0.1.dist-info/INSTALLER
delete mode 100644 Lib/packaging/tests/fake_dists/babar-0.1.dist-info/METADATA
delete mode 100644 Lib/packaging/tests/fake_dists/babar-0.1.dist-info/RECORD
delete mode 100644 Lib/packaging/tests/fake_dists/babar-0.1.dist-info/REQUESTED
delete mode 100644 Lib/packaging/tests/fake_dists/babar-0.1.dist-info/RESOURCES
delete mode 100644 Lib/packaging/tests/fake_dists/babar.cfg
delete mode 100644 Lib/packaging/tests/fake_dists/babar.png
delete mode 100644 Lib/packaging/tests/fake_dists/bacon-0.1.egg-info/PKG-INFO
delete mode 100644 Lib/packaging/tests/fake_dists/banana-0.4.egg/EGG-INFO/PKG-INFO
delete mode 100644 Lib/packaging/tests/fake_dists/banana-0.4.egg/EGG-INFO/SOURCES.txt
delete mode 100644 Lib/packaging/tests/fake_dists/banana-0.4.egg/EGG-INFO/dependency_links.txt
delete mode 100644 Lib/packaging/tests/fake_dists/banana-0.4.egg/EGG-INFO/entry_points.txt
delete mode 100644 Lib/packaging/tests/fake_dists/banana-0.4.egg/EGG-INFO/not-zip-safe
delete mode 100644 Lib/packaging/tests/fake_dists/banana-0.4.egg/EGG-INFO/requires.txt
delete mode 100644 Lib/packaging/tests/fake_dists/banana-0.4.egg/EGG-INFO/top_level.txt
delete mode 100644 Lib/packaging/tests/fake_dists/cheese-2.0.2.egg-info
delete mode 100644 Lib/packaging/tests/fake_dists/choxie-2.0.0.9.dist-info/INSTALLER
delete mode 100644 Lib/packaging/tests/fake_dists/choxie-2.0.0.9.dist-info/METADATA
delete mode 100644 Lib/packaging/tests/fake_dists/choxie-2.0.0.9.dist-info/RECORD
delete mode 100644 Lib/packaging/tests/fake_dists/choxie-2.0.0.9.dist-info/REQUESTED
delete mode 100644 Lib/packaging/tests/fake_dists/choxie-2.0.0.9/choxie/__init__.py
delete mode 100644 Lib/packaging/tests/fake_dists/choxie-2.0.0.9/choxie/chocolate.py
delete mode 100644 Lib/packaging/tests/fake_dists/choxie-2.0.0.9/truffles.py
delete mode 100644 Lib/packaging/tests/fake_dists/coconuts-aster-10.3.egg-info/PKG-INFO
delete mode 100644 Lib/packaging/tests/fake_dists/grammar-1.0a4.dist-info/INSTALLER
delete mode 100644 Lib/packaging/tests/fake_dists/grammar-1.0a4.dist-info/METADATA
delete mode 100644 Lib/packaging/tests/fake_dists/grammar-1.0a4.dist-info/RECORD
delete mode 100644 Lib/packaging/tests/fake_dists/grammar-1.0a4.dist-info/REQUESTED
delete mode 100644 Lib/packaging/tests/fake_dists/grammar-1.0a4/grammar/__init__.py
delete mode 100644 Lib/packaging/tests/fake_dists/grammar-1.0a4/grammar/utils.py
delete mode 100644 Lib/packaging/tests/fake_dists/nut-funkyversion.egg-info
delete mode 100644 Lib/packaging/tests/fake_dists/strawberry-0.6.egg
delete mode 100644 Lib/packaging/tests/fake_dists/towel_stuff-0.1.dist-info/INSTALLER
delete mode 100644 Lib/packaging/tests/fake_dists/towel_stuff-0.1.dist-info/METADATA
delete mode 100644 Lib/packaging/tests/fake_dists/towel_stuff-0.1.dist-info/RECORD
delete mode 100644 Lib/packaging/tests/fake_dists/towel_stuff-0.1.dist-info/REQUESTED
delete mode 100644 Lib/packaging/tests/fake_dists/towel_stuff-0.1/towel_stuff/__init__.py
delete mode 100644 Lib/packaging/tests/fake_dists/truffles-5.0.egg-info
delete mode 100644 Lib/packaging/tests/fixer/__init__.py
delete mode 100644 Lib/packaging/tests/fixer/fix_echo.py
delete mode 100644 Lib/packaging/tests/fixer/fix_echo2.py
delete mode 100644 Lib/packaging/tests/pypi_server.py
delete mode 100644 Lib/packaging/tests/pypi_test_server.py
delete mode 100644 Lib/packaging/tests/pypiserver/downloads_with_md5/packages/source/f/foobar/foobar-0.1.tar.gz
delete mode 100644 Lib/packaging/tests/pypiserver/downloads_with_md5/simple/badmd5/badmd5-0.1.tar.gz
delete mode 100644 Lib/packaging/tests/pypiserver/downloads_with_md5/simple/badmd5/index.html
delete mode 100644 Lib/packaging/tests/pypiserver/downloads_with_md5/simple/foobar/index.html
delete mode 100644 Lib/packaging/tests/pypiserver/downloads_with_md5/simple/index.html
delete mode 100644 Lib/packaging/tests/pypiserver/foo_bar_baz/simple/bar/index.html
delete mode 100644 Lib/packaging/tests/pypiserver/foo_bar_baz/simple/baz/index.html
delete mode 100644 Lib/packaging/tests/pypiserver/foo_bar_baz/simple/foo/index.html
delete mode 100644 Lib/packaging/tests/pypiserver/foo_bar_baz/simple/index.html
delete mode 100644 Lib/packaging/tests/pypiserver/project_list/simple/index.html
delete mode 100644 Lib/packaging/tests/pypiserver/test_found_links/simple/foobar/index.html
delete mode 100644 Lib/packaging/tests/pypiserver/test_found_links/simple/index.html
delete mode 100644 Lib/packaging/tests/pypiserver/test_pypi_server/external/index.html
delete mode 100644 Lib/packaging/tests/pypiserver/test_pypi_server/simple/index.html
delete mode 100644 Lib/packaging/tests/pypiserver/with_externals/external/external.html
delete mode 100644 Lib/packaging/tests/pypiserver/with_externals/simple/foobar/index.html
delete mode 100644 Lib/packaging/tests/pypiserver/with_externals/simple/index.html
delete mode 100644 Lib/packaging/tests/pypiserver/with_norel_links/external/homepage.html
delete mode 100644 Lib/packaging/tests/pypiserver/with_norel_links/external/nonrel.html
delete mode 100644 Lib/packaging/tests/pypiserver/with_norel_links/simple/foobar/index.html
delete mode 100644 Lib/packaging/tests/pypiserver/with_norel_links/simple/index.html
delete mode 100644 Lib/packaging/tests/pypiserver/with_real_externals/simple/foobar/index.html
delete mode 100644 Lib/packaging/tests/pypiserver/with_real_externals/simple/index.html
delete mode 100644 Lib/packaging/tests/support.py
delete mode 100644 Lib/packaging/tests/test_ccompiler.py
delete mode 100644 Lib/packaging/tests/test_command_bdist.py
delete mode 100644 Lib/packaging/tests/test_command_bdist_dumb.py
delete mode 100644 Lib/packaging/tests/test_command_bdist_msi.py
delete mode 100644 Lib/packaging/tests/test_command_bdist_wininst.py
delete mode 100644 Lib/packaging/tests/test_command_build.py
delete mode 100644 Lib/packaging/tests/test_command_build_clib.py
delete mode 100644 Lib/packaging/tests/test_command_build_ext.py
delete mode 100644 Lib/packaging/tests/test_command_build_py.py
delete mode 100644 Lib/packaging/tests/test_command_build_scripts.py
delete mode 100644 Lib/packaging/tests/test_command_check.py
delete mode 100644 Lib/packaging/tests/test_command_clean.py
delete mode 100644 Lib/packaging/tests/test_command_cmd.py
delete mode 100644 Lib/packaging/tests/test_command_config.py
delete mode 100644 Lib/packaging/tests/test_command_install_data.py
delete mode 100644 Lib/packaging/tests/test_command_install_dist.py
delete mode 100644 Lib/packaging/tests/test_command_install_distinfo.py
delete mode 100644 Lib/packaging/tests/test_command_install_headers.py
delete mode 100644 Lib/packaging/tests/test_command_install_lib.py
delete mode 100644 Lib/packaging/tests/test_command_install_scripts.py
delete mode 100644 Lib/packaging/tests/test_command_register.py
delete mode 100644 Lib/packaging/tests/test_command_sdist.py
delete mode 100644 Lib/packaging/tests/test_command_test.py
delete mode 100644 Lib/packaging/tests/test_command_upload.py
delete mode 100644 Lib/packaging/tests/test_command_upload_docs.py
delete mode 100644 Lib/packaging/tests/test_compiler.py
delete mode 100644 Lib/packaging/tests/test_config.py
delete mode 100644 Lib/packaging/tests/test_create.py
delete mode 100644 Lib/packaging/tests/test_cygwinccompiler.py
delete mode 100644 Lib/packaging/tests/test_database.py
delete mode 100644 Lib/packaging/tests/test_depgraph.py
delete mode 100644 Lib/packaging/tests/test_dist.py
delete mode 100644 Lib/packaging/tests/test_extension.py
delete mode 100644 Lib/packaging/tests/test_install.py
delete mode 100644 Lib/packaging/tests/test_manifest.py
delete mode 100644 Lib/packaging/tests/test_markers.py
delete mode 100644 Lib/packaging/tests/test_metadata.py
delete mode 100644 Lib/packaging/tests/test_mixin2to3.py
delete mode 100644 Lib/packaging/tests/test_msvc9compiler.py
delete mode 100644 Lib/packaging/tests/test_pypi_dist.py
delete mode 100644 Lib/packaging/tests/test_pypi_server.py
delete mode 100644 Lib/packaging/tests/test_pypi_simple.py
delete mode 100644 Lib/packaging/tests/test_pypi_xmlrpc.py
delete mode 100644 Lib/packaging/tests/test_run.py
delete mode 100644 Lib/packaging/tests/test_support.py
delete mode 100644 Lib/packaging/tests/test_uninstall.py
delete mode 100644 Lib/packaging/tests/test_unixccompiler.py
delete mode 100644 Lib/packaging/tests/test_util.py
delete mode 100644 Lib/packaging/tests/test_version.py
delete mode 100644 Lib/packaging/util.py
delete mode 100644 Lib/packaging/version.py
delete mode 100644 Lib/test/test_packaging.py
delete mode 100644 Lib/venv/scripts/nt/pysetup3.py
delete mode 100644 Lib/venv/scripts/posix/pysetup3
delete mode 100755 Tools/scripts/pysetup3
diff --git a/Doc/contents.rst b/Doc/contents.rst
index cc5c8e3794..c0c6af34d9 100644
--- a/Doc/contents.rst
+++ b/Doc/contents.rst
@@ -11,7 +11,7 @@
library/index.rst
extending/index.rst
c-api/index.rst
- packaging/index.rst
+ distutils/index.rst
install/index.rst
howto/index.rst
faq/index.rst
diff --git a/Doc/distutils/index.rst b/Doc/distutils/index.rst
index c8dd9f46a8..ace8280894 100644
--- a/Doc/distutils/index.rst
+++ b/Doc/distutils/index.rst
@@ -14,12 +14,9 @@ the module developer's point of view, describing how to use the Distutils to
make Python modules and extensions easily available to a wider audience with
very little overhead for build/release/install mechanics.
-.. deprecated:: 3.3
- :mod:`packaging` replaces Distutils. See :ref:`packaging-index` and
- :ref:`packaging-install-index`.
-
.. toctree::
:maxdepth: 2
+ :numbered:
introduction.rst
setupscript.rst
@@ -32,10 +29,3 @@ very little overhead for build/release/install mechanics.
extending.rst
commandref.rst
apiref.rst
-
-Another document describes how to install modules and extensions packaged
-following the above guidelines:
-
-.. toctree::
-
- install.rst
diff --git a/Doc/install/index.rst b/Doc/install/index.rst
deleted file mode 100644
index bb2e9c58f1..0000000000
--- a/Doc/install/index.rst
+++ /dev/null
@@ -1,56 +0,0 @@
-.. _packaging-install-index:
-
-******************************
- Installing Python Projects
-******************************
-
-:Author: The Fellowship of the Packaging
-:Release: |version|
-:Date: |today|
-
-.. TODO: Fill in XXX comments
-
-.. The audience for this document includes people who don't know anything
- about Python and aren't about to learn the language just in order to
- install and maintain it for their users, i.e. system administrators.
- Thus, I have to be sure to explain the basics at some point:
- sys.path and PYTHONPATH at least. Should probably give pointers to
- other docs on "import site", PYTHONSTARTUP, PYTHONHOME, etc.
-
- Finally, it might be useful to include all the material from my "Care
- and Feeding of a Python Installation" talk in here somewhere. Yow!
-
-.. topic:: Abstract
-
- This document describes Packaging from the end-user's point of view: it
- explains how to extend the functionality of a standard Python installation by
- building and installing third-party Python modules and applications.
-
-
-This guide is split into a simple overview followed by a longer presentation of
-the :program:`pysetup` script, the Python package management tool used to
-build, distribute, search for, install, remove and list Python distributions.
-
-.. TODO integrate install and pysetup instead of duplicating
-
-.. toctree::
- :maxdepth: 2
- :numbered:
-
- install
- pysetup
- pysetup-config
- pysetup-servers
-
-
-.. seealso::
-
- :ref:`packaging-index`
- The manual for developers of Python projects who want to package and
- distribute them. This describes how to use :mod:`packaging` to make
- projects easily found and added to an existing Python installation.
-
- :mod:`packaging`
- A library reference for developers of packaging tools wanting to use
- standalone building blocks like :mod:`~packaging.version` or
- :mod:`~packaging.metadata`, or extend Packaging itself.
diff --git a/Doc/install/install.rst b/Doc/install/install.rst
deleted file mode 100644
index b3e655b069..0000000000
--- a/Doc/install/install.rst
+++ /dev/null
@@ -1,1119 +0,0 @@
-.. highlightlang:: none
-
-====================================
-Installing Python projects: overview
-====================================
-
-.. _packaging-install-intro:
-
-Introduction
-============
-
-Although Python's extensive standard library covers many programming needs,
-there often comes a time when you need to add new functionality to your Python
-installation in the form of third-party modules. This might be necessary to
-support your own programming, or to support an application that you want to use
-and that happens to be written in Python.
-
-In the past, there was little support for adding third-party modules to an
-existing Python installation. With the introduction of the Python Distribution
-Utilities (Distutils for short) in Python 2.0, this changed. However, not all
-problems were solved; end-users had to rely on ``easy_install`` or
-``pip`` to download third-party modules from PyPI, uninstall distributions or do
-other maintenance operations. Packaging is a more complete replacement for
-Distutils, in the standard library, with a backport named Distutils2 available
-for older Python versions.
-
-This document is aimed primarily at people who need to install third-party
-Python modules: end-users and system administrators who just need to get some
-Python application running, and existing Python programmers who want to add
-new goodies to their toolbox. You don't need to know Python to read this
-document; there will be some brief forays into using Python's interactive mode
-to explore your installation, but that's it. If you're looking for information
-on how to distribute your own Python modules so that others may use them, see
-the :ref:`packaging-index` manual.
-
-
-.. _packaging-trivial-install:
-
-Best case: trivial installation
--------------------------------
-
-In the best case, someone will have prepared a special version of the module
-distribution you want to install that is targeted specifically at your platform
-and can be installed just like any other software on your platform. For example,
-the module's developer might make an executable installer available for Windows
-users, an RPM package for users of RPM-based Linux systems (Red Hat, SuSE,
-Mandrake, and many others), a Debian package for users of Debian and derivative
-systems, and so forth.
-
-In that case, you would use the standard system tools to download and install
-the specific installer for your platform and its dependencies.
-
-Of course, things will not always be that easy. You might be interested in a
-module whose distribution doesn't have an easy-to-use installer for your
-platform. In that case, you'll have to start with the source distribution
-released by the module's author/maintainer. Installing from a source
-distribution is not too hard, as long as the modules are packaged in the
-standard way. The bulk of this document addresses the building and installing
-of modules from standard source distributions.
-
-
-.. _packaging-distutils:
-
-The Python standard: Distutils
-------------------------------
-
-If you download a source distribution of a module, it will be obvious whether
-it was packaged and distributed using Distutils. First, the distribution's name
-and version number will be featured prominently in the name of the downloaded
-archive, e.g. :file:`foo-1.0.tar.gz` or :file:`widget-0.9.7.zip`. Next, the
-archive will unpack into a similarly-named directory: :file:`foo-1.0` or
-:file:`widget-0.9.7`. Additionally, the distribution may contain a
-:file:`setup.cfg` file and a file named :file:`README.txt` ---or possibly just
-:file:`README`--- explaining that building and installing the module
-distribution is a simple matter of issuing the following command at your shell's
-prompt::
-
- python setup.py install
-
-Third-party projects have extended Distutils to work around its limitations or
-add functionality. After some years of near-inactivity in Distutils, a new
-maintainer has started to standardize good ideas in PEPs and implement them in a
-new, improved version of Distutils, called Distutils2 or Packaging.
-
-
-.. _packaging-new-standard:
-
-The new standard: Packaging
----------------------------
-
-The rules described in the first paragraph above apply to Packaging-based
-projects too: a source distribution will have a name like
-:file:`widget-0.9.7.zip`. One of the main differences with Distutils is that
-distributions no longer have a :file:`setup.py` script; it used to cause a
-number of issues. Now there is a unique script installed with Python itself::
-
- pysetup install widget-0.9.7.zip
-
-Running this command is enough to build and install projects (Python modules or
-packages, scripts or whole applications), without even having to unpack the
-archive. It is also compatible with Distutils-based distributions.
-
-Unless you have to perform non-standard installations or customize the build
-process, you can stop reading this manual ---the above command is everything you
-need to get out of it.
-
-With :program:`pysetup`, you won't even have to manually download a distribution
-before installing it; see :ref:`packaging-pysetup`.
-
-
-.. _packaging-standard-install:
-
-Standard build and install
-==========================
-
-As described in section :ref:`packaging-new-standard`, building and installing
-a module distribution using Packaging usually comes down to one simple
-command::
-
- pysetup run install_dist
-
-This is a command that should be run in a terminal. On Windows, it is called a
-command prompt and found in :menuselection:`Start --> Accessories`; Powershell
-is a popular alternative.
-
-
-.. _packaging-platform-variations:
-
-Platform variations
--------------------
-
-The setup command is meant to be run from the root directory of the source
-distribution, i.e. the top-level subdirectory that the module source
-distribution unpacks into. For example, if you've just downloaded a module
-source distribution :file:`foo-1.0.tar.gz` onto a Unix system, the normal
-steps to follow are these::
-
- gunzip -c foo-1.0.tar.gz | tar xf - # unpacks into directory foo-1.0
- cd foo-1.0
- pysetup run install_dist
-
-On Windows, you'd probably download :file:`foo-1.0.zip`. If you downloaded the
-archive file to :file:`C:\\Temp`, then it would unpack into
-:file:`C:\\Temp\\foo-1.0`. To actually unpack the archive, you can use either
-an archive manipulator with a graphical user interface (such as WinZip or 7-Zip)
-or a command-line tool (such as :program:`unzip`, :program:`pkunzip` or, again,
-:program:`7z`). Then, open a command prompt window and run::
-
- cd c:\Temp\foo-1.0
- pysetup run install_dist
-
-
-.. _packaging-splitting-up:
-
-Splitting the job up
---------------------
-
-Running ``pysetup run install_dist`` builds and installs all modules in one go. If you
-prefer to work incrementally ---especially useful if you want to customize the
-build process, or if things are going wrong--- you can use the setup script to
-do one thing at a time. This is a valuable tool when different users will perform
-separately the build and install steps. For example, you might want to build a
-module distribution and hand it off to a system administrator for installation
-(or do it yourself, but with super-user or admin privileges).
-
-For example, to build everything in one step and then install everything
-in a second step, you aptly invoke two distinct Packaging commands::
-
- pysetup run build
- pysetup run install_dist
-
-If you do this, you will notice that invoking the :command:`install_dist` command
-first runs the :command:`build` command, which ---in this case--- quickly
-notices it can spare itself the work, since everything in the :file:`build`
-directory is up-to-date.
-
-You may often ignore this ability to divide the process in steps if all you do
-is installing modules downloaded from the Internet, but it's very handy for
-more advanced tasks. If you find yourself in the need for distributing your own
-Python modules and extensions, though, you'll most likely run many individual
-Packaging commands.
-
-
-.. _packaging-how-build-works:
-
-How building works
-------------------
-
-As implied above, the :command:`build` command is responsible for collecting
-and placing the files to be installed into a *build directory*. By default,
-this is :file:`build`, under the distribution root. If you're excessively
-concerned with speed, or want to keep the source tree pristine, you can specify
-a different build directory with the :option:`--build-base` option. For example::
-
- pysetup run build --build-base /tmp/pybuild/foo-1.0
-
-(Or you could do this permanently with a directive in your system or personal
-Packaging configuration file; see section :ref:`packaging-config-files`.)
-In the usual case, however, all this is unnecessary.
-
-The build tree's default layout looks like so::
-
- --- build/ --- lib/
- or
- --- build/ --- lib./
- temp./
-
-where ```` expands to a brief description of the current OS/hardware
-platform and Python version. The first form, with just a :file:`lib` directory,
-is used for pure module distributions (module distributions that
-include only pure Python modules). If a module distribution contains any
-extensions (modules written in C/C++), then the second form, with two ````
-directories, is used. In that case, the :file:`temp.{plat}` directory holds
-temporary files generated during the compile/link process which are not intended
-to be installed. In either case, the :file:`lib` (or :file:`lib.{plat}`) directory
-contains all Python modules (pure Python and extensions) to be installed.
-
-In the future, more directories will be added to handle Python scripts,
-documentation, binary executables, and whatever else is required to install
-Python modules and applications.
-
-
-.. _packaging-how-install-works:
-
-How installation works
-----------------------
-
-After the :command:`build` command is run (whether explicitly or by the
-:command:`install_dist` command on your behalf), the work of the :command:`install_dist`
-command is relatively simple: all it has to do is copy the contents of
-:file:`build/lib` (or :file:`build/lib.{plat}`) to the installation directory
-of your choice.
-
-If you don't choose an installation directory ---i.e., if you just run
-``pysetup run install_dist``\ --- then the :command:`install_dist` command
-installs to the standard location for third-party Python modules. This location
-varies by platform and depending on how you built/installed Python itself. On
-Unix (and Mac OS X, which is also Unix-based), it also depends on whether the
-module distribution being installed is pure Python or contains extensions
-("non-pure"):
-
-+-----------------+-----------------------------------------------------+--------------------------------------------------+-------+
-| Platform | Standard installation location | Default value | Notes |
-+=================+=====================================================+==================================================+=======+
-| Unix (pure) | :file:`{prefix}/lib/python{X.Y}/site-packages` | :file:`/usr/local/lib/python{X.Y}/site-packages` | \(1) |
-+-----------------+-----------------------------------------------------+--------------------------------------------------+-------+
-| Unix (non-pure) | :file:`{exec-prefix}/lib/python{X.Y}/site-packages` | :file:`/usr/local/lib/python{X.Y}/site-packages` | \(1) |
-+-----------------+-----------------------------------------------------+--------------------------------------------------+-------+
-| Windows | :file:`{prefix}\\Lib\\site-packages` | :file:`C:\\Python{XY}\\Lib\\site-packages` | \(2) |
-+-----------------+-----------------------------------------------------+--------------------------------------------------+-------+
-
-Notes:
-
-(1)
- Most Linux distributions include Python as a standard part of the system, so
- :file:`{prefix}` and :file:`{exec-prefix}` are usually both :file:`/usr` on
- Linux. If you build Python yourself on Linux (or any Unix-like system), the
- default :file:`{prefix}` and :file:`{exec-prefix}` are :file:`/usr/local`.
-
-(2)
- The default installation directory on Windows was :file:`C:\\Program
- Files\\Python` under Python 1.6a1, 1.5.2, and earlier.
-
-:file:`{prefix}` and :file:`{exec-prefix}` stand for the directories that Python
-is installed to, and where it finds its libraries at run-time. They are always
-the same under Windows, and very often the same under Unix and Mac OS X. You
-can find out what your Python installation uses for :file:`{prefix}` and
-:file:`{exec-prefix}` by running Python in interactive mode and typing a few
-simple commands.
-
-.. TODO link to Doc/using instead of duplicating
-
-To start the interactive Python interpreter, you need to follow a slightly
-different recipe for each platform. Under Unix, just type :command:`python` at
-the shell prompt. Under Windows (assuming the Python executable is on your
-:envvar:`PATH`, which is the usual case), you can choose :menuselection:`Start --> Run`,
-type ``python`` and press ``enter``. Alternatively, you can simply execute
-:command:`python` at a command prompt (:menuselection:`Start --> Accessories`)
-or in Powershell.
-
-Once the interpreter is started, you type Python code at the prompt. For
-example, on my Linux system, I type the three Python statements shown below,
-and get the output as shown, to find out my :file:`{prefix}` and :file:`{exec-prefix}`::
-
- Python 3.3 (r32:88445, Apr 2 2011, 10:43:54)
- Type "help", "copyright", "credits" or "license" for more information.
- >>> import sys
- >>> sys.prefix
- '/usr'
- >>> sys.exec_prefix
- '/usr'
-
-A few other placeholders are used in this document: :file:`{X.Y}` stands for the
-version of Python, for example ``3.2``; :file:`{abiflags}` will be replaced by
-the value of :data:`sys.abiflags` or the empty string for platforms which don't
-define ABI flags; :file:`{distname}` will be replaced by the name of the module
-distribution being installed. Dots and capitalization are important in the
-paths; for example, a value that uses ``python3.2`` on UNIX will typically use
-``Python32`` on Windows.
-
-If you don't want to install modules to the standard location, or if you don't
-have permission to write there, then you need to read about alternate
-installations in section :ref:`packaging-alt-install`. If you want to customize your
-installation directories more heavily, see section :ref:`packaging-custom-install`.
-
-
-.. _packaging-alt-install:
-
-Alternate installation
-======================
-
-Often, it is necessary or desirable to install modules to a location other than
-the standard location for third-party Python modules. For example, on a Unix
-system you might not have permission to write to the standard third-party module
-directory. Or you might wish to try out a module before making it a standard
-part of your local Python installation. This is especially true when upgrading
-a distribution already present: you want to make sure your existing base of
-scripts still works with the new version before actually upgrading.
-
-The Packaging :command:`install_dist` command is designed to make installing module
-distributions to an alternate location simple and painless. The basic idea is
-that you supply a base directory for the installation, and the
-:command:`install_dist` command picks a set of directories (called an *installation
-scheme*) under this base directory in which to install files. The details
-differ across platforms, so read whichever of the following sections applies to
-you.
-
-Note that the various alternate installation schemes are mutually exclusive: you
-can pass ``--user``, or ``--home``, or ``--prefix`` and ``--exec-prefix``, or
-``--install-base`` and ``--install-platbase``, but you can't mix from these
-groups.
-
-
-.. _packaging-alt-install-user:
-
-Alternate installation: the user scheme
----------------------------------------
-
-This scheme is designed to be the most convenient solution for users that don't
-have write permission to the global site-packages directory or don't want to
-install into it. It is enabled with a simple option::
-
- pysetup run install_dist --user
-
-Files will be installed into subdirectories of :data:`site.USER_BASE` (written
-as :file:`{userbase}` hereafter). This scheme installs pure Python modules and
-extension modules in the same location (also known as :data:`site.USER_SITE`).
-Here are the values for UNIX, including non-framework builds on Mac OS X:
-
-=============== ===========================================================
-Type of file Installation directory
-=============== ===========================================================
-modules :file:`{userbase}/lib/python{X.Y}/site-packages`
-scripts :file:`{userbase}/bin`
-data :file:`{userbase}`
-C headers :file:`{userbase}/include/python{X.Y}`
-=============== ===========================================================
-
-Framework builds on Mac OS X use these paths:
-
-=============== ===========================================================
-Type of file Installation directory
-=============== ===========================================================
-modules :file:`{userbase}/lib/python/site-packages`
-scripts :file:`{userbase}/bin`
-data :file:`{userbase}`
-C headers :file:`{userbase}/include/python`
-=============== ===========================================================
-
-And here are the values used on Windows:
-
-=============== ===========================================================
-Type of file Installation directory
-=============== ===========================================================
-modules :file:`{userbase}\\Python{XY}\\site-packages`
-scripts :file:`{userbase}\\Scripts`
-data :file:`{userbase}`
-C headers :file:`{userbase}\\Python{XY}\\Include`
-=============== ===========================================================
-
-The advantage of using this scheme compared to the other ones described below is
-that the user site-packages directory is under normal conditions always included
-in :data:`sys.path` (see :mod:`site` for more information), which means that
-there is no additional step to perform after running ``pysetup`` to finalize the
-installation.
-
-The :command:`build_ext` command also has a ``--user`` option to add
-:file:`{userbase}/include` to the compiler search path for header files and
-:file:`{userbase}/lib` to the compiler search path for libraries as well as to
-the runtime search path for shared C libraries (rpath).
-
-
-.. _packaging-alt-install-home:
-
-Alternate installation: the home scheme
----------------------------------------
-
-The idea behind the "home scheme" is that you build and maintain a personal
-stash of Python modules. This scheme's name is derived from the concept of a
-"home" directory on Unix, since it's not unusual for a Unix user to make their
-home directory have a layout similar to :file:`/usr/` or :file:`/usr/local/`.
-In spite of its name's origin, this scheme can be used by anyone, regardless
-of the operating system.
-
-Installing a new module distribution in this way is as simple as ::
-
- pysetup run install_dist --home
-
-where you can supply any directory you like for the :option:`--home` option. On
-Unix, lazy typists can just type a tilde (``~``); the :command:`install_dist` command
-will expand this to your home directory::
-
- pysetup run install_dist --home ~
-
-To make Python find the distributions installed with this scheme, you may have
-to :ref:`modify Python's search path ` or edit
-:mod:`sitecustomize` (see :mod:`site`) to call :func:`site.addsitedir` or edit
-:data:`sys.path`.
-
-The :option:`--home` option defines the base directory for the installation.
-Under it, files are installed to the following directories:
-
-=============== ===========================================================
-Type of file Installation directory
-=============== ===========================================================
-modules :file:`{home}/lib/python`
-scripts :file:`{home}/bin`
-data :file:`{home}`
-C headers :file:`{home}/include/python`
-=============== ===========================================================
-
-(Mentally replace slashes with backslashes if you're on Windows.)
-
-
-.. _packaging-alt-install-prefix-unix:
-
-Alternate installation: Unix (the prefix scheme)
-------------------------------------------------
-
-The "prefix scheme" is useful when you wish to use one Python installation to
-run the build command, but install modules into the third-party module directory
-of a different Python installation (or something that looks like a different
-Python installation). If this sounds a trifle unusual, it is ---that's why the
-user and home schemes come before. However, there are at least two known cases
-where the prefix scheme will be useful.
-
-First, consider that many Linux distributions put Python in :file:`/usr`, rather
-than the more traditional :file:`/usr/local`. This is entirely appropriate,
-since in those cases Python is part of "the system" rather than a local add-on.
-However, if you are installing Python modules from source, you probably want
-them to go in :file:`/usr/local/lib/python2.{X}` rather than
-:file:`/usr/lib/python2.{X}`. This can be done with ::
-
- pysetup run install_dist --prefix /usr/local
-
-Another possibility is a network filesystem where the name used to write to a
-remote directory is different from the name used to read it: for example, the
-Python interpreter accessed as :file:`/usr/local/bin/python` might search for
-modules in :file:`/usr/local/lib/python2.{X}`, but those modules would have to
-be installed to, say, :file:`/mnt/{@server}/export/lib/python2.{X}`. This could
-be done with ::
-
- pysetup run install_dist --prefix=/mnt/@server/export
-
-In either case, the :option:`--prefix` option defines the installation base, and
-the :option:`--exec-prefix` option defines the platform-specific installation
-base, which is used for platform-specific files. (Currently, this just means
-non-pure module distributions, but could be expanded to C libraries, binary
-executables, etc.) If :option:`--exec-prefix` is not supplied, it defaults to
-:option:`--prefix`. Files are installed as follows:
-
-================= ==========================================================
-Type of file Installation directory
-================= ==========================================================
-Python modules :file:`{prefix}/lib/python{X.Y}/site-packages`
-extension modules :file:`{exec-prefix}/lib/python{X.Y}/site-packages`
-scripts :file:`{prefix}/bin`
-data :file:`{prefix}`
-C headers :file:`{prefix}/include/python{X.Y}{abiflags}`
-================= ==========================================================
-
-.. XXX misses an entry for platinclude
-
-There is no requirement that :option:`--prefix` or :option:`--exec-prefix`
-actually point to an alternate Python installation; if the directories listed
-above do not already exist, they are created at installation time.
-
-Incidentally, the real reason the prefix scheme is important is simply that a
-standard Unix installation uses the prefix scheme, but with :option:`--prefix`
-and :option:`--exec-prefix` supplied by Python itself as ``sys.prefix`` and
-``sys.exec_prefix``. Thus, you might think you'll never use the prefix scheme,
-but every time you run ``pysetup run install_dist`` without any other
-options, you're using it.
-
-Note that installing extensions to an alternate Python installation doesn't have
-anything to do with how those extensions are built: in particular, extensions
-will be compiled using the Python header files (:file:`Python.h` and friends)
-installed with the Python interpreter used to run the build command. It is
-therefore your responsibility to ensure compatibility between the interpreter
-intended to run extensions installed in this way and the interpreter used to
-build these same extensions. To avoid problems, it is best to make sure that
-the two interpreters are the same version of Python (possibly different builds,
-or possibly copies of the same build). (Of course, if your :option:`--prefix`
-and :option:`--exec-prefix` don't even point to an alternate Python installation,
-this is immaterial.)
-
-
-.. _packaging-alt-install-prefix-windows:
-
-Alternate installation: Windows (the prefix scheme)
----------------------------------------------------
-
-Windows has a different and vaguer notion of home directories than Unix, and
-since its standard Python installation is simpler, the :option:`--prefix` option
-has traditionally been used to install additional packages to arbitrary
-locations. ::
-
- pysetup run install_dist --prefix "\Temp\Python"
-
-to install modules to the :file:`\\Temp\\Python` directory on the current drive.
-
-The installation base is defined by the :option:`--prefix` option; the
-:option:`--exec-prefix` option is not supported under Windows, which means that
-pure Python modules and extension modules are installed into the same location.
-Files are installed as follows:
-
-=============== ==========================================================
-Type of file Installation directory
-=============== ==========================================================
-modules :file:`{prefix}\\Lib\\site-packages`
-scripts :file:`{prefix}\\Scripts`
-data :file:`{prefix}`
-C headers :file:`{prefix}\\Include`
-=============== ==========================================================
-
-
-.. _packaging-custom-install:
-
-Custom installation
-===================
-
-Sometimes, the alternate installation schemes described in section
-:ref:`packaging-alt-install` just don't do what you want. You might want to tweak
-just one or two directories while keeping everything under the same base
-directory, or you might want to completely redefine the installation scheme.
-In either case, you're creating a *custom installation scheme*.
-
-To create a custom installation scheme, you start with one of the alternate
-schemes and override some of the installation directories used for the various
-types of files, using these options:
-
-====================== =======================
-Type of file Override option
-====================== =======================
-Python modules ``--install-purelib``
-extension modules ``--install-platlib``
-all modules ``--install-lib``
-scripts ``--install-scripts``
-data ``--install-data``
-C headers ``--install-headers``
-====================== =======================
-
-These override options can be relative, absolute,
-or explicitly defined in terms of one of the installation base directories.
-(There are two installation base directories, and they are normally the same
----they only differ when you use the Unix "prefix scheme" and supply different
-``--prefix`` and ``--exec-prefix`` options; using ``--install-lib`` will
-override values computed or given for ``--install-purelib`` and
-``--install-platlib``, and is recommended for schemes that don't make a
-difference between Python and extension modules.)
-
-For example, say you're installing a module distribution to your home directory
-under Unix, but you want scripts to go in :file:`~/scripts` rather than
-:file:`~/bin`. As you might expect, you can override this directory with the
-:option:`--install-scripts` option and, in this case, it makes most sense to supply
-a relative path, which will be interpreted relative to the installation base
-directory (in our example, your home directory)::
-
- pysetup run install_dist --home ~ --install-scripts scripts
-
-Another Unix example: suppose your Python installation was built and installed
-with a prefix of :file:`/usr/local/python`. Thus, in a standard installation,
-scripts will wind up in :file:`/usr/local/python/bin`. If you want them in
-:file:`/usr/local/bin` instead, you would supply this absolute directory for
-the :option:`--install-scripts` option::
-
- pysetup run install_dist --install-scripts /usr/local/bin
-
-This command performs an installation using the "prefix scheme", where the
-prefix is whatever your Python interpreter was installed with ---in this case,
-:file:`/usr/local/python`.
-
-If you maintain Python on Windows, you might want third-party modules to live in
-a subdirectory of :file:`{prefix}`, rather than right in :file:`{prefix}`
-itself. This is almost as easy as customizing the script installation directory
----you just have to remember that there are two types of modules to worry about,
-Python and extension modules, which can conveniently be both controlled by one
-option::
-
- pysetup run install_dist --install-lib Site
-
-.. XXX Nothing is installed right under prefix in windows, is it??
-
-The specified installation directory is relative to :file:`{prefix}`. Of
-course, you also have to ensure that this directory is in Python's module
-search path, such as by putting a :file:`.pth` file in a site directory (see
-:mod:`site`). See section :ref:`packaging-search-path` to find out how to modify
-Python's search path.
-
-If you want to define an entire installation scheme, you just have to supply all
-of the installation directory options. Using relative paths is recommended here.
-For example, if you want to maintain all Python module-related files under
-:file:`python` in your home directory, and you want a separate directory for
-each platform that you use your home directory from, you might define the
-following installation scheme::
-
- pysetup run install_dist --home ~ \
- --install-purelib python/lib \
- --install-platlib python/'lib.$PLAT' \
- --install-scripts python/scripts \
- --install-data python/data
-
-or, equivalently, ::
-
- pysetup run install_dist --home ~/python \
- --install-purelib lib \
- --install-platlib 'lib.$PLAT' \
- --install-scripts scripts \
- --install-data data
-
-``$PLAT`` doesn't need to be defined as an environment variable ---it will also
-be expanded by Packaging as it parses your command line options, just as it
-does when parsing your configuration file(s). (More on that later.)
-
-Obviously, specifying the entire installation scheme every time you install a
-new module distribution would be very tedious. To spare you all that work, you
-can store it in a Packaging configuration file instead (see section
-:ref:`packaging-config-files`), like so::
-
- [install_dist]
- install-base = $HOME
- install-purelib = python/lib
- install-platlib = python/lib.$PLAT
- install-scripts = python/scripts
- install-data = python/data
-
-or, equivalently, ::
-
- [install_dist]
- install-base = $HOME/python
- install-purelib = lib
- install-platlib = lib.$PLAT
- install-scripts = scripts
- install-data = data
-
-Note that these two are *not* equivalent if you override their installation
-base directory when running the setup script. For example, ::
-
- pysetup run install_dist --install-base /tmp
-
-would install pure modules to :file:`/tmp/python/lib` in the first case, and
-to :file:`/tmp/lib` in the second case. (For the second case, you'd probably
-want to supply an installation base of :file:`/tmp/python`.)
-
-You may have noticed the use of ``$HOME`` and ``$PLAT`` in the sample
-configuration file. These are Packaging configuration variables, which
-bear a strong resemblance to environment variables. In fact, you can use
-environment variables in configuration files on platforms that have such a notion, but
-Packaging additionally defines a few extra variables that may not be in your
-environment, such as ``$PLAT``. Of course, on systems that don't have
-environment variables, such as Mac OS 9, the configuration variables supplied by
-the Packaging are the only ones you can use. See section :ref:`packaging-config-files`
-for details.
-
-.. XXX which vars win out eventually in case of clash env or Packaging?
-
-.. XXX need some Windows examples---when would custom installation schemes be
- needed on those platforms?
-
-
-.. XXX Move this section to Doc/using
-
-.. _packaging-search-path:
-
-Modifying Python's search path
-------------------------------
-
-When the Python interpreter executes an :keyword:`import` statement, it searches
-for both Python code and extension modules along a search path. A default value
-for this path is configured into the Python binary when the interpreter is built.
-You can obtain the search path by importing the :mod:`sys` module and printing
-the value of ``sys.path``. ::
-
- $ python
- Python 2.2 (#11, Oct 3 2002, 13:31:27)
- [GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-112)] on linux2
- Type "help", "copyright", "credits" or "license" for more information.
- >>> import sys
- >>> sys.path
- ['', '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2',
- '/usr/local/lib/python2.3/lib-tk', '/usr/local/lib/python2.3/lib-dynload',
- '/usr/local/lib/python2.3/site-packages']
- >>>
-
-The null string in ``sys.path`` represents the current working directory.
-
-The expected convention for locally installed packages is to put them in the
-:file:`{...}/site-packages/` directory, but you may want to choose a different
-location for some reason. For example, if your site kept by convention all web
-server-related software under :file:`/www`. Add-on Python modules might then
-belong in :file:`/www/python`, and in order to import them, this directory would
-have to be added to ``sys.path``. There are several ways to solve this problem.
-
-The most convenient way is to add a path configuration file to a directory
-that's already on Python's path, usually to the :file:`.../site-packages/`
-directory. Path configuration files have an extension of :file:`.pth`, and each
-line must contain a single path that will be appended to ``sys.path``. (Because
-the new paths are appended to ``sys.path``, modules in the added directories
-will not override standard modules. This means you can't use this mechanism for
-installing fixed versions of standard modules.)
-
-Paths can be absolute or relative, in which case they're relative to the
-directory containing the :file:`.pth` file. See the documentation of
-the :mod:`site` module for more information.
-
-A slightly less convenient way is to edit the :file:`site.py` file in Python's
-standard library, and modify ``sys.path``. :file:`site.py` is automatically
-imported when the Python interpreter is executed, unless the :option:`-S` switch
-is supplied to suppress this behaviour. So you could simply edit
-:file:`site.py` and add two lines to it::
-
- import sys
- sys.path.append('/www/python/')
-
-However, if you reinstall the same major version of Python (perhaps when
-upgrading from 3.3 to 3.3.1, for example) :file:`site.py` will be overwritten by
-the stock version. You'd have to remember that it was modified and save a copy
-before doing the installation.
-
-Alternatively, there are two environment variables that can modify ``sys.path``.
-:envvar:`PYTHONHOME` sets an alternate value for the prefix of the Python
-installation. For example, if :envvar:`PYTHONHOME` is set to ``/www/python``,
-the search path will be set to ``['', '/www/python/lib/pythonX.Y/',
-'/www/python/lib/pythonX.Y/plat-linux2', ...]``.
-
-The :envvar:`PYTHONPATH` variable can be set to a list of paths that will be
-added to the beginning of ``sys.path``. For example, if :envvar:`PYTHONPATH` is
-set to ``/www/python:/opt/py``, the search path will begin with
-``['/www/python', '/opt/py']``. (Note that directories must exist in order to
-be added to ``sys.path``; the :mod:`site` module removes non-existent paths.)
-
-Finally, ``sys.path`` is just a regular Python list, so any Python application
-can modify it by adding or removing entries.
-
-
-.. _packaging-config-files:
-
-Configuration files for Packaging
-=================================
-
-As mentioned above, you can use configuration files to store personal or site
-preferences for any option supported by any Packaging command. Depending on your
-platform, you can use one of two or three possible configuration files. These
-files will be read before parsing the command-line, so they take precedence over
-default values. In turn, the command-line will override configuration files.
-Lastly, if there are multiple configuration files, values from files read
-earlier will be overridden by values from files read later.
-
-.. XXX "one of two or three possible..." seems wrong info. Below always 3 files
- are indicated in the tables.
-
-
-.. _packaging-config-filenames:
-
-Location and names of configuration files
------------------------------------------
-
-The name and location of the configuration files vary slightly across
-platforms. On Unix and Mac OS X, these are the three configuration files listed
-in the order they are processed:
-
-+--------------+----------------------------------------------------------+-------+
-| Type of file | Location and filename | Notes |
-+==============+==========================================================+=======+
-| system | :file:`{prefix}/lib/python{ver}/packaging/packaging.cfg` | \(1) |
-+--------------+----------------------------------------------------------+-------+
-| personal | :file:`$HOME/.pydistutils.cfg` | \(2) |
-+--------------+----------------------------------------------------------+-------+
-| local | :file:`setup.cfg` | \(3) |
-+--------------+----------------------------------------------------------+-------+
-
-Similarly, the configuration files on Windows ---also listed in the order they
-are processed--- are these:
-
-+--------------+-------------------------------------------------+-------+
-| Type of file | Location and filename | Notes |
-+==============+=================================================+=======+
-| system | :file:`{prefix}\\Lib\\packaging\\packaging.cfg` | \(4) |
-+--------------+-------------------------------------------------+-------+
-| personal | :file:`%HOME%\\pydistutils.cfg` | \(5) |
-+--------------+-------------------------------------------------+-------+
-| local | :file:`setup.cfg` | \(3) |
-+--------------+-------------------------------------------------+-------+
-
-On all platforms, the *personal* file can be temporarily disabled by
-means of the `--no-user-cfg` option.
-
-Notes:
-
-(1)
- Strictly speaking, the system-wide configuration file lives in the directory
- where Packaging is installed.
-
-(2)
- On Unix, if the :envvar:`HOME` environment variable is not defined, the
- user's home directory will be determined with the :func:`getpwuid` function
- from the standard :mod:`pwd` module. Packaging uses the
- :func:`os.path.expanduser` function to do this.
-
-(3)
- I.e., in the current directory (usually the location of the setup script).
-
-(4)
- (See also note (1).) Python's default installation prefix is
- :file:`C:\\Python`, so the system configuration file is normally
- :file:`C:\\Python\\Lib\\packaging\\packaging.cfg`.
-
-(5)
- On Windows, if the :envvar:`HOME` environment variable is not defined,
- :envvar:`USERPROFILE` then :envvar:`HOMEDRIVE` and :envvar:`HOMEPATH` will
- be tried. Packaging uses the :func:`os.path.expanduser` function to do this.
-
-
-.. _packaging-config-syntax:
-
-Syntax of configuration files
------------------------------
-
-All Packaging configuration files share the same syntax. Options defined in
-them are grouped into sections, and each Packaging command gets its own section.
-Additionally, there's a ``global`` section for options that affect every command.
-Sections consist of one or more lines containing a single option specified as
-``option = value``.
-
-.. XXX use dry-run in the next example or use a pysetup option as example
-
-For example, here's a complete configuration file that forces all commands to
-run quietly by default::
-
- [global]
- verbose = 0
-
-If this was the system configuration file, it would affect all processing
-of any Python module distribution by any user on the current system. If it was
-installed as your personal configuration file (on systems that support them),
-it would affect only module distributions processed by you. Lastly, if it was
-used as the :file:`setup.cfg` for a particular module distribution, it would
-affect that distribution only.
-
-.. XXX "(on systems that support them)" seems wrong info
-
-If you wanted to, you could override the default "build base" directory and
-make the :command:`build\*` commands always forcibly rebuild all files with
-the following::
-
- [build]
- build-base = blib
- force = 1
-
-which corresponds to the command-line arguments::
-
- pysetup run build --build-base blib --force
-
-except that including the :command:`build` command on the command-line means
-that command will be run. Including a particular command in configuration files
-has no such implication; it only means that if the command is run, the options
-for it in the configuration file will apply. (This is also true if you run
-other commands that derive values from it.)
-
-You can find out the complete list of options for any command using the
-:option:`--help` option, e.g.::
-
- pysetup run build --help
-
-and you can find out the complete list of global options by using
-:option:`--help` without a command::
-
- pysetup run --help
-
-See also the "Reference" section of the "Distributing Python Modules" manual.
-
-.. XXX no links to the relevant section exist.
-
-
-.. _packaging-building-ext:
-
-Building extensions: tips and tricks
-====================================
-
-Whenever possible, Packaging tries to use the configuration information made
-available by the Python interpreter used to run `pysetup`.
-For example, the same compiler and linker flags used to compile Python will also
-be used for compiling extensions. Usually this will work well, but in
-complicated situations this might be inappropriate. This section discusses how
-to override the usual Packaging behaviour.
-
-
-.. _packaging-tweak-flags:
-
-Tweaking compiler/linker flags
-------------------------------
-
-Compiling a Python extension written in C or C++ will sometimes require
-specifying custom flags for the compiler and linker in order to use a particular
-library or produce a special kind of object code. This is especially true if the
-extension hasn't been tested on your platform, or if you're trying to
-cross-compile Python.
-
-.. TODO update to new setup.cfg
-
-In the most general case, the extension author might have foreseen that
-compiling the extensions would be complicated, and provided a :file:`Setup` file
-for you to edit. This will likely only be done if the module distribution
-contains many separate extension modules, or if they often require elaborate
-sets of compiler flags in order to work.
-
-A :file:`Setup` file, if present, is parsed in order to get a list of extensions
-to build. Each line in a :file:`Setup` describes a single module. Lines have
-the following structure::
-
- module ... [sourcefile ...] [cpparg ...] [library ...]
-
-
-Let's examine each of the fields in turn.
-
-* *module* is the name of the extension module to be built, and should be a
- valid Python identifier. You can't just change this in order to rename a module
- (edits to the source code would also be needed), so this should be left alone.
-
-* *sourcefile* is anything that's likely to be a source code file, at least
- judging by the filename. Filenames ending in :file:`.c` are assumed to be
- written in C, filenames ending in :file:`.C`, :file:`.cc`, and :file:`.c++` are
- assumed to be C++, and filenames ending in :file:`.m` or :file:`.mm` are assumed
- to be in Objective C.
-
-* *cpparg* is an argument for the C preprocessor, and is anything starting with
- :option:`-I`, :option:`-D`, :option:`-U` or :option:`-C`.
-
-* *library* is anything ending in :file:`.a` or beginning with :option:`-l` or
- :option:`-L`.
-
-If a particular platform requires a special library on your platform, you can
-add it by editing the :file:`Setup` file and running ``pysetup run build``.
-For example, if the module defined by the line ::
-
- foo foomodule.c
-
-must be linked with the math library :file:`libm.a` on your platform, simply add
-:option:`-lm` to the line::
-
- foo foomodule.c -lm
-
-Arbitrary switches intended for the compiler or the linker can be supplied with
-the :option:`-Xcompiler` *arg* and :option:`-Xlinker` *arg* options::
-
- foo foomodule.c -Xcompiler -o32 -Xlinker -shared -lm
-
-The next option after :option:`-Xcompiler` and :option:`-Xlinker` will be
-appended to the proper command line, so in the above example the compiler will
-be passed the :option:`-o32` option, and the linker will be passed
-:option:`-shared`. If a compiler option requires an argument, you'll have to
-supply multiple :option:`-Xcompiler` options; for example, to pass ``-x c++``
-the :file:`Setup` file would have to contain ``-Xcompiler -x -Xcompiler c++``.
-
-Compiler flags can also be supplied through setting the :envvar:`CFLAGS`
-environment variable. If set, the contents of :envvar:`CFLAGS` will be added to
-the compiler flags specified in the :file:`Setup` file.
-
-
-.. _packaging-non-ms-compilers:
-
-Using non-Microsoft compilers on Windows
-----------------------------------------
-
-.. sectionauthor:: Rene Liebscher
-
-
-
-Borland/CodeGear C++
-^^^^^^^^^^^^^^^^^^^^
-
-This subsection describes the necessary steps to use Packaging with the Borland
-C++ compiler version 5.5. First you have to know that Borland's object file
-format (OMF) is different from the format used by the Python version you can
-download from the Python or ActiveState Web site. (Python is built with
-Microsoft Visual C++, which uses COFF as the object file format.) For this
-reason, you have to convert Python's library :file:`python25.lib` into the
-Borland format. You can do this as follows:
-
-.. Should we mention that users have to create cfg-files for the compiler?
-.. see also http://community.borland.com/article/0,1410,21205,00.html
-
-::
-
- coff2omf python25.lib python25_bcpp.lib
-
-The :file:`coff2omf` program comes with the Borland compiler. The file
-:file:`python25.lib` is in the :file:`Libs` directory of your Python
-installation. If your extension uses other libraries (zlib, ...) you have to
-convert them too.
-
-The converted files have to reside in the same directories as the normal
-libraries.
-
-How does Packaging manage to use these libraries with their changed names? If
-the extension needs a library (eg. :file:`foo`) Packaging checks first if it
-finds a library with suffix :file:`_bcpp` (eg. :file:`foo_bcpp.lib`) and then
-uses this library. In the case it doesn't find such a special library it uses
-the default name (:file:`foo.lib`.) [#]_
-
-To let Packaging compile your extension with Borland, C++ you now have to
-type::
-
- pysetup run build --compiler bcpp
-
-If you want to use the Borland C++ compiler as the default, you could specify
-this in your personal or system-wide configuration file for Packaging (see
-section :ref:`packaging-config-files`.)
-
-
-.. seealso::
-
- `C++Builder Compiler `_
- Information about the free C++ compiler from Borland, including links to the
- download pages.
-
- `Creating Python Extensions Using Borland's Free Compiler `_
- Document describing how to use Borland's free command-line C++ compiler to build
- Python.
-
-
-GNU C / Cygwin / MinGW
-^^^^^^^^^^^^^^^^^^^^^^
-
-This section describes the necessary steps to use Packaging with the GNU C/C++
-compilers in their Cygwin and MinGW distributions. [#]_ For a Python interpreter
-that was built with Cygwin, everything should work without any of these
-following steps.
-
-Not all extensions can be built with MinGW or Cygwin, but many can. Extensions
-most likely to not work are those that use C++ or depend on Microsoft Visual C
-extensions.
-
-To let Packaging compile your extension with Cygwin, you have to type::
-
- pysetup run build --compiler=cygwin
-
-and for Cygwin in no-cygwin mode [#]_ or for MinGW, type::
-
- pysetup run build --compiler=mingw32
-
-If you want to use any of these options/compilers as default, you should
-consider writing it in your personal or system-wide configuration file for
-Packaging (see section :ref:`packaging-config-files`.)
-
-Older Versions of Python and MinGW
-""""""""""""""""""""""""""""""""""
-The following instructions only apply if you're using a version of Python
-inferior to 2.4.1 with a MinGW inferior to 3.0.0 (with
-:file:`binutils-2.13.90-20030111-1`).
-
-These compilers require some special libraries. This task is more complex than
-for Borland's C++, because there is no program to convert the library. First
-you have to create a list of symbols which the Python DLL exports. (You can find
-a good program for this task at
-http://www.emmestech.com/software/pexports-0.43/download_pexports.html).
-
-.. I don't understand what the next line means. --amk
- (inclusive the references on data structures.)
-
-::
-
- pexports python25.dll > python25.def
-
-The location of an installed :file:`python25.dll` will depend on the
-installation options and the version and language of Windows. In a "just for
-me" installation, it will appear in the root of the installation directory. In
-a shared installation, it will be located in the system directory.
-
-Then you can create from these information an import library for gcc. ::
-
- /cygwin/bin/dlltool --dllname python25.dll --def python25.def --output-lib libpython25.a
-
-The resulting library has to be placed in the same directory as
-:file:`python25.lib`. (Should be the :file:`libs` directory under your Python
-installation directory.)
-
-If your extension uses other libraries (zlib,...) you might have to convert
-them too. The converted files have to reside in the same directories as the
-normal libraries do.
-
-
-.. seealso::
-
- `Building Python modules on MS Windows platform with MinGW `_
- Information about building the required libraries for the MinGW
- environment.
-
-
-.. rubric:: Footnotes
-
-.. [#] This also means you could replace all existing COFF-libraries with
- OMF-libraries of the same name.
-
-.. [#] Check http://sources.redhat.com/cygwin/ and http://www.mingw.org/ for
- more information.
-
-.. [#] Then you have no POSIX emulation available, but you also don't need
- :file:`cygwin1.dll`.
diff --git a/Doc/install/pysetup-config.rst b/Doc/install/pysetup-config.rst
deleted file mode 100644
index a473bfe35f..0000000000
--- a/Doc/install/pysetup-config.rst
+++ /dev/null
@@ -1,44 +0,0 @@
-.. _packaging-pysetup-config:
-
-=====================
-Pysetup Configuration
-=====================
-
-Pysetup supports two configuration files: :file:`.pypirc` and :file:`packaging.cfg`.
-
-.. FIXME integrate with configfile instead of duplicating
-
-Configuring indexes
--------------------
-
-You can configure additional indexes in :file:`.pypirc` to be used for index-related
-operations. By default, all configured index-servers and package-servers will be used
-in an additive fashion. To limit operations to specific indexes, use the :option:`--index`
-and :option:`--package-server options`::
-
- $ pysetup install --index pypi --package-server django some.project
-
-Adding indexes to :file:`.pypirc`::
-
- [packaging]
- index-servers =
- pypi
- other
-
- package-servers =
- django
-
- [pypi]
- repository:
- username:
- password:
-
- [other]
- repository:
- username:
- password:
-
- [django]
- repository:
- username:
- password:
diff --git a/Doc/install/pysetup-servers.rst b/Doc/install/pysetup-servers.rst
deleted file mode 100644
index c6106de77d..0000000000
--- a/Doc/install/pysetup-servers.rst
+++ /dev/null
@@ -1,61 +0,0 @@
-.. _packaging-pysetup-servers:
-
-===============
-Package Servers
-===============
-
-Pysetup supports installing Python packages from *Package Servers* in addition
-to PyPI indexes and mirrors.
-
-Package Servers are simple directory listings of Python distributions. Directories
-can be served via HTTP or a local file system. This is useful when you want to
-dump source distributions in a directory and not worry about the full index structure.
-
-Serving distributions from Apache
----------------------------------
-::
-
- $ mkdir -p /var/www/html/python/distributions
- $ cp *.tar.gz /var/www/html/python/distributions/
-
-
- ServerAdmin webmaster@domain.com
- DocumentRoot "/var/www/html/python"
- ServerName python.example.org
- ErrorLog logs/python.example.org-error.log
- CustomLog logs/python.example.org-access.log common
- Options Indexes FollowSymLinks MultiViews
- DirectoryIndex index.html index.htm
-
-
- Options Indexes FollowSymLinks MultiViews
- Order allow,deny
- Allow from all
-
-
-
-Add the Apache based distribution server to :file:`.pypirc`::
-
- [packaging]
- package-servers =
- apache
-
- [apache]
- repository: http://python.example.org/distributions/
-
-
-Serving distributions from a file system
-----------------------------------------
-::
-
- $ mkdir -p /data/python/distributions
- $ cp *.tar.gz /data/python/distributions/
-
-Add the directory to :file:`.pypirc`::
-
- [packaging]
- package-servers =
- local
-
- [local]
- repository: file:///data/python/distributions/
diff --git a/Doc/install/pysetup.rst b/Doc/install/pysetup.rst
deleted file mode 100644
index d472c248e2..0000000000
--- a/Doc/install/pysetup.rst
+++ /dev/null
@@ -1,164 +0,0 @@
-.. _packaging-pysetup:
-
-================
-Pysetup Tutorial
-================
-
-Getting started
----------------
-
-Pysetup is a simple script that supports the following features:
-
-- install, remove, list, and verify Python packages;
-- search for available packages on PyPI or any *Simple Index*;
-- verify installed packages (md5sum, installed files, version).
-
-
-Finding out what's installed
-----------------------------
-
-Pysetup makes it easy to find out what Python packages are installed::
-
- $ pysetup list virtualenv
- 'virtualenv' 1.6 at '/opt/python3.3/lib/python3.3/site-packages/virtualenv-1.6-py3.3.egg-info'
-
- $ pysetup list
- 'pyverify' 0.8.1 at '/opt/python3.3/lib/python3.3/site-packages/pyverify-0.8.1.dist-info'
- 'virtualenv' 1.6 at '/opt/python3.3/lib/python3.3/site-packages/virtualenv-1.6-py3.3.egg-info'
- ...
-
-
-Installing a distribution
--------------------------
-
-Pysetup can install a Python project from the following sources:
-
-- PyPI and Simple Indexes;
-- source directories containing a valid :file:`setup.py` or :file:`setup.cfg`;
-- distribution source archives (:file:`project-1.0.tar.gz`, :file:`project-1.0.zip`);
-- HTTP (http://host/packages/project-1.0.tar.gz).
-
-
-Installing from PyPI and Simple Indexes::
-
- $ pysetup install project
- $ pysetup install project==1.0
-
-Installing from a distribution source archive::
-
- $ pysetup install project-1.0.tar.gz
-
-Installing from a source directory containing a valid :file:`setup.py` or
-:file:`setup.cfg`::
-
- $ cd path/to/source/directory
- $ pysetup install
-
- $ pysetup install path/to/source/directory
-
-Installing from HTTP::
-
- $ pysetup install http://host/packages/project-1.0.tar.gz
-
-
-Retrieving metadata
--------------------
-
-You can gather metadata from two sources, a project's source directory or an
-installed distribution. The `pysetup metadata` command can retrieve one or
-more metadata fields using the `-f` option and a metadata field as the
-argument. ::
-
- $ pysetup metadata virtualenv -f version -f name
- Version:
- 1.6
- Name:
- virtualenv
-
- $ pysetup metadata virtualenv
- Metadata-Version:
- 1.0
- Name:
- virtualenv
- Version:
- 1.6
- Platform:
- UNKNOWN
- Summary:
- Virtual Python Environment builder
- ...
-
-.. seealso::
-
- There are three metadata versions, 1.0, 1.1, and 1.2. The following PEPs
- describe specifics of the field names, and their semantics and usage. 1.0
- :PEP:`241`, 1.1 :PEP:`314`, and 1.2 :PEP:`345`
-
-
-Removing a distribution
------------------------
-
-You can remove one or more installed distributions using the `pysetup remove`
-command::
-
- $ pysetup remove virtualenv
- removing 'virtualenv':
- /opt/python3.3/lib/python3.3/site-packages/virtualenv-1.6-py3.3.egg-info/dependency_links.txt
- /opt/python3.3/lib/python3.3/site-packages/virtualenv-1.6-py3.3.egg-info/entry_points.txt
- /opt/python3.3/lib/python3.3/site-packages/virtualenv-1.6-py3.3.egg-info/not-zip-safe
- /opt/python3.3/lib/python3.3/site-packages/virtualenv-1.6-py3.3.egg-info/PKG-INFO
- /opt/python3.3/lib/python3.3/site-packages/virtualenv-1.6-py3.3.egg-info/SOURCES.txt
- /opt/python3.3/lib/python3.3/site-packages/virtualenv-1.6-py3.3.egg-info/top_level.txt
- Proceed (y/n)? y
- success: removed 6 files and 1 dirs
-
-The optional '-y' argument auto confirms, skipping the conformation prompt::
-
- $ pysetup remove virtualenv -y
-
-
-Getting help
-------------
-
-All pysetup actions take the `-h` and `--help` options which prints the commands
-help string to stdout. ::
-
- $ pysetup remove -h
- Usage: pysetup remove dist [-y]
- or: pysetup remove --help
-
- Uninstall a Python package.
-
- positional arguments:
- dist installed distribution name
-
- optional arguments:
- -y auto confirm package removal
-
-Getting a list of all pysetup actions and global options::
-
- $ pysetup --help
- Usage: pysetup [options] action [action_options]
-
- Actions:
- run: Run one or several commands
- metadata: Display the metadata of a project
- install: Install a project
- remove: Remove a project
- search: Search for a project in the indexes
- list: List installed projects
- graph: Display a graph
- create: Create a project
- generate-setup: Generate a backward-compatible setup.py
-
- To get more help on an action, use:
-
- pysetup action --help
-
- Global options:
- --verbose (-v) run verbosely (default)
- --quiet (-q) run quietly (turns verbosity off)
- --dry-run (-n) don't actually do anything
- --help (-h) show detailed help message
- --no-user-cfg ignore pydistutils.cfg in your home directory
- --version Display the version
diff --git a/Doc/library/distutils.rst b/Doc/library/distutils.rst
index 53a69aecd7..11a29493a5 100644
--- a/Doc/library/distutils.rst
+++ b/Doc/library/distutils.rst
@@ -12,10 +12,6 @@ additional modules into a Python installation. The new modules may be either
100%-pure Python, or may be extension modules written in C, or may be
collections of Python packages which include modules coded in both Python and C.
-.. deprecated:: 3.3
- :mod:`packaging` replaces Distutils. See :ref:`packaging-index` and
- :ref:`packaging-install-index`.
-
User documentation and API reference are provided in another document:
@@ -27,11 +23,3 @@ User documentation and API reference are provided in another document:
easily installed into an existing Python installation. If also contains
instructions for end-users wanting to install a distutils-based package,
:ref:`install-index`.
-
-
-.. trick to silence a Sphinx warning
-
-.. toctree::
- :hidden:
-
- ../distutils/index
diff --git a/Doc/library/packaging-misc.rst b/Doc/library/packaging-misc.rst
deleted file mode 100644
index 5e562473e2..0000000000
--- a/Doc/library/packaging-misc.rst
+++ /dev/null
@@ -1,27 +0,0 @@
-.. temporary file for modules that don't need a dedicated file yet
-
-:mod:`packaging.errors` --- Packaging exceptions
-================================================
-
-.. module:: packaging.errors
- :synopsis: Packaging exceptions.
-
-
-Provides exceptions used by the Packaging modules. Note that Packaging modules
-may raise standard exceptions; in particular, SystemExit is usually raised for
-errors that are obviously the end-user's fault (e.g. bad command-line arguments).
-
-This module is safe to use in ``from ... import *`` mode; it only exports
-symbols whose names start with ``Packaging`` and end with ``Error``.
-
-
-:mod:`packaging.manifest` --- The Manifest class
-================================================
-
-.. module:: packaging.manifest
- :synopsis: The Manifest class, used for poking about the file system and
- building lists of files.
-
-
-This module provides the :class:`Manifest` class, used for poking about the
-filesystem and building lists of files.
diff --git a/Doc/library/packaging.command.rst b/Doc/library/packaging.command.rst
deleted file mode 100644
index 6a85351728..0000000000
--- a/Doc/library/packaging.command.rst
+++ /dev/null
@@ -1,111 +0,0 @@
-:mod:`packaging.command` --- Standard Packaging commands
-========================================================
-
-.. module:: packaging.command
- :synopsis: Standard packaging commands.
-
-
-This subpackage contains one module for each standard Packaging command, such as
-:command:`build` or :command:`upload`. Each command is implemented as a
-separate module, with the command name as the name of the module and of the
-class defined therein.
-
-
-
-:mod:`packaging.command.cmd` --- Abstract base class for Packaging commands
-===========================================================================
-
-.. module:: packaging.command.cmd
- :synopsis: Abstract base class for commands.
-
-
-This module supplies the abstract base class :class:`Command`. This class is
-subclassed by the modules in the packaging.command subpackage.
-
-
-.. class:: Command(dist)
-
- Abstract base class for defining command classes, the "worker bees" of the
- Packaging. A useful analogy for command classes is to think of them as
- subroutines with local variables called *options*. The options are declared
- in :meth:`initialize_options` and defined (given their final values) in
- :meth:`finalize_options`, both of which must be defined by every command
- class. The distinction between the two is necessary because option values
- might come from the outside world (command line, config file, ...), and any
- options dependent on other options must be computed after these outside
- influences have been processed --- hence :meth:`finalize_options`. The body
- of the subroutine, where it does all its work based on the values of its
- options, is the :meth:`run` method, which must also be implemented by every
- command class.
-
- The class constructor takes a single argument *dist*, a
- :class:`~packaging.dist.Distribution` instance.
-
-
-Creating a new Packaging command
---------------------------------
-
-This section outlines the steps to create a new Packaging command.
-
-.. XXX the following paragraph is focused on the stdlib; expand it to document
- how to write and register a command in third-party projects
-
-A new command lives in a module in the :mod:`packaging.command` package. There
-is a sample template in that directory called :file:`command_template`. Copy
-this file to a new module with the same name as the new command you're
-implementing. This module should implement a class with the same name as the
-module (and the command). So, for instance, to create the command
-``peel_banana`` (so that users can run ``setup.py peel_banana``), you'd copy
-:file:`command_template` to :file:`packaging/command/peel_banana.py`, then edit
-it so that it's implementing the class :class:`peel_banana`, a subclass of
-:class:`Command`. It must define the following methods:
-
-.. method:: Command.initialize_options()
-
- Set default values for all the options that this command supports. Note that
- these defaults may be overridden by other commands, by the setup script, by
- config files, or by the command line. Thus, this is not the place to code
- dependencies between options; generally, :meth:`initialize_options`
- implementations are just a bunch of ``self.foo = None`` assignments.
-
-
-.. method:: Command.finalize_options()
-
- Set final values for all the options that this command supports. This is
- always called as late as possible, i.e. after any option assignments from the
- command line or from other commands have been done. Thus, this is the place
- to code option dependencies: if *foo* depends on *bar*, then it is safe to
- set *foo* from *bar* as long as *foo* still has the same value it was
- assigned in :meth:`initialize_options`.
-
-
-.. method:: Command.run()
-
- A command's raison d'etre: carry out the action it exists to perform,
- controlled by the options initialized in :meth:`initialize_options`,
- customized by other commands, the setup script, the command line, and config
- files, and finalized in :meth:`finalize_options`. All terminal output and
- filesystem interaction should be done by :meth:`run`.
-
-
-Command classes may define this attribute:
-
-
-.. attribute:: Command.sub_commands
-
- *sub_commands* formalizes the notion of a "family" of commands,
- e.g. ``install_dist`` as the parent with sub-commands ``install_lib``,
- ``install_headers``, etc. The parent of a family of commands defines
- *sub_commands* as a class attribute; it's a list of 2-tuples ``(command_name,
- predicate)``, with *command_name* a string and *predicate* a function, a
- string or ``None``. *predicate* is a method of the parent command that
- determines whether the corresponding command is applicable in the current
- situation. (E.g. ``install_headers`` is only applicable if we have any C
- header files to install.) If *predicate* is ``None``, that command is always
- applicable.
-
- *sub_commands* is usually defined at the *end* of a class, because
- predicates can be methods of the class, so they must already have been
- defined. The canonical example is the :command:`install_dist` command.
-
-.. XXX document how to add a custom command to another one's subcommands
diff --git a/Doc/library/packaging.compiler.rst b/Doc/library/packaging.compiler.rst
deleted file mode 100644
index ecf641e391..0000000000
--- a/Doc/library/packaging.compiler.rst
+++ /dev/null
@@ -1,681 +0,0 @@
-:mod:`packaging.compiler` --- Compiler classes
-==============================================
-
-.. module:: packaging.compiler
- :synopsis: Compiler classes to build C/C++ extensions or libraries.
-
-
-This subpackage contains an abstract base class representing a compiler and
-concrete implementations for common compilers. The compiler classes should not
-be instantiated directly, but created using the :func:`new_compiler` factory
-function. Compiler types provided by Packaging are listed in
-:ref:`packaging-standard-compilers`.
-
-
-Public functions
-----------------
-
-.. function:: new_compiler(plat=None, compiler=None, dry_run=False, force=False)
-
- Factory function to generate an instance of some
- :class:`~.ccompiler.CCompiler` subclass for the requested platform or
- compiler type.
-
- If no argument is given for *plat* and *compiler*, the default compiler type
- for the platform (:attr:`os.name`) will be used: ``'unix'`` for Unix and
- Mac OS X, ``'msvc'`` for Windows.
-
- If *plat* is given, it must be one of ``'posix'``, ``'darwin'`` or ``'nt'``.
- An invalid value will not raise an exception but use the default compiler
- type for the current platform.
-
- .. XXX errors should never pass silently; this behavior is particularly
- harmful when a compiler type is given as first argument
-
- If *compiler* is given, *plat* will be ignored, allowing you to get for
- example a ``'unix'`` compiler object under Windows or an ``'msvc'`` compiler
- under Unix. However, not all compiler types can be instantiated on every
- platform.
-
-
-.. function:: customize_compiler(compiler)
-
- Do any platform-specific customization of a CCompiler instance. Mainly
- needed on Unix to plug in the information that varies across Unices and is
- stored in CPython's Makefile.
-
-
-.. function:: gen_lib_options(compiler, library_dirs, runtime_library_dirs, libraries)
-
- Generate linker options for searching library directories and linking with
- specific libraries. *libraries* and *library_dirs* are, respectively, lists
- of library names (not filenames!) and search directories. Returns a list of
- command-line options suitable for use with some compiler (depending on the
- two format strings passed in).
-
-
-.. function:: gen_preprocess_options(macros, include_dirs)
-
- Generate C preprocessor options (:option:`-D`, :option:`-U`, :option:`-I`) as
- used by at least two types of compilers: the typical Unix compiler and Visual
- C++. *macros* is the usual thing, a list of 1- or 2-tuples, where ``(name,)``
- means undefine (:option:`-U`) macro *name*, and ``(name, value)`` means
- define (:option:`-D`) macro *name* to *value*. *include_dirs* is just a list
- of directory names to be added to the header file search path (:option:`-I`).
- Returns a list of command-line options suitable for either Unix compilers or
- Visual C++.
-
-
-.. function:: get_default_compiler(osname, platform)
-
- Determine the default compiler to use for the given platform.
-
- *osname* should be one of the standard Python OS names (i.e. the ones
- returned by ``os.name``) and *platform* the common value returned by
- ``sys.platform`` for the platform in question.
-
- The default values are ``os.name`` and ``sys.platform``.
-
-
-.. function:: set_compiler(location)
-
- Add or change a compiler
-
-
-.. function:: show_compilers()
-
- Print list of available compilers (used by the :option:`--help-compiler`
- options to :command:`build`, :command:`build_ext`, :command:`build_clib`).
-
-
-.. _packaging-standard-compilers:
-
-Standard compilers
-------------------
-
-Concrete subclasses of :class:`~.ccompiler.CCompiler` are provided in submodules
-of the :mod:`packaging.compiler` package. You do not need to import them, using
-:func:`new_compiler` is the public API to use. This table documents the
-standard compilers; be aware that they can be replaced by other classes on your
-platform.
-
-=============== ======================================================== =======
-name description notes
-=============== ======================================================== =======
-``'unix'`` typical Unix-style command-line C compiler [#]_
-``'msvc'`` Microsoft compiler [#]_
-``'bcpp'`` Borland C++ compiler
-``'cygwin'`` Cygwin compiler (Windows port of GCC)
-``'mingw32'`` Mingw32 port of GCC (same as Cygwin in no-Cygwin mode)
-=============== ======================================================== =======
-
-
-.. [#] The Unix compiler class assumes this behavior:
-
- * macros defined with :option:`-Dname[=value]`
-
- * macros undefined with :option:`-Uname`
-
- * include search directories specified with :option:`-Idir`
-
- * libraries specified with :option:`-llib`
-
- * library search directories specified with :option:`-Ldir`
-
- * compile handled by :program:`cc` (or similar) executable with
- :option:`-c` option: compiles :file:`.c` to :file:`.o`
-
- * link static library handled by :program:`ar` command (possibly with
- :program:`ranlib`)
-
- * link shared library handled by :program:`cc` :option:`-shared`
-
-
-.. [#] On Windows, extension modules typically need to be compiled with the same
- compiler that was used to compile CPython (for example Microsoft Visual
- Studio .NET 2003 for CPython 2.4 and 2.5). The AMD64 and Itanium
- binaries are created using the Platform SDK.
-
- Under the hood, there are actually two different subclasses of
- :class:`~.ccompiler.CCompiler` defined: one is compatible with MSVC 2005
- and 2008, the other works with older versions. This should not be a
- concern for regular use of the functions in this module.
-
- Packaging will normally choose the right compiler, linker etc. on its
- own. To override this choice, the environment variables
- *DISTUTILS_USE_SDK* and *MSSdk* must be both set. *MSSdk* indicates that
- the current environment has been setup by the SDK's ``SetEnv.Cmd``
- script, or that the environment variables had been registered when the
- SDK was installed; *DISTUTILS_USE_SDK* indicates that the user has made
- an explicit choice to override the compiler selection done by Packaging.
-
- .. TODO document the envvars in Doc/using and the man page
-
-
-:mod:`packaging.compiler.ccompiler` --- CCompiler base class
-============================================================
-
-.. module:: packaging.compiler.ccompiler
- :synopsis: Abstract CCompiler class.
-
-
-This module provides the abstract base class for the :class:`CCompiler`
-classes. A :class:`CCompiler` instance can be used for all the compile and
-link steps needed to build a single project. Methods are provided to set
-options for the compiler --- macro definitions, include directories, link path,
-libraries and the like.
-
-.. class:: CCompiler(dry_run=False, force=False)
-
- The abstract base class :class:`CCompiler` defines the interface that must be
- implemented by real compiler classes. The class also has some utility
- methods used by several compiler classes.
-
- The basic idea behind a compiler abstraction class is that each instance can
- be used for all the compile/link steps in building a single project. Thus,
- attributes common to all of those compile and link steps --- include
- directories, macros to define, libraries to link against, etc. --- are
- attributes of the compiler instance. To allow for variability in how
- individual files are treated, most of those attributes may be varied on a
- per-compilation or per-link basis.
-
- The constructor for each subclass creates an instance of the Compiler object.
- Flags are *dry_run* (don't actually execute
- the steps) and *force* (rebuild everything, regardless of dependencies). All
- of these flags default to ``False`` (off). Note that you probably don't want to
- instantiate :class:`CCompiler` or one of its subclasses directly - use the
- :func:`new_compiler` factory function instead.
-
- The following methods allow you to manually alter compiler options for the
- instance of the Compiler class.
-
-
- .. method:: CCompiler.add_include_dir(dir)
-
- Add *dir* to the list of directories that will be searched for header
- files. The compiler is instructed to search directories in the order in
- which they are supplied by successive calls to :meth:`add_include_dir`.
-
-
- .. method:: CCompiler.set_include_dirs(dirs)
-
- Set the list of directories that will be searched to *dirs* (a list of
- strings). Overrides any preceding calls to :meth:`add_include_dir`;
- subsequent calls to :meth:`add_include_dir` add to the list passed to
- :meth:`set_include_dirs`. This does not affect any list of standard
- include directories that the compiler may search by default.
-
-
- .. method:: CCompiler.add_library(libname)
-
- Add *libname* to the list of libraries that will be included in all links
- driven by this compiler object. Note that *libname* should *not* be the
- name of a file containing a library, but the name of the library itself:
- the actual filename will be inferred by the linker, the compiler, or the
- compiler class (depending on the platform).
-
- The linker will be instructed to link against libraries in the order they
- were supplied to :meth:`add_library` and/or :meth:`set_libraries`. It is
- perfectly valid to duplicate library names; the linker will be instructed
- to link against libraries as many times as they are mentioned.
-
-
- .. method:: CCompiler.set_libraries(libnames)
-
- Set the list of libraries to be included in all links driven by this
- compiler object to *libnames* (a list of strings). This does not affect
- any standard system libraries that the linker may include by default.
-
-
- .. method:: CCompiler.add_library_dir(dir)
-
- Add *dir* to the list of directories that will be searched for libraries
- specified to :meth:`add_library` and :meth:`set_libraries`. The linker
- will be instructed to search for libraries in the order they are supplied
- to :meth:`add_library_dir` and/or :meth:`set_library_dirs`.
-
-
- .. method:: CCompiler.set_library_dirs(dirs)
-
- Set the list of library search directories to *dirs* (a list of strings).
- This does not affect any standard library search path that the linker may
- search by default.
-
-
- .. method:: CCompiler.add_runtime_library_dir(dir)
-
- Add *dir* to the list of directories that will be searched for shared
- libraries at runtime.
-
-
- .. method:: CCompiler.set_runtime_library_dirs(dirs)
-
- Set the list of directories to search for shared libraries at runtime to
- *dirs* (a list of strings). This does not affect any standard search path
- that the runtime linker may search by default.
-
-
- .. method:: CCompiler.define_macro(name, value=None)
-
- Define a preprocessor macro for all compilations driven by this compiler
- object. The optional parameter *value* should be a string; if it is not
- supplied, then the macro will be defined without an explicit value and the
- exact outcome depends on the compiler used (XXX true? does ANSI say
- anything about this?)
-
-
- .. method:: CCompiler.undefine_macro(name)
-
- Undefine a preprocessor macro for all compilations driven by this compiler
- object. If the same macro is defined by :meth:`define_macro` and
- undefined by :meth:`undefine_macro` the last call takes precedence
- (including multiple redefinitions or undefinitions). If the macro is
- redefined/undefined on a per-compilation basis (i.e. in the call to
- :meth:`compile`), then that takes precedence.
-
-
- .. method:: CCompiler.add_link_object(object)
-
- Add *object* to the list of object files (or analogues, such as explicitly
- named library files or the output of "resource compilers") to be included
- in every link driven by this compiler object.
-
-
- .. method:: CCompiler.set_link_objects(objects)
-
- Set the list of object files (or analogues) to be included in every link
- to *objects*. This does not affect any standard object files that the
- linker may include by default (such as system libraries).
-
- The following methods implement methods for autodetection of compiler
- options, providing some functionality similar to GNU :program:`autoconf`.
-
-
- .. method:: CCompiler.detect_language(sources)
-
- Detect the language of a given file, or list of files. Uses the instance
- attributes :attr:`language_map` (a dictionary), and :attr:`language_order`
- (a list) to do the job.
-
-
- .. method:: CCompiler.find_library_file(dirs, lib, debug=0)
-
- Search the specified list of directories for a static or shared library file
- *lib* and return the full path to that file. If *debug* is true, look for a
- debugging version (if that makes sense on the current platform). Return
- ``None`` if *lib* wasn't found in any of the specified directories.
-
-
- .. method:: CCompiler.has_function(funcname, includes=None, include_dirs=None, libraries=None, library_dirs=None)
-
- Return a boolean indicating whether *funcname* is supported on the current
- platform. The optional arguments can be used to augment the compilation
- environment by providing additional include files and paths and libraries and
- paths.
-
-
- .. method:: CCompiler.library_dir_option(dir)
-
- Return the compiler option to add *dir* to the list of directories searched for
- libraries.
-
-
- .. method:: CCompiler.library_option(lib)
-
- Return the compiler option to add *dir* to the list of libraries linked into the
- shared library or executable.
-
-
- .. method:: CCompiler.runtime_library_dir_option(dir)
-
- Return the compiler option to add *dir* to the list of directories searched for
- runtime libraries.
-
-
- .. method:: CCompiler.set_executables(**args)
-
- Define the executables (and options for them) that will be run to perform the
- various stages of compilation. The exact set of executables that may be
- specified here depends on the compiler class (via the 'executables' class
- attribute), but most will have:
-
- +--------------+------------------------------------------+
- | attribute | description |
- +==============+==========================================+
- | *compiler* | the C/C++ compiler |
- +--------------+------------------------------------------+
- | *linker_so* | linker used to create shared objects and |
- | | libraries |
- +--------------+------------------------------------------+
- | *linker_exe* | linker used to create binary executables |
- +--------------+------------------------------------------+
- | *archiver* | static library creator |
- +--------------+------------------------------------------+
-
- On platforms with a command line (Unix, DOS/Windows), each of these is a string
- that will be split into executable name and (optional) list of arguments.
- (Splitting the string is done similarly to how Unix shells operate: words are
- delimited by spaces, but quotes and backslashes can override this. See
- :func:`packaging.util.split_quoted`.)
-
- The following methods invoke stages in the build process.
-
-
- .. method:: CCompiler.compile(sources, output_dir=None, macros=None, include_dirs=None, debug=0, extra_preargs=None, extra_postargs=None, depends=None)
-
- Compile one or more source files. Generates object files (e.g. transforms a
- :file:`.c` file to a :file:`.o` file.)
-
- *sources* must be a list of filenames, most likely C/C++ files, but in reality
- anything that can be handled by a particular compiler and compiler class (e.g.
- an ``'msvc'`` compiler can handle resource files in *sources*). Return a list of
- object filenames, one per source filename in *sources*. Depending on the
- implementation, not all source files will necessarily be compiled, but all
- corresponding object filenames will be returned.
-
- If *output_dir* is given, object files will be put under it, while retaining
- their original path component. That is, :file:`foo/bar.c` normally compiles to
- :file:`foo/bar.o` (for a Unix implementation); if *output_dir* is *build*, then
- it would compile to :file:`build/foo/bar.o`.
-
- *macros*, if given, must be a list of macro definitions. A macro definition is
- either a ``(name, value)`` 2-tuple or a ``(name,)`` 1-tuple. The former defines
- a macro; if the value is ``None``, the macro is defined without an explicit
- value. The 1-tuple case undefines a macro. Later
- definitions/redefinitions/undefinitions take precedence.
-
- *include_dirs*, if given, must be a list of strings, the directories to add to
- the default include file search path for this compilation only.
-
- *debug* is a boolean; if true, the compiler will be instructed to output debug
- symbols in (or alongside) the object file(s).
-
- *extra_preargs* and *extra_postargs* are implementation-dependent. On platforms
- that have the notion of a command line (e.g. Unix, DOS/Windows), they are most
- likely lists of strings: extra command-line arguments to prepend/append to the
- compiler command line. On other platforms, consult the implementation class
- documentation. In any event, they are intended as an escape hatch for those
- occasions when the abstract compiler framework doesn't cut the mustard.
-
- *depends*, if given, is a list of filenames that all targets depend on. If a
- source file is older than any file in depends, then the source file will be
- recompiled. This supports dependency tracking, but only at a coarse
- granularity.
-
- Raises :exc:`CompileError` on failure.
-
-
- .. method:: CCompiler.create_static_lib(objects, output_libname, output_dir=None, debug=0, target_lang=None)
-
- Link a bunch of stuff together to create a static library file. The "bunch of
- stuff" consists of the list of object files supplied as *objects*, the extra
- object files supplied to :meth:`add_link_object` and/or
- :meth:`set_link_objects`, the libraries supplied to :meth:`add_library` and/or
- :meth:`set_libraries`, and the libraries supplied as *libraries* (if any).
-
- *output_libname* should be a library name, not a filename; the filename will be
- inferred from the library name. *output_dir* is the directory where the library
- file will be put. XXX defaults to what?
-
- *debug* is a boolean; if true, debugging information will be included in the
- library (note that on most platforms, it is the compile step where this matters:
- the *debug* flag is included here just for consistency).
-
- *target_lang* is the target language for which the given objects are being
- compiled. This allows specific linkage time treatment of certain languages.
-
- Raises :exc:`LibError` on failure.
-
-
- .. method:: CCompiler.link(target_desc, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None, target_lang=None)
-
- Link a bunch of stuff together to create an executable or shared library file.
-
- The "bunch of stuff" consists of the list of object files supplied as *objects*.
- *output_filename* should be a filename. If *output_dir* is supplied,
- *output_filename* is relative to it (i.e. *output_filename* can provide
- directory components if needed).
-
- *libraries* is a list of libraries to link against. These are library names,
- not filenames, since they're translated into filenames in a platform-specific
- way (e.g. *foo* becomes :file:`libfoo.a` on Unix and :file:`foo.lib` on
- DOS/Windows). However, they can include a directory component, which means the
- linker will look in that specific directory rather than searching all the normal
- locations.
-
- *library_dirs*, if supplied, should be a list of directories to search for
- libraries that were specified as bare library names (i.e. no directory
- component). These are on top of the system default and those supplied to
- :meth:`add_library_dir` and/or :meth:`set_library_dirs`. *runtime_library_dirs*
- is a list of directories that will be embedded into the shared library and used
- to search for other shared libraries that \*it\* depends on at run-time. (This
- may only be relevant on Unix.)
-
- *export_symbols* is a list of symbols that the shared library will export.
- (This appears to be relevant only on Windows.)
-
- *debug* is as for :meth:`compile` and :meth:`create_static_lib`, with the
- slight distinction that it actually matters on most platforms (as opposed to
- :meth:`create_static_lib`, which includes a *debug* flag mostly for form's
- sake).
-
- *extra_preargs* and *extra_postargs* are as for :meth:`compile` (except of
- course that they supply command-line arguments for the particular linker being
- used).
-
- *target_lang* is the target language for which the given objects are being
- compiled. This allows specific linkage time treatment of certain languages.
-
- Raises :exc:`LinkError` on failure.
-
-
- .. method:: CCompiler.link_executable(objects, output_progname, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, debug=0, extra_preargs=None, extra_postargs=None, target_lang=None)
-
- Link an executable. *output_progname* is the name of the file executable, while
- *objects* are a list of object filenames to link in. Other arguments are as for
- the :meth:`link` method.
-
-
- .. method:: CCompiler.link_shared_lib(objects, output_libname, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None, target_lang=None)
-
- Link a shared library. *output_libname* is the name of the output library,
- while *objects* is a list of object filenames to link in. Other arguments are
- as for the :meth:`link` method.
-
-
- .. method:: CCompiler.link_shared_object(objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None, target_lang=None)
-
- Link a shared object. *output_filename* is the name of the shared object that
- will be created, while *objects* is a list of object filenames to link in.
- Other arguments are as for the :meth:`link` method.
-
-
- .. method:: CCompiler.preprocess(source, output_file=None, macros=None, include_dirs=None, extra_preargs=None, extra_postargs=None)
-
- Preprocess a single C/C++ source file, named in *source*. Output will be written
- to file named *output_file*, or *stdout* if *output_file* not supplied.
- *macros* is a list of macro definitions as for :meth:`compile`, which will
- augment the macros set with :meth:`define_macro` and :meth:`undefine_macro`.
- *include_dirs* is a list of directory names that will be added to the default
- list, in the same way as :meth:`add_include_dir`.
-
- Raises :exc:`PreprocessError` on failure.
-
- The following utility methods are defined by the :class:`CCompiler` class, for
- use by the various concrete subclasses.
-
-
- .. method:: CCompiler.executable_filename(basename, strip_dir=0, output_dir='')
-
- Returns the filename of the executable for the given *basename*. Typically for
- non-Windows platforms this is the same as the basename, while Windows will get
- a :file:`.exe` added.
-
-
- .. method:: CCompiler.library_filename(libname, lib_type='static', strip_dir=0, output_dir='')
-
- Returns the filename for the given library name on the current platform. On Unix
- a library with *lib_type* of ``'static'`` will typically be of the form
- :file:`liblibname.a`, while a *lib_type* of ``'dynamic'`` will be of the form
- :file:`liblibname.so`.
-
-
- .. method:: CCompiler.object_filenames(source_filenames, strip_dir=0, output_dir='')
-
- Returns the name of the object files for the given source files.
- *source_filenames* should be a list of filenames.
-
-
- .. method:: CCompiler.shared_object_filename(basename, strip_dir=0, output_dir='')
-
- Returns the name of a shared object file for the given file name *basename*.
-
-
- .. method:: CCompiler.execute(func, args, msg=None, level=1)
-
- Invokes :func:`packaging.util.execute` This method invokes a Python function
- *func* with the given arguments *args*, after logging and taking into account
- the *dry_run* flag. XXX see also.
-
-
- .. method:: CCompiler.spawn(cmd)
-
- Invokes :func:`packaging.util.spawn`. This invokes an external process to run
- the given command. XXX see also.
-
-
- .. method:: CCompiler.mkpath(name, mode=511)
-
- Invokes :func:`packaging.dir_util.mkpath`. This creates a directory and any
- missing ancestor directories. XXX see also.
-
-
- .. method:: CCompiler.move_file(src, dst)
-
- Invokes :meth:`packaging.file_util.move_file`. Renames *src* to *dst*. XXX see
- also.
-
-
-:mod:`packaging.compiler.extension` --- The Extension class
-===========================================================
-
-.. module:: packaging.compiler.extension
- :synopsis: Class used to represent C/C++ extension modules.
-
-
-This module provides the :class:`Extension` class, used to represent C/C++
-extension modules.
-
-.. class:: Extension
-
- The Extension class describes a single C or C++ extension module. It accepts
- the following keyword arguments in its constructor:
-
- +------------------------+--------------------------------+---------------------------+
- | argument name | value | type |
- +========================+================================+===========================+
- | *name* | the full name of the | string |
- | | extension, including any | |
- | | packages --- i.e. *not* a | |
- | | filename or pathname, but | |
- | | Python dotted name | |
- +------------------------+--------------------------------+---------------------------+
- | *sources* | list of source filenames, | list of strings |
- | | relative to the distribution | |
- | | root (where the setup script | |
- | | lives), in Unix form (slash- | |
- | | separated) for portability. | |
- | | Source files may be C, C++, | |
- | | SWIG (.i), platform-specific | |
- | | resource files, or whatever | |
- | | else is recognized by the | |
- | | :command:`build_ext` command | |
- | | as source for a Python | |
- | | extension. | |
- +------------------------+--------------------------------+---------------------------+
- | *include_dirs* | list of directories to search | list of strings |
- | | for C/C++ header files (in | |
- | | Unix form for portability) | |
- +------------------------+--------------------------------+---------------------------+
- | *define_macros* | list of macros to define; each | list of tuples |
- | | macro is defined using a | |
- | | 2-tuple ``(name, value)``, | |
- | | where *value* is | |
- | | either the string to define it | |
- | | to or ``None`` to define it | |
- | | without a particular value | |
- | | (equivalent of ``#define FOO`` | |
- | | in source or :option:`-DFOO` | |
- | | on Unix C compiler command | |
- | | line) | |
- +------------------------+--------------------------------+---------------------------+
- | *undef_macros* | list of macros to undefine | list of strings |
- | | explicitly | |
- +------------------------+--------------------------------+---------------------------+
- | *library_dirs* | list of directories to search | list of strings |
- | | for C/C++ libraries at link | |
- | | time | |
- +------------------------+--------------------------------+---------------------------+
- | *libraries* | list of library names (not | list of strings |
- | | filenames or paths) to link | |
- | | against | |
- +------------------------+--------------------------------+---------------------------+
- | *runtime_library_dirs* | list of directories to search | list of strings |
- | | for C/C++ libraries at run | |
- | | time (for shared extensions, | |
- | | this is when the extension is | |
- | | loaded) | |
- +------------------------+--------------------------------+---------------------------+
- | *extra_objects* | list of extra files to link | list of strings |
- | | with (e.g. object files not | |
- | | implied by 'sources', static | |
- | | library that must be | |
- | | explicitly specified, binary | |
- | | resource files, etc.) | |
- +------------------------+--------------------------------+---------------------------+
- | *extra_compile_args* | any extra platform- and | list of strings |
- | | compiler-specific information | |
- | | to use when compiling the | |
- | | source files in 'sources'. For | |
- | | platforms and compilers where | |
- | | a command line makes sense, | |
- | | this is typically a list of | |
- | | command-line arguments, but | |
- | | for other platforms it could | |
- | | be anything. | |
- +------------------------+--------------------------------+---------------------------+
- | *extra_link_args* | any extra platform- and | list of strings |
- | | compiler-specific information | |
- | | to use when linking object | |
- | | files together to create the | |
- | | extension (or to create a new | |
- | | static Python interpreter). | |
- | | Similar interpretation as for | |
- | | 'extra_compile_args'. | |
- +------------------------+--------------------------------+---------------------------+
- | *export_symbols* | list of symbols to be exported | list of strings |
- | | from a shared extension. Not | |
- | | used on all platforms, and not | |
- | | generally necessary for Python | |
- | | extensions, which typically | |
- | | export exactly one symbol: | |
- | | ``init`` + extension_name. | |
- +------------------------+--------------------------------+---------------------------+
- | *depends* | list of files that the | list of strings |
- | | extension depends on | |
- +------------------------+--------------------------------+---------------------------+
- | *language* | extension language (i.e. | string |
- | | ``'c'``, ``'c++'``, | |
- | | ``'objc'``). Will be detected | |
- | | from the source extensions if | |
- | | not provided. | |
- +------------------------+--------------------------------+---------------------------+
- | *optional* | specifies that a build failure | boolean |
- | | in the extension should not | |
- | | abort the build process, but | |
- | | simply skip the extension. | |
- +------------------------+--------------------------------+---------------------------+
-
-To distribute extension modules that live in a package (e.g. ``package.ext``),
-you need to create a :file:`{package}/__init__.py` file to let Python recognize
-and import your module.
diff --git a/Doc/library/packaging.database.rst b/Doc/library/packaging.database.rst
deleted file mode 100644
index 9d750f00d9..0000000000
--- a/Doc/library/packaging.database.rst
+++ /dev/null
@@ -1,345 +0,0 @@
-:mod:`packaging.database` --- Database of installed distributions
-=================================================================
-
-.. module:: packaging.database
- :synopsis: Functions to query and manipulate installed distributions.
-
-
-This module provides an implementation of :PEP:`376`. It was originally
-intended to land in :mod:`pkgutil`, but with the inclusion of Packaging in the
-standard library, it was thought best to include it in a submodule of
-:mod:`packaging`, leaving :mod:`pkgutil` to deal with imports.
-
-Installed Python distributions are represented by instances of
-:class:`Distribution`, or :class:`EggInfoDistribution` for legacy egg formats.
-Most functions also provide an extra argument ``use_egg_info`` to take legacy
-distributions into account.
-
-For the purpose of this module, "installed" means that the distribution's
-:file:`.dist-info`, :file:`.egg-info` or :file:`egg` directory or file is found
-on :data:`sys.path`. For example, if the parent directory of a
-:file:`dist-info` directory is added to :envvar:`PYTHONPATH`, then it will be
-available in the database.
-
-Classes representing installed distributions
---------------------------------------------
-
-.. class:: Distribution(path)
-
- Class representing an installed distribution. It is different from
- :class:`packaging.dist.Distribution` which holds the list of files, the
- metadata and options during the run of a Packaging command.
-
- Instantiate with the *path* to a ``.dist-info`` directory. Instances can be
- compared and sorted. Other available methods are:
-
- .. XXX describe how comparison works
-
- .. method:: get_distinfo_file(path, binary=False)
-
- Return a read-only file object for a file located at
- :file:`{project}-{version}.dist-info/{path}`. *path* should be a
- ``'/'``-separated path relative to the ``.dist-info`` directory or an
- absolute path; if it is an absolute path and doesn't start with the path
- to the :file:`.dist-info` directory, a :class:`PackagingError` is raised.
-
- If *binary* is ``True``, the file is opened in binary mode.
-
- .. method:: get_resource_path(relative_path)
-
- .. TODO
-
- .. method:: list_distinfo_files(local=False)
-
- Return an iterator over all files located in the :file:`.dist-info`
- directory. If *local* is ``True``, each returned path is transformed into
- a local absolute path, otherwise the raw value found in the :file:`RECORD`
- file is returned.
-
- .. method:: list_installed_files(local=False)
-
- Iterate over the files installed with the distribution and registered in
- the :file:`RECORD` file and yield a tuple ``(path, md5, size)`` for each
- line. If *local* is ``True``, the returned path is transformed into a
- local absolute path, otherwise the raw value is returned.
-
- A local absolute path is an absolute path in which occurrences of ``'/'``
- have been replaced by :data:`os.sep`.
-
- .. method:: uses(path)
-
- Check whether *path* was installed by this distribution (i.e. if the path
- is present in the :file:`RECORD` file). *path* can be a local absolute
- path or a relative ``'/'``-separated path. Returns a boolean.
-
- Available attributes:
-
- .. attribute:: metadata
-
- Instance of :class:`packaging.metadata.Metadata` filled with the contents
- of the :file:`{project}-{version}.dist-info/METADATA` file.
-
- .. attribute:: name
-
- Shortcut for ``metadata['Name']``.
-
- .. attribute:: version
-
- Shortcut for ``metadata['Version']``.
-
- .. attribute:: requested
-
- Boolean indicating whether this distribution was requested by the user of
- automatically installed as a dependency.
-
-
-.. class:: EggInfoDistribution(path)
-
- Class representing a legacy distribution. It is compatible with distutils'
- and setuptools' :file:`.egg-info` and :file:`.egg` files and directories.
-
- .. FIXME should be named EggDistribution
-
- Instantiate with the *path* to an egg file or directory. Instances can be
- compared and sorted. Other available methods are:
-
- .. method:: list_installed_files(local=False)
-
- .. method:: uses(path)
-
- Available attributes:
-
- .. attribute:: metadata
-
- Instance of :class:`packaging.metadata.Metadata` filled with the contents
- of the :file:`{project-version}.egg-info/PKG-INFO` or
- :file:`{project-version}.egg` file.
-
- .. attribute:: name
-
- Shortcut for ``metadata['Name']``.
-
- .. attribute:: version
-
- Shortcut for ``metadata['Version']``.
-
-
-Functions to work with the database
------------------------------------
-
-.. function:: get_distribution(name, use_egg_info=False, paths=None)
-
- Return an instance of :class:`Distribution` or :class:`EggInfoDistribution`
- for the first installed distribution matching *name*. Egg distributions are
- considered only if *use_egg_info* is true; if both a dist-info and an egg
- file are found, the dist-info prevails. The directories to be searched are
- given in *paths*, which defaults to :data:`sys.path`. Returns ``None`` if no
- matching distribution is found.
-
- .. FIXME param should be named use_egg
-
-
-.. function:: get_distributions(use_egg_info=False, paths=None)
-
- Return an iterator of :class:`Distribution` instances for all installed
- distributions found in *paths* (defaults to :data:`sys.path`). If
- *use_egg_info* is true, also return instances of :class:`EggInfoDistribution`
- for legacy distributions found.
-
-
-.. function:: get_file_users(path)
-
- Return an iterator over all distributions using *path*, a local absolute path
- or a relative ``'/'``-separated path.
-
- .. XXX does this work with prefixes or full file path only?
-
-
-.. function:: obsoletes_distribution(name, version=None, use_egg_info=False)
-
- Return an iterator over all distributions that declare they obsolete *name*.
- *version* is an optional argument to match only specific releases (see
- :mod:`packaging.version`). If *use_egg_info* is true, legacy egg
- distributions will be considered as well.
-
-
-.. function:: provides_distribution(name, version=None, use_egg_info=False)
-
- Return an iterator over all distributions that declare they provide *name*.
- *version* is an optional argument to match only specific releases (see
- :mod:`packaging.version`). If *use_egg_info* is true, legacy egg
- distributions will be considered as well.
-
-
-Utility functions
------------------
-
-.. function:: distinfo_dirname(name, version)
-
- Escape *name* and *version* into a filename-safe form and return the
- directory name built from them, for example
- :file:`{safename}-{safeversion}.dist-info.` In *name*, runs of
- non-alphanumeric characters are replaced with one ``'_'``; in *version*,
- spaces become dots, and runs of other non-alphanumeric characters (except
- dots) a replaced by one ``'-'``.
-
- .. XXX wth spaces in version numbers?
-
-For performance purposes, the list of distributions is being internally
-cached. Caching is enabled by default, but you can control it with these
-functions:
-
-.. function:: clear_cache()
-
- Clear the cache.
-
-.. function:: disable_cache()
-
- Disable the cache, without clearing it.
-
-.. function:: enable_cache()
-
- Enable the internal cache, without clearing it.
-
-
-Examples
---------
-
-Printing all information about a distribution
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Given the name of an installed distribution, we shall print out all
-information that can be obtained using functions provided in this module::
-
- import sys
- import packaging.database
-
- try:
- name = sys.argv[1]
- except ValueError:
- sys.exit('Not enough arguments')
-
- # first create the Distribution instance
- dist = packaging.database.Distribution(path)
- if dist is None:
- sys.exit('No such distribution')
-
- print('Information about %r' % dist.name)
- print()
-
- print('Files')
- print('=====')
- for path, md5, size in dist.list_installed_files():
- print('* Path: %s' % path)
- print(' Hash %s, Size: %s bytes' % (md5, size))
- print()
-
- print('Metadata')
- print('========')
- for key, value in dist.metadata.items():
- print('%20s: %s' % (key, value))
- print()
-
- print('Extra')
- print('=====')
- if dist.requested:
- print('* It was installed by user request')
- else:
- print('* It was installed as a dependency')
-
-If we save the script above as ``print_info.py``, we can use it to extract
-information from a :file:`.dist-info` directory. By typing in the console:
-
-.. code-block:: sh
-
- python print_info.py choxie
-
-we get the following output:
-
-.. code-block:: none
-
- Information about 'choxie'
-
- Files
- =====
- * Path: ../tmp/distutils2/tests/fake_dists/choxie-2.0.0.9/truffles.py
- Hash 5e052db6a478d06bad9ae033e6bc08af, Size: 111 bytes
- * Path: ../tmp/distutils2/tests/fake_dists/choxie-2.0.0.9/choxie/chocolate.py
- Hash ac56bf496d8d1d26f866235b95f31030, Size: 214 bytes
- * Path: ../tmp/distutils2/tests/fake_dists/choxie-2.0.0.9/choxie/__init__.py
- Hash 416aab08dfa846f473129e89a7625bbc, Size: 25 bytes
- * Path: ../tmp/distutils2/tests/fake_dists/choxie-2.0.0.9.dist-info/INSTALLER
- Hash d41d8cd98f00b204e9800998ecf8427e, Size: 0 bytes
- * Path: ../tmp/distutils2/tests/fake_dists/choxie-2.0.0.9.dist-info/METADATA
- Hash 696a209967fef3c8b8f5a7bb10386385, Size: 225 bytes
- * Path: ../tmp/distutils2/tests/fake_dists/choxie-2.0.0.9.dist-info/REQUESTED
- Hash d41d8cd98f00b204e9800998ecf8427e, Size: 0 bytes
- * Path: ../tmp/distutils2/tests/fake_dists/choxie-2.0.0.9.dist-info/RECORD
- Hash None, Size: None bytes
-
- Metadata
- ========
- Metadata-Version: 1.2
- Name: choxie
- Version: 2.0.0.9
- Platform: []
- Supported-Platform: UNKNOWN
- Summary: Chocolate with a kick!
- Description: UNKNOWN
- Keywords: []
- Home-page: UNKNOWN
- Author: UNKNOWN
- Author-email: UNKNOWN
- Maintainer: UNKNOWN
- Maintainer-email: UNKNOWN
- License: UNKNOWN
- Classifier: []
- Download-URL: UNKNOWN
- Obsoletes-Dist: ['truffles (<=0.8,>=0.5)', 'truffles (<=0.9,>=0.6)']
- Project-URL: []
- Provides-Dist: ['truffles (1.0)']
- Requires-Dist: ['towel-stuff (0.1)']
- Requires-Python: UNKNOWN
- Requires-External: []
-
- Extra
- =====
- * It was installed as a dependency
-
-
-Getting metadata about a distribution
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Sometimes you're not interested about the packaging information contained in a
-full :class:`Distribution` object but just want to do something with its
-:attr:`~Distribution.metadata`::
-
- >>> from packaging.database import get_distribution
- >>> info = get_distribution('chocolate').metadata
- >>> info['Keywords']
- ['cooking', 'happiness']
-
-
-Finding out obsoleted distributions
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Now, we tackle a different problem, we are interested in finding out
-which distributions have been obsoleted. This can be easily done as follows::
-
- import packaging.database
-
- # iterate over all distributions in the system
- for dist in packaging.database.get_distributions():
- name, version = dist.name, dist.version
- # find out which distributions obsolete this name/version combination
- replacements = packaging.database.obsoletes_distribution(name, version)
- if replacements:
- print('%r %s is obsoleted by' % (name, version),
- ', '.join(repr(r.name) for r in replacements))
-
-This is how the output might look like:
-
-.. code-block:: none
-
- 'strawberry' 0.6 is obsoleted by 'choxie'
- 'grammar' 1.0a4 is obsoleted by 'towel-stuff'
diff --git a/Doc/library/packaging.depgraph.rst b/Doc/library/packaging.depgraph.rst
deleted file mode 100644
index c384788e9b..0000000000
--- a/Doc/library/packaging.depgraph.rst
+++ /dev/null
@@ -1,199 +0,0 @@
-:mod:`packaging.depgraph` --- Dependency graph builder
-======================================================
-
-.. module:: packaging.depgraph
- :synopsis: Graph builder for dependencies between releases.
-
-
-This module provides the means to analyse the dependencies between various
-distributions and to create a graph representing these dependency relationships.
-In this document, "distribution" refers to an instance of
-:class:`packaging.database.Distribution` or
-:class:`packaging.database.EggInfoDistribution`.
-
-.. XXX terminology problem with dist vs. release: dists are installed, but deps
- use releases
-
-.. XXX explain how to use it with dists not installed: Distribution can only be
- instantiated with a path, but this module is useful for remote dist too
-
-.. XXX functions should accept and return iterators, not lists
-
-
-The :class:`DependencyGraph` class
-----------------------------------
-
-.. class:: DependencyGraph
-
- Represent a dependency graph between releases. The nodes are distribution
- instances; the edge model dependencies. An edge from ``a`` to ``b`` means
- that ``a`` depends on ``b``.
-
- .. method:: add_distribution(distribution)
-
- Add *distribution* to the graph.
-
- .. method:: add_edge(x, y, label=None)
-
- Add an edge from distribution *x* to distribution *y* with the given
- *label* (string).
-
- .. method:: add_missing(distribution, requirement)
-
- Add a missing *requirement* (string) for the given *distribution*.
-
- .. method:: repr_node(dist, level=1)
-
- Print a subgraph starting from *dist*. *level* gives the depth of the
- subgraph.
-
- Direct access to the graph nodes and edges is provided through these
- attributes:
-
- .. attribute:: adjacency_list
-
- Dictionary mapping distributions to a list of ``(other, label)`` tuples
- where ``other`` is a distribution and the edge is labeled with ``label``
- (i.e. the version specifier, if such was provided).
-
- .. attribute:: reverse_list
-
- Dictionary mapping distributions to a list of predecessors. This allows
- efficient traversal.
-
- .. attribute:: missing
-
- Dictionary mapping distributions to a list of requirements that were not
- provided by any distribution.
-
-
-Auxiliary functions
--------------------
-
-.. function:: dependent_dists(dists, dist)
-
- Recursively generate a list of distributions from *dists* that are dependent
- on *dist*.
-
- .. XXX what does member mean here: "dist is a member of *dists* for which we
- are interested"
-
-.. function:: generate_graph(dists)
-
- Generate a :class:`DependencyGraph` from the given list of distributions.
-
- .. XXX make this alternate constructor a DepGraph classmethod or rename;
- 'generate' can suggest it creates a file or an image, use 'make'
-
-.. function:: graph_to_dot(graph, f, skip_disconnected=True)
-
- Write a DOT output for the graph to the file-like object *f*.
-
- If *skip_disconnected* is true, all distributions that are not dependent on
- any other distribution are skipped.
-
- .. XXX why is this not a DepGraph method?
-
-
-Example Usage
--------------
-
-Depict all dependenciess in the system
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-First, we shall generate a graph of all the distributions on the system
-and then create an image out of it using the tools provided by
-`Graphviz `_::
-
- from packaging.database import get_distributions
- from packaging.depgraph import generate_graph
-
- dists = list(get_distributions())
- graph = generate_graph(dists)
-
-It would be interesting to print out the missing requirements. This can be done
-as follows::
-
- for dist, reqs in graph.missing.items():
- if reqs:
- reqs = ' ,'.join(repr(req) for req in reqs)
- print('Missing dependencies for %r: %s' % (dist.name, reqs))
-
-Example output is:
-
-.. code-block:: none
-
- Missing dependencies for 'TurboCheetah': 'Cheetah'
- Missing dependencies for 'TurboGears': 'ConfigObj', 'DecoratorTools', 'RuleDispatch'
- Missing dependencies for 'jockey': 'PyKDE4.kdecore', 'PyKDE4.kdeui', 'PyQt4.QtCore', 'PyQt4.QtGui'
- Missing dependencies for 'TurboKid': 'kid'
- Missing dependencies for 'TurboJson: 'DecoratorTools', 'RuleDispatch'
-
-Now, we proceed with generating a graphical representation of the graph. First
-we write it to a file, and then we generate a PNG image using the
-:program:`dot` command-line tool::
-
- from packaging.depgraph import graph_to_dot
- with open('output.dot', 'w') as f:
- # only show the interesting distributions, skipping the disconnected ones
- graph_to_dot(graph, f, skip_disconnected=True)
-
-We can create the final picture using:
-
-.. code-block:: sh
-
- $ dot -Tpng output.dot > output.png
-
-An example result is:
-
-.. figure:: depgraph-output.png
- :alt: Example PNG output from packaging.depgraph and dot
-
-If you want to include egg distributions as well, then the code requires only
-one change, namely the line::
-
- dists = list(packaging.database.get_distributions())
-
-has to be replaced with::
-
- dists = list(packaging.database.get_distributions(use_egg_info=True))
-
-On many platforms, a richer graph is obtained because at the moment most
-distributions are provided in the egg rather than the new standard
-``.dist-info`` format.
-
-.. XXX missing image
-
- An example of a more involved graph for illustrative reasons can be seen
- here:
-
- .. image:: depgraph_big.png
-
-
-List all dependent distributions
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-We will list all distributions that are dependent on some given distibution.
-This time, egg distributions will be considered as well::
-
- import sys
- from packaging.database import get_distribution, get_distributions
- from packaging.depgraph import dependent_dists
-
- dists = list(get_distributions(use_egg_info=True))
- dist = get_distribution('bacon', use_egg_info=True)
- if dist is None:
- sys.exit('No such distribution in the system')
-
- deps = dependent_dists(dists, dist)
- deps = ', '.join(repr(x.name) for x in deps)
- print('Distributions depending on %r: %s' % (dist.name, deps))
-
-And this is example output:
-
-.. with the dependency relationships as in the previous section
- (depgraph_big)
-
-.. code-block:: none
-
- Distributions depending on 'bacon': 'towel-stuff', 'choxie', 'grammar'
diff --git a/Doc/library/packaging.dist.rst b/Doc/library/packaging.dist.rst
deleted file mode 100644
index 25cb62bc4b..0000000000
--- a/Doc/library/packaging.dist.rst
+++ /dev/null
@@ -1,108 +0,0 @@
-:mod:`packaging.dist` --- The Distribution class
-================================================
-
-.. module:: packaging.dist
- :synopsis: Core Distribution class.
-
-
-This module provides the :class:`Distribution` class, which represents the
-module distribution being built/packaged/distributed/installed.
-
-.. class:: Distribution(arguments)
-
- A :class:`Distribution` describes how to build, package, distribute and
- install a Python project.
-
- The arguments accepted by the constructor are laid out in the following
- table. Some of them will end up in a metadata object, the rest will become
- data attributes of the :class:`Distribution` instance.
-
- .. TODO improve constructor to take a Metadata object + named params?
- (i.e. Distribution(metadata, cmdclass, py_modules, etc)
- .. TODO also remove obsolete(?) script_name, etc. parameters? see what
- py2exe and other tools need
-
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | argument name | value | type |
- +====================+================================+=============================================================+
- | *name* | The name of the project | a string |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *version* | The version number of the | a string |
- | | release; see | |
- | | :mod:`packaging.version` | |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *summary* | A single line describing the | a string |
- | | project | |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *description* | Longer description of the | a string |
- | | project | |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *author* | The name of the project author | a string |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *author_email* | The email address of the | a string |
- | | project author | |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *maintainer* | The name of the current | a string |
- | | maintainer, if different from | |
- | | the author | |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *maintainer_email* | The email address of the | a string |
- | | current maintainer, if | |
- | | different from the author | |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *home_page* | A URL for the proejct | a string |
- | | (homepage) | |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *download_url* | A URL to download the project | a string |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *packages* | A list of Python packages that | a list of strings |
- | | packaging will manipulate | |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *py_modules* | A list of Python modules that | a list of strings |
- | | packaging will manipulate | |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *scripts* | A list of standalone scripts | a list of strings |
- | | to be built and installed | |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *ext_modules* | A list of Python extensions to | a list of instances of |
- | | be built | :class:`packaging.compiler.extension.Extension` |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *classifiers* | A list of categories for the | a list of strings; valid classifiers are listed on `PyPi |
- | | distribution | `_. |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *distclass* | the :class:`Distribution` | a subclass of |
- | | class to use | :class:`packaging.dist.Distribution` |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *script_name* | The name of the setup.py | a string |
- | | script - defaults to | |
- | | ``sys.argv[0]`` | |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *script_args* | Arguments to supply to the | a list of strings |
- | | setup script | |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *options* | default options for the setup | a string |
- | | script | |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *license* | The license for the | a string |
- | | distribution; should be used | |
- | | when there is no suitable | |
- | | License classifier, or to | |
- | | refine a classifier | |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *keywords* | Descriptive keywords; used by | a list of strings or a comma-separated string |
- | | catalogs such as PyPI | |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *platforms* | Platforms compatible with this | a list of strings or a comma-separated string |
- | | distribution; should be used | |
- | | when there is no suitable | |
- | | Platform classifier | |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *cmdclass* | A mapping of command names to | a dictionary |
- | | :class:`Command` subclasses | |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *data_files* | A list of data files to | a list |
- | | install | |
- +--------------------+--------------------------------+-------------------------------------------------------------+
- | *package_dir* | A mapping of Python packages | a dictionary |
- | | to directory names | |
- +--------------------+--------------------------------+-------------------------------------------------------------+
diff --git a/Doc/library/packaging.fancy_getopt.rst b/Doc/library/packaging.fancy_getopt.rst
deleted file mode 100644
index 199cbcd211..0000000000
--- a/Doc/library/packaging.fancy_getopt.rst
+++ /dev/null
@@ -1,75 +0,0 @@
-:mod:`packaging.fancy_getopt` --- Wrapper around the getopt module
-==================================================================
-
-.. module:: packaging.fancy_getopt
- :synopsis: Additional getopt functionality.
-
-
-.. warning::
- This module is deprecated and will be replaced with :mod:`optparse`.
-
-This module provides a wrapper around the standard :mod:`getopt` module that
-provides the following additional features:
-
-* short and long options are tied together
-
-* options have help strings, so :func:`fancy_getopt` could potentially create a
- complete usage summary
-
-* options set attributes of a passed-in object
-
-* boolean options can have "negative aliases" --- e.g. if :option:`--quiet` is
- the "negative alias" of :option:`--verbose`, then :option:`--quiet` on the
- command line sets *verbose* to false.
-
-.. function:: fancy_getopt(options, negative_opt, object, args)
-
- Wrapper function. *options* is a list of ``(long_option, short_option,
- help_string)`` 3-tuples as described in the constructor for
- :class:`FancyGetopt`. *negative_opt* should be a dictionary mapping option names
- to option names, both the key and value should be in the *options* list.
- *object* is an object which will be used to store values (see the :meth:`getopt`
- method of the :class:`FancyGetopt` class). *args* is the argument list. Will use
- ``sys.argv[1:]`` if you pass ``None`` as *args*.
-
-
-.. class:: FancyGetopt(option_table=None)
-
- The option_table is a list of 3-tuples: ``(long_option, short_option,
- help_string)``
-
- If an option takes an argument, its *long_option* should have ``'='`` appended;
- *short_option* should just be a single character, no ``':'`` in any case.
- *short_option* should be ``None`` if a *long_option* doesn't have a
- corresponding *short_option*. All option tuples must have long options.
-
-The :class:`FancyGetopt` class provides the following methods:
-
-
-.. method:: FancyGetopt.getopt(args=None, object=None)
-
- Parse command-line options in args. Store as attributes on *object*.
-
- If *args* is ``None`` or not supplied, uses ``sys.argv[1:]``. If *object* is
- ``None`` or not supplied, creates a new :class:`OptionDummy` instance, stores
- option values there, and returns a tuple ``(args, object)``. If *object* is
- supplied, it is modified in place and :func:`getopt` just returns *args*; in
- both cases, the returned *args* is a modified copy of the passed-in *args* list,
- which is left untouched.
-
- .. TODO and args returned are?
-
-
-.. method:: FancyGetopt.get_option_order()
-
- Returns the list of ``(option, value)`` tuples processed by the previous run of
- :meth:`getopt` Raises :exc:`RuntimeError` if :meth:`getopt` hasn't been called
- yet.
-
-
-.. method:: FancyGetopt.generate_help(header=None)
-
- Generate help text (a list of strings, one per suggested line of output) from
- the option table for this :class:`FancyGetopt` object.
-
- If supplied, prints the supplied *header* at the top of the help.
diff --git a/Doc/library/packaging.install.rst b/Doc/library/packaging.install.rst
deleted file mode 100644
index 3e00750988..0000000000
--- a/Doc/library/packaging.install.rst
+++ /dev/null
@@ -1,112 +0,0 @@
-:mod:`packaging.install` --- Installation tools
-===============================================
-
-.. module:: packaging.install
- :synopsis: Download and installation building blocks
-
-
-Packaging provides a set of tools to deal with downloads and installation of
-distributions. Their role is to download the distribution from indexes, resolve
-the dependencies, and provide a safe way to install distributions. An operation
-that fails will cleanly roll back, not leave half-installed distributions on the
-system. Here's the basic process followed:
-
-#. Move all distributions that will be removed to a temporary location.
-
-#. Install all the distributions that will be installed in a temporary location.
-
-#. If the installation fails, move the saved distributions back to their
- location and delete the installed distributions.
-
-#. Otherwise, move the installed distributions to the right location and delete
- the temporary locations.
-
-This is a higher-level module built on :mod:`packaging.database` and
-:mod:`packaging.pypi`.
-
-
-Public functions
-----------------
-
-.. function:: get_infos(requirements, index=None, installed=None, \
- prefer_final=True)
-
- Return information about what's going to be installed and upgraded.
- *requirements* is a string containing the requirements for this
- project, for example ``'FooBar 1.1'`` or ``'BarBaz (<1.2)'``.
-
- .. XXX are requirements comma-separated?
-
- If you want to use another index than the main PyPI, give its URI as *index*
- argument.
-
- *installed* is a list of already installed distributions used to find
- satisfied dependencies, obsoleted distributions and eventual conflicts.
-
- By default, alpha, beta and candidate versions are not picked up. Set
- *prefer_final* to false to accept them too.
-
- The results are returned in a dictionary containing all the information
- needed to perform installation of the requirements with the
- :func:`install_from_infos` function:
-
- >>> get_install_info("FooBar (<=1.2)")
- {'install': [], 'remove': [], 'conflict': []}
-
- .. TODO should return tuple or named tuple, not dict
- .. TODO use "predicate" or "requirement" consistently in version and here
- .. FIXME "info" cannot be plural in English, s/infos/info/
-
-
-.. function:: install(project)
-
-
-.. function:: install_dists(dists, path, paths=None)
-
- Safely install all distributions provided in *dists* into *path*. *paths* is
- a list of paths where already-installed distributions will be looked for to
- find satisfied dependencies and conflicts (default: :data:`sys.path`).
- Returns a list of installed dists.
-
- .. FIXME dists are instances of what?
-
-
-.. function:: install_from_infos(install_path=None, install=[], remove=[], \
- conflicts=[], paths=None)
-
- Safely install and remove given distributions. This function is designed to
- work with the return value of :func:`get_infos`: *install*, *remove* and
- *conflicts* should be list of distributions returned by :func:`get_infos`.
- If *install* is not empty, *install_path* must be given to specify the path
- where the distributions should be installed. *paths* is a list of paths
- where already-installed distributions will be looked for (default:
- :data:`sys.path`).
-
- This function is a very basic installer; if *conflicts* is not empty, the
- system will be in a conflicting state after the function completes. It is a
- building block for more sophisticated installers with conflict resolution
- systems.
-
- .. TODO document typical value for install_path
- .. TODO document integration with default schemes, esp. user site-packages
-
-
-.. function:: install_local_project(path)
-
- Install a distribution from a source directory, which must contain either a
- Packaging-compliant :file:`setup.cfg` file or a legacy Distutils
- :file:`setup.py` script (in which case Distutils will be used under the hood
- to perform the installation).
-
-
-.. function:: remove(project_name, paths=None, auto_confirm=True)
-
- Remove one distribution from the system.
-
- .. FIXME this is the only function using "project" instead of dist/release
-
-..
- Example usage
- --------------
-
- Get the scheme of what's gonna be installed if we install "foobar":
diff --git a/Doc/library/packaging.metadata.rst b/Doc/library/packaging.metadata.rst
deleted file mode 100644
index 332d69df4f..0000000000
--- a/Doc/library/packaging.metadata.rst
+++ /dev/null
@@ -1,122 +0,0 @@
-:mod:`packaging.metadata` --- Metadata handling
-===============================================
-
-.. module:: packaging.metadata
- :synopsis: Class holding the metadata of a release.
-
-
-.. TODO use sphinx-autogen to generate basic doc from the docstrings
-
-.. class:: Metadata
-
- This class can read and write metadata files complying with any of the
- defined versions: 1.0 (:PEP:`241`), 1.1 (:PEP:`314`) and 1.2 (:PEP:`345`). It
- implements methods to parse Metadata files and write them, and a mapping
- interface to its contents.
-
- The :PEP:`345` implementation supports the micro-language for the environment
- markers, and displays warnings when versions that are supposed to be
- :PEP:`386`-compliant are violating the specification.
-
-
-Reading metadata
-----------------
-
-The :class:`Metadata` class can be instantiated
-with the path of the metadata file, and provides a dict-like interface to the
-values::
-
- >>> from packaging.metadata import Metadata
- >>> metadata = Metadata('PKG-INFO')
- >>> metadata.keys()[:5]
- ('Metadata-Version', 'Name', 'Version', 'Platform', 'Supported-Platform')
- >>> metadata['Name']
- 'CLVault'
- >>> metadata['Version']
- '0.5'
- >>> metadata['Requires-Dist']
- ["pywin32; sys.platform == 'win32'", "Sphinx"]
-
-
-The fields that support environment markers can be automatically ignored if
-the object is instantiated using the ``platform_dependent`` option.
-:class:`Metadata` will interpret in this case
-the markers and will automatically remove the fields that are not compliant
-with the running environment. Here's an example under Mac OS X. The win32
-dependency we saw earlier is ignored::
-
- >>> from packaging.metadata import Metadata
- >>> metadata = Metadata('PKG-INFO', platform_dependent=True)
- >>> metadata['Requires-Dist']
- ['Sphinx']
-
-
-If you want to provide your own execution context, let's say to test the
-metadata under a particular environment that is not the current environment,
-you can provide your own values in the ``execution_context`` option, which
-is the dict that may contain one or more keys of the context the micro-language
-expects.
-
-Here's an example, simulating a win32 environment::
-
- >>> from packaging.metadata import Metadata
- >>> context = {'sys.platform': 'win32'}
- >>> metadata = Metadata('PKG-INFO', platform_dependent=True,
- ... execution_context=context)
- ...
- >>> metadata['Requires-Dist'] = ["pywin32; sys.platform == 'win32'",
- ... "Sphinx"]
- ...
- >>> metadata['Requires-Dist']
- ['pywin32', 'Sphinx']
-
-
-Writing metadata
-----------------
-
-Writing metadata can be done using the ``write`` method::
-
- >>> metadata.write('/to/my/PKG-INFO')
-
-The class will pick the best version for the metadata, depending on the values
-provided. If all the values provided exist in all versions, the class will
-use :attr:`PKG_INFO_PREFERRED_VERSION`. It is set by default to 1.0, the most
-widespread version.
-
-
-Conflict checking and best version
-----------------------------------
-
-Some fields in :PEP:`345` have to comply with the version number specification
-defined in :PEP:`386`. When they don't comply, a warning is emitted::
-
- >>> from packaging.metadata import Metadata
- >>> metadata = Metadata()
- >>> metadata['Requires-Dist'] = ['Funky (Groovie)']
- "Funky (Groovie)" is not a valid predicate
- >>> metadata['Requires-Dist'] = ['Funky (1.2)']
-
-See also :mod:`packaging.version`.
-
-
-.. TODO talk about check()
-
-
-:mod:`packaging.markers` --- Environment markers
-================================================
-
-.. module:: packaging.markers
- :synopsis: Micro-language for environment markers
-
-
-This is an implementation of environment markers `as defined in PEP 345
-`_. It is used
-for some metadata fields.
-
-.. function:: interpret(marker, execution_context=None)
-
- Interpret a marker and return a boolean result depending on the environment.
- Example:
-
- >>> interpret("python_version > '1.0'")
- True
diff --git a/Doc/library/packaging.pypi.dist.rst b/Doc/library/packaging.pypi.dist.rst
deleted file mode 100644
index aaaaab7fb8..0000000000
--- a/Doc/library/packaging.pypi.dist.rst
+++ /dev/null
@@ -1,114 +0,0 @@
-:mod:`packaging.pypi.dist` --- Classes representing query results
-=================================================================
-
-.. module:: packaging.pypi.dist
- :synopsis: Classes representing the results of queries to indexes.
-
-
-Information coming from the indexes is held in instances of the classes defined
-in this module.
-
-Keep in mind that each project (eg. FooBar) can have several releases
-(eg. 1.1, 1.2, 1.3), and each of these releases can be provided in multiple
-distributions (eg. a source distribution, a binary one, etc).
-
-
-ReleaseInfo
------------
-
-Each release has a project name, version, metadata, and related distributions.
-
-This information is stored in :class:`ReleaseInfo`
-objects.
-
-.. class:: ReleaseInfo
-
-
-DistInfo
----------
-
-:class:`DistInfo` is a simple class that contains
-information related to distributions; mainly the URLs where distributions
-can be found.
-
-.. class:: DistInfo
-
-
-ReleasesList
-------------
-
-The :mod:`~packaging.pypi.dist` module provides a class which works
-with lists of :class:`ReleaseInfo` classes;
-used to filter and order results.
-
-.. class:: ReleasesList
-
-
-Example usage
--------------
-
-Build a list of releases and order them
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Assuming we have a list of releases::
-
- >>> from packaging.pypi.dist import ReleasesList, ReleaseInfo
- >>> fb10 = ReleaseInfo("FooBar", "1.0")
- >>> fb11 = ReleaseInfo("FooBar", "1.1")
- >>> fb11a = ReleaseInfo("FooBar", "1.1a1")
- >>> ReleasesList("FooBar", [fb11, fb11a, fb10])
- >>> releases.sort_releases()
- >>> releases.get_versions()
- ['1.1', '1.1a1', '1.0']
- >>> releases.add_release("1.2a1")
- >>> releases.get_versions()
- ['1.1', '1.1a1', '1.0', '1.2a1']
- >>> releases.sort_releases()
- ['1.2a1', '1.1', '1.1a1', '1.0']
- >>> releases.sort_releases(prefer_final=True)
- >>> releases.get_versions()
- ['1.1', '1.0', '1.2a1', '1.1a1']
-
-
-Add distribution related information to releases
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-It's easy to add distribution information to releases::
-
- >>> from packaging.pypi.dist import ReleasesList, ReleaseInfo
- >>> r = ReleaseInfo("FooBar", "1.0")
- >>> r.add_distribution("sdist", url="http://example.org/foobar-1.0.tar.gz")
- >>> r.dists
- {'sdist': FooBar 1.0 sdist}
- >>> r['sdist'].url
- {'url': 'http://example.org/foobar-1.0.tar.gz', 'hashname': None, 'hashval':
- None, 'is_external': True}
-
-
-Getting attributes from the dist objects
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-To abstract querying information returned from the indexes, attributes and
-release information can be retrieved directly from dist objects.
-
-For instance, if you have a release instance that does not contain the metadata
-attribute, it can be fetched by using the "fetch_metadata" method::
-
- >>> r = Release("FooBar", "1.1")
- >>> print r.metadata
- None # metadata field is actually set to "None"
- >>> r.fetch_metadata()
-
-
-.. XXX add proper roles to these constructs
-
-
-It's possible to retrieve a project's releases (`fetch_releases`),
-metadata (`fetch_metadata`) and distributions (`fetch_distributions`) using
-a similar work flow.
-
-.. XXX what is possible?
-
-Internally, this is possible because while retrieving information about
-projects, releases or distributions, a reference to the client used is
-stored which can be accessed using the objects `_index` attribute.
diff --git a/Doc/library/packaging.pypi.rst b/Doc/library/packaging.pypi.rst
deleted file mode 100644
index 14602cefc1..0000000000
--- a/Doc/library/packaging.pypi.rst
+++ /dev/null
@@ -1,74 +0,0 @@
-:mod:`packaging.pypi` --- Interface to projects indexes
-=======================================================
-
-.. module:: packaging.pypi
- :synopsis: Low-level and high-level APIs to query projects indexes.
-
-
-Packaging queries PyPI to get information about projects or download them. The
-low-level facilities used internally are also part of the public API designed to
-be used by other tools.
-
-The :mod:`packaging.pypi` package provides those facilities, which can be
-used to access information about Python projects registered at indexes, the
-main one being PyPI, located ad http://pypi.python.org/.
-
-There is two ways to retrieve data from these indexes: a screen-scraping
-interface called the "simple API", and XML-RPC. The first one uses HTML pages
-located under http://pypi.python.org/simple/, the second one makes XML-RPC
-requests to http://pypi.python.org/pypi/. All functions and classes also work
-with other indexes such as mirrors, which typically implement only the simple
-interface.
-
-Packaging provides a class that wraps both APIs to provide full query and
-download functionality: :class:`packaging.pypi.client.ClientWrapper`. If you
-want more control, you can use the underlying classes
-:class:`packaging.pypi.simple.Crawler` and :class:`packaging.pypi.xmlrpc.Client`
-to connect to one specific interface.
-
-
-:mod:`packaging.pypi.client` --- High-level query API
-=====================================================
-
-.. module:: packaging.pypi.client
- :synopsis: Wrapper around :mod;`packaging.pypi.xmlrpc` and
- :mod:`packaging.pypi.simple` to query indexes.
-
-
-This module provides a high-level API to query indexes and search
-for releases and distributions. The aim of this module is to choose the best
-way to query the API automatically, either using XML-RPC or the simple index,
-with a preference toward the latter.
-
-.. class:: ClientWrapper
-
- Instances of this class will use the simple interface or XML-RPC requests to
- query indexes and return :class:`packaging.pypi.dist.ReleaseInfo` and
- :class:`packaging.pypi.dist.ReleasesList` objects.
-
- .. method:: find_projects
-
- .. method:: get_release
-
- .. method:: get_releases
-
-
-:mod:`packaging.pypi.base` --- Base class for index crawlers
-============================================================
-
-.. module:: packaging.pypi.base
- :synopsis: Base class used to implement crawlers.
-
-
-.. class:: BaseClient(prefer_final, prefer_source)
-
- Base class containing common methods for the index crawlers or clients. One
- method is currently defined:
-
- .. method:: download_distribution(requirements, temp_path=None, \
- prefer_source=None, prefer_final=None)
-
- Download a distribution from the last release according to the
- requirements. If *temp_path* is provided, download to this path,
- otherwise, create a temporary directory for the download. If a release is
- found, the full path to the downloaded file is returned.
diff --git a/Doc/library/packaging.pypi.simple.rst b/Doc/library/packaging.pypi.simple.rst
deleted file mode 100644
index f579b18a4c..0000000000
--- a/Doc/library/packaging.pypi.simple.rst
+++ /dev/null
@@ -1,218 +0,0 @@
-:mod:`packaging.pypi.simple` --- Crawler using the PyPI "simple" interface
-==========================================================================
-
-.. module:: packaging.pypi.simple
- :synopsis: Crawler using the screen-scraping "simple" interface to fetch info
- and distributions.
-
-
-The class provided by :mod:`packaging.pypi.simple` can access project indexes
-and provide useful information about distributions. PyPI, other indexes and
-local indexes are supported.
-
-You should use this module to search distributions by name and versions, process
-index external pages and download distributions. It is not suited for things
-that will end up in too long index processing (like "finding all distributions
-with a specific version, no matter the name"); use :mod:`packaging.pypi.xmlrpc`
-for that.
-
-
-API
----
-
-.. class:: Crawler(index_url=DEFAULT_SIMPLE_INDEX_URL, \
- prefer_final=False, prefer_source=True, \
- hosts=('*',), follow_externals=False, \
- mirrors_url=None, mirrors=None, timeout=15, \
- mirrors_max_tries=0)
-
- *index_url* is the address of the index to use for requests.
-
- The first two parameters control the query results. *prefer_final*
- indicates whether a final version (not alpha, beta or candidate) is to be
- preferred over a newer but non-final version (for example, whether to pick
- up 1.0 over 2.0a3). It is used only for queries that don't give a version
- argument. Likewise, *prefer_source* tells whether to prefer a source
- distribution over a binary one, if no distribution argument was prodived.
-
- Other parameters are related to external links (that is links that go
- outside the simple index): *hosts* is a list of hosts allowed to be
- processed if *follow_externals* is true (default behavior is to follow all
- hosts), *follow_externals* enables or disables following external links
- (default is false, meaning disabled).
-
- The remaining parameters are related to the mirroring infrastructure
- defined in :PEP:`381`. *mirrors_url* gives a URL to look on for DNS
- records giving mirror adresses; *mirrors* is a list of mirror URLs (see
- the PEP). If both *mirrors* and *mirrors_url* are given, *mirrors_url*
- will only be used if *mirrors* is set to ``None``. *timeout* is the time
- (in seconds) to wait before considering a URL has timed out;
- *mirrors_max_tries"* is the number of times to try requesting informations
- on mirrors before switching.
-
- The following methods are defined:
-
- .. method:: get_distributions(project_name, version)
-
- Return the distributions found in the index for the given release.
-
- .. method:: get_metadata(project_name, version)
-
- Return the metadata found on the index for this project name and
- version. Currently downloads and unpacks a distribution to read the
- PKG-INFO file.
-
- .. method:: get_release(requirements, prefer_final=None)
-
- Return one release that fulfills the given requirements.
-
- .. method:: get_releases(requirements, prefer_final=None, force_update=False)
-
- Search for releases and return a
- :class:`~packaging.pypi.dist.ReleasesList` object containing the
- results.
-
- .. method:: search_projects(name=None)
-
- Search the index for projects containing the given name and return a
- list of matching names.
-
- See also the base class :class:`packaging.pypi.base.BaseClient` for inherited
- methods.
-
-
-.. data:: DEFAULT_SIMPLE_INDEX_URL
-
- The address used by default by the crawler class. It is currently
- ``'http://a.pypi.python.org/simple/'``, the main PyPI installation.
-
-
-
-
-Usage Examples
----------------
-
-To help you understand how using the `Crawler` class, here are some basic
-usages.
-
-Request the simple index to get a specific distribution
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Supposing you want to scan an index to get a list of distributions for
-the "foobar" project. You can use the "get_releases" method for that.
-The get_releases method will browse the project page, and return
-:class:`ReleaseInfo` objects for each found link that rely on downloads. ::
-
- >>> from packaging.pypi.simple import Crawler
- >>> crawler = Crawler()
- >>> crawler.get_releases("FooBar")
- [, ]
-
-
-Note that you also can request the client about specific versions, using version
-specifiers (described in `PEP 345
-`_)::
-
- >>> client.get_releases("FooBar < 1.2")
- [, ]
-
-
-`get_releases` returns a list of :class:`ReleaseInfo`, but you also can get the
-best distribution that fullfil your requirements, using "get_release"::
-
- >>> client.get_release("FooBar < 1.2")
-
-
-
-Download distributions
-^^^^^^^^^^^^^^^^^^^^^^
-
-As it can get the urls of distributions provided by PyPI, the `Crawler`
-client also can download the distributions and put it for you in a temporary
-destination::
-
- >>> client.download("foobar")
- /tmp/temp_dir/foobar-1.2.tar.gz
-
-
-You also can specify the directory you want to download to::
-
- >>> client.download("foobar", "/path/to/my/dir")
- /path/to/my/dir/foobar-1.2.tar.gz
-
-
-While downloading, the md5 of the archive will be checked, if not matches, it
-will try another time, then if fails again, raise `MD5HashDoesNotMatchError`.
-
-Internally, that's not the Crawler which download the distributions, but the
-`DistributionInfo` class. Please refer to this documentation for more details.
-
-
-Following PyPI external links
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-The default behavior for packaging is to *not* follow the links provided
-by HTML pages in the "simple index", to find distributions related
-downloads.
-
-It's possible to tell the PyPIClient to follow external links by setting the
-`follow_externals` attribute, on instantiation or after::
-
- >>> client = Crawler(follow_externals=True)
-
-or ::
-
- >>> client = Crawler()
- >>> client.follow_externals = True
-
-
-Working with external indexes, and mirrors
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-The default `Crawler` behavior is to rely on the Python Package index stored
-on PyPI (http://pypi.python.org/simple).
-
-As you can need to work with a local index, or private indexes, you can specify
-it using the index_url parameter::
-
- >>> client = Crawler(index_url="file://filesystem/path/")
-
-or ::
-
- >>> client = Crawler(index_url="http://some.specific.url/")
-
-
-You also can specify mirrors to fallback on in case the first index_url you
-provided doesnt respond, or not correctly. The default behavior for
-`Crawler` is to use the list provided by Python.org DNS records, as
-described in the :PEP:`381` about mirroring infrastructure.
-
-If you don't want to rely on these, you could specify the list of mirrors you
-want to try by specifying the `mirrors` attribute. It's a simple iterable::
-
- >>> mirrors = ["http://first.mirror","http://second.mirror"]
- >>> client = Crawler(mirrors=mirrors)
-
-
-Searching in the simple index
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-It's possible to search for projects with specific names in the package index.
-Assuming you want to find all projects containing the "distutils" keyword::
-
- >>> c.search_projects("distutils")
- [, , , , , , ]
-
-
-You can also search the projects starting with a specific text, or ending with
-that text, using a wildcard::
-
- >>> c.search_projects("distutils*")
- [, , ]
-
- >>> c.search_projects("*distutils")
- [, , , , ]
diff --git a/Doc/library/packaging.pypi.xmlrpc.rst b/Doc/library/packaging.pypi.xmlrpc.rst
deleted file mode 100644
index 5242e4c530..0000000000
--- a/Doc/library/packaging.pypi.xmlrpc.rst
+++ /dev/null
@@ -1,143 +0,0 @@
-:mod:`packaging.pypi.xmlrpc` --- Crawler using the PyPI XML-RPC interface
-=========================================================================
-
-.. module:: packaging.pypi.xmlrpc
- :synopsis: Client using XML-RPC requests to fetch info and distributions.
-
-
-Indexes can be queried using XML-RPC calls, and Packaging provides a simple
-way to interface with XML-RPC.
-
-You should **use** XML-RPC when:
-
-* Searching the index for projects **on other fields than project
- names**. For instance, you can search for projects based on the
- author_email field.
-* Searching all the versions that have existed for a project.
-* you want to retrieve METADATAs information from releases or
- distributions.
-
-
-You should **avoid using** XML-RPC method calls when:
-
-* Retrieving the last version of a project
-* Getting the projects with a specific name and version.
-* The simple index can match your needs
-
-
-When dealing with indexes, keep in mind that the index queries will always
-return you :class:`packaging.pypi.dist.ReleaseInfo` and
-:class:`packaging.pypi.dist.ReleasesList` objects.
-
-Some methods here share common APIs with the one you can find on
-:class:`packaging.pypi.simple`, internally, :class:`packaging.pypi.client`
-is inherited by :class:`Client`
-
-
-API
----
-
-.. class:: Client
-
-
-Usage examples
---------------
-
-Use case described here are use case that are not common to the other clients.
-If you want to see all the methods, please refer to API or to usage examples
-described in :class:`packaging.pypi.client.Client`
-
-
-Finding releases
-^^^^^^^^^^^^^^^^
-
-It's a common use case to search for "things" within the index. We can
-basically search for projects by their name, which is the most used way for
-users (eg. "give me the last version of the FooBar project").
-
-This can be accomplished using the following syntax::
-
- >>> client = xmlrpc.Client()
- >>> client.get_release("Foobar (<= 1.3))
-
- >>> client.get_releases("FooBar (<= 1.3)")
- [FooBar 1.1, FooBar 1.1.1, FooBar 1.2, FooBar 1.2.1]
-
-
-And we also can find for specific fields::
-
- >>> client.search_projects(field=value)
-
-
-You could specify the operator to use, default is "or"::
-
- >>> client.search_projects(field=value, operator="and")
-
-
-The specific fields you can search are:
-
-* name
-* version
-* author
-* author_email
-* maintainer
-* maintainer_email
-* home_page
-* license
-* summary
-* description
-* keywords
-* platform
-* download_url
-
-
-Getting metadata information
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-XML-RPC is a preferred way to retrieve metadata information from indexes.
-It's really simple to do so::
-
- >>> client = xmlrpc.Client()
- >>> client.get_metadata("FooBar", "1.1")
-
-
-
-Assuming we already have a :class:`packaging.pypi.ReleaseInfo` object defined,
-it's possible to pass it to the xmlrpc client to retrieve and complete its
-metadata::
-
- >>> foobar11 = ReleaseInfo("FooBar", "1.1")
- >>> client = xmlrpc.Client()
- >>> returned_release = client.get_metadata(release=foobar11)
- >>> returned_release
-
-
-
-Get all the releases of a project
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-To retrieve all the releases for a project, you can build them using
-`get_releases`::
-
- >>> client = xmlrpc.Client()
- >>> client.get_releases("FooBar")
- [, , ]
-
-
-Get information about distributions
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Indexes have information about projects, releases **and** distributions.
-If you're not familiar with those, please refer to the documentation of
-:mod:`packaging.pypi.dist`.
-
-It's possible to retrieve information about distributions, e.g "what are the
-existing distributions for this release ? How to retrieve them ?"::
-
- >>> client = xmlrpc.Client()
- >>> release = client.get_distributions("FooBar", "1.1")
- >>> release.dists
- {'sdist': , 'bdist': }
-
-As you see, this does not return a list of distributions, but a release,
-because a release can be used like a list of distributions.
diff --git a/Doc/library/packaging.rst b/Doc/library/packaging.rst
deleted file mode 100644
index c6bff47015..0000000000
--- a/Doc/library/packaging.rst
+++ /dev/null
@@ -1,75 +0,0 @@
-:mod:`packaging` --- Packaging support
-======================================
-
-.. module:: packaging
- :synopsis: Packaging system and building blocks for other packaging systems.
-.. sectionauthor:: Fred L. Drake, Jr. , distutils and packaging
- contributors
-
-
-The :mod:`packaging` package provides support for building, packaging,
-distributing and installing additional projects into a Python installation.
-Projects may include Python modules, extension modules, packages and scripts.
-:mod:`packaging` also provides building blocks for other packaging systems
-that are not tied to the command system.
-
-This manual is the reference documentation for those standalone building
-blocks and for extending Packaging. If you're looking for the user-centric
-guides to install a project or package your own code, head to `See also`__.
-
-
-Building blocks
----------------
-
-.. toctree::
- :maxdepth: 2
-
- packaging-misc
- packaging.version
- packaging.metadata
- packaging.database
- packaging.depgraph
- packaging.pypi
- packaging.pypi.dist
- packaging.pypi.simple
- packaging.pypi.xmlrpc
- packaging.install
-
-
-The command machinery
----------------------
-
-.. toctree::
- :maxdepth: 2
-
- packaging.dist
- packaging.command
- packaging.compiler
- packaging.fancy_getopt
-
-
-Other utilities
-----------------
-
-.. toctree::
- :maxdepth: 2
-
- packaging.util
- packaging.tests.pypi_server
-
-.. XXX missing: compat config create (dir_util) run pypi.{base,mirrors}
-
-
-.. __:
-
-.. seealso::
-
- :ref:`packaging-index`
- The manual for developers of Python projects who want to package and
- distribute them. This describes how to use :mod:`packaging` to make
- projects easily found and added to an existing Python installation.
-
- :ref:`packaging-install-index`
- A user-centered manual which includes information on adding projects
- into an existing Python installation. You do not need to be a Python
- programmer to read this manual.
diff --git a/Doc/library/packaging.tests.pypi_server.rst b/Doc/library/packaging.tests.pypi_server.rst
deleted file mode 100644
index f3b77203f4..0000000000
--- a/Doc/library/packaging.tests.pypi_server.rst
+++ /dev/null
@@ -1,105 +0,0 @@
-:mod:`packaging.tests.pypi_server` --- PyPI mock server
-=======================================================
-
-.. module:: packaging.tests.pypi_server
- :synopsis: Mock server used to test PyPI-related modules and commands.
-
-
-When you are testing code that works with Packaging, you might find these tools
-useful.
-
-
-The mock server
----------------
-
-.. class:: PyPIServer
-
- PyPIServer is a class that implements an HTTP server running in a separate
- thread. All it does is record the requests for further inspection. The recorded
- data is available under ``requests`` attribute. The default
- HTTP response can be overridden with the ``default_response_status``,
- ``default_response_headers`` and ``default_response_data`` attributes.
-
- By default, when accessing the server with urls beginning with `/simple/`,
- the server also record your requests, but will look for files under
- the `/tests/pypiserver/simple/` path.
-
- You can tell the sever to serve static files for other paths. This could be
- accomplished by using the `static_uri_paths` parameter, as below::
-
- server = PyPIServer(static_uri_paths=["first_path", "second_path"])
-
-
- You need to create the content that will be served under the
- `/tests/pypiserver/default` path. If you want to serve content from another
- place, you also can specify another filesystem path (which needs to be under
- `tests/pypiserver/`. This will replace the default behavior of the server, and
- it will not serve content from the `default` dir ::
-
- server = PyPIServer(static_filesystem_paths=["path/to/your/dir"])
-
-
- If you just need to add some paths to the existing ones, you can do as shown,
- keeping in mind that the server will always try to load paths in reverse order
- (e.g here, try "another/super/path" then the default one) ::
-
- server = PyPIServer(test_static_path="another/super/path")
- server = PyPIServer("another/super/path")
- # or
- server.static_filesystem_paths.append("another/super/path")
-
-
- As a result of what, in your tests, while you need to use the PyPIServer, in
- order to isolates the test cases, the best practice is to place the common files
- in the `default` folder, and to create a directory for each specific test case::
-
- server = PyPIServer(static_filesystem_paths = ["default", "test_pypi_server"],
- static_uri_paths=["simple", "external"])
-
-
-Base class and decorator for tests
-----------------------------------
-
-.. class:: PyPIServerTestCase
-
- ``PyPIServerTestCase`` is a test case class with setUp and tearDown methods that
- take care of a single PyPIServer instance attached as a ``pypi`` attribute on
- the test class. Use it as one of the base classes in your test case::
-
-
- class UploadTestCase(PyPIServerTestCase):
-
- def test_something(self):
- cmd = self.prepare_command()
- cmd.ensure_finalized()
- cmd.repository = self.pypi.full_address
- cmd.run()
-
- environ, request_data = self.pypi.requests[-1]
- self.assertEqual(request_data, EXPECTED_REQUEST_DATA)
-
-
-.. decorator:: use_pypi_server
-
- You also can use a decorator for your tests, if you do not need the same server
- instance along all you test case. So, you can specify, for each test method,
- some initialisation parameters for the server.
-
- For this, you need to add a `server` parameter to your method, like this::
-
- class SampleTestCase(TestCase):
-
- @use_pypi_server()
- def test_something(self, server):
- ...
-
-
- The decorator will instantiate the server for you, and run and stop it just
- before and after your method call. You also can pass the server initializer,
- just like this::
-
- class SampleTestCase(TestCase):
-
- @use_pypi_server("test_case_name")
- def test_something(self, server):
- ...
diff --git a/Doc/library/packaging.util.rst b/Doc/library/packaging.util.rst
deleted file mode 100644
index e628c32c6a..0000000000
--- a/Doc/library/packaging.util.rst
+++ /dev/null
@@ -1,155 +0,0 @@
-:mod:`packaging.util` --- Miscellaneous utility functions
-=========================================================
-
-.. module:: packaging.util
- :synopsis: Miscellaneous utility functions.
-
-
-This module contains various helpers for the other modules.
-
-.. XXX a number of functions are missing, but the module may be split first
- (it's ginormous right now, some things could go to compat for example)
-
-.. function:: get_platform()
-
- Return a string that identifies the current platform. This is used mainly to
- distinguish platform-specific build directories and platform-specific built
- distributions. Typically includes the OS name and version and the
- architecture (as supplied by 'os.uname()'), although the exact information
- included depends on the OS; e.g. for IRIX the architecture isn't particularly
- important (IRIX only runs on SGI hardware), but for Linux the kernel version
- isn't particularly important.
-
- Examples of returned values:
-
- * ``linux-i586``
- * ``linux-alpha``
- * ``solaris-2.6-sun4u``
- * ``irix-5.3``
- * ``irix64-6.2``
-
- For non-POSIX platforms, currently just returns ``sys.platform``.
-
- For Mac OS X systems the OS version reflects the minimal version on which
- binaries will run (that is, the value of ``MACOSX_DEPLOYMENT_TARGET``
- during the build of Python), not the OS version of the current system.
-
- For universal binary builds on Mac OS X the architecture value reflects
- the univeral binary status instead of the architecture of the current
- processor. For 32-bit universal binaries the architecture is ``fat``,
- for 64-bit universal binaries the architecture is ``fat64``, and
- for 4-way universal binaries the architecture is ``universal``. Starting
- from Python 2.7 and Python 3.2 the architecture ``fat3`` is used for
- a 3-way universal build (ppc, i386, x86_64) and ``intel`` is used for
- a univeral build with the i386 and x86_64 architectures
-
- Examples of returned values on Mac OS X:
-
- * ``macosx-10.3-ppc``
-
- * ``macosx-10.3-fat``
-
- * ``macosx-10.5-universal``
-
- * ``macosx-10.6-intel``
-
- .. XXX reinvention of platform module?
-
-
-.. function:: convert_path(pathname)
-
- Return 'pathname' as a name that will work on the native filesystem, i.e.
- split it on '/' and put it back together again using the current directory
- separator. Needed because filenames in the setup script are always supplied
- in Unix style, and have to be converted to the local convention before we
- can actually use them in the filesystem. Raises :exc:`ValueError` on
- non-Unix-ish systems if *pathname* either starts or ends with a slash.
-
-
-.. function:: change_root(new_root, pathname)
-
- Return *pathname* with *new_root* prepended. If *pathname* is relative, this
- is equivalent to ``os.path.join(new_root,pathname)`` Otherwise, it requires
- making *pathname* relative and then joining the two, which is tricky on
- DOS/Windows.
-
-
-.. function:: check_environ()
-
- Ensure that 'os.environ' has all the environment variables we guarantee that
- users can use in config files, command-line options, etc. Currently this
- includes:
-
- * :envvar:`HOME` - user's home directory (Unix only)
- * :envvar:`PLAT` - description of the current platform, including hardware
- and OS (see :func:`get_platform`)
-
-
-.. function:: find_executable(executable, path=None)
-
- Search the path for a given executable name.
-
-
-.. function:: execute(func, args, msg=None, dry_run=False)
-
- Perform some action that affects the outside world (for instance, writing to
- the filesystem). Such actions are special because they are disabled by the
- *dry_run* flag. This method takes care of all that bureaucracy for you;
- all you have to do is supply the function to call and an argument tuple for
- it (to embody the "external action" being performed), and an optional message
- to print.
-
-
-.. function:: newer(source, target)
-
- Return true if *source* exists and is more recently modified than *target*,
- or if *source* exists and *target* doesn't. Return false if both exist and
- *target* is the same age or newer than *source*. Raise
- :exc:`PackagingFileError` if *source* does not exist.
-
-
-.. function:: strtobool(val)
-
- Convert a string representation of truth to true (1) or false (0).
-
- True values are ``y``, ``yes``, ``t``, ``true``, ``on`` and ``1``; false
- values are ``n``, ``no``, ``f``, ``false``, ``off`` and ``0``. Raises
- :exc:`ValueError` if *val* is anything else.
-
-
-.. function:: byte_compile(py_files, optimize=0, force=0, prefix=None, \
- base_dir=None, dry_run=0, direct=None)
-
- Byte-compile a collection of Python source files to either :file:`.pyc` or
- :file:`.pyo` files in a :file:`__pycache__` subdirectory (see :pep:`3147`),
- or to the same directory when using the distutils2 backport on Python
- versions older than 3.2.
-
- *py_files* is a list of files to compile; any files that don't end in
- :file:`.py` are silently skipped. *optimize* must be one of the following:
-
- * ``0`` - don't optimize (generate :file:`.pyc`)
- * ``1`` - normal optimization (like ``python -O``)
- * ``2`` - extra optimization (like ``python -OO``)
-
- This function is independent from the running Python's :option:`-O` or
- :option:`-B` options; it is fully controlled by the parameters passed in.
-
- If *force* is true, all files are recompiled regardless of timestamps.
-
- The source filename encoded in each :term:`bytecode` file defaults to the filenames
- listed in *py_files*; you can modify these with *prefix* and *basedir*.
- *prefix* is a string that will be stripped off of each source filename, and
- *base_dir* is a directory name that will be prepended (after *prefix* is
- stripped). You can supply either or both (or neither) of *prefix* and
- *base_dir*, as you wish.
-
- If *dry_run* is true, doesn't actually do anything that would affect the
- filesystem.
-
- Byte-compilation is either done directly in this interpreter process with the
- standard :mod:`py_compile` module, or indirectly by writing a temporary
- script and executing it. Normally, you should let :func:`byte_compile`
- figure out to use direct compilation or not (see the source for details).
- The *direct* flag is used by the script generated in indirect mode; unless
- you know what you're doing, leave it set to ``None``.
diff --git a/Doc/library/packaging.version.rst b/Doc/library/packaging.version.rst
deleted file mode 100644
index f36cdaba10..0000000000
--- a/Doc/library/packaging.version.rst
+++ /dev/null
@@ -1,104 +0,0 @@
-:mod:`packaging.version` --- Version number classes
-===================================================
-
-.. module:: packaging.version
- :synopsis: Classes that represent project version numbers.
-
-
-This module contains classes and functions useful to deal with version numbers.
-It's an implementation of version specifiers `as defined in PEP 345
-`_.
-
-
-Version numbers
----------------
-
-.. class:: NormalizedVersion(self, s, error_on_huge_major_num=True)
-
- A specific version of a distribution, as described in PEP 345. *s* is a
- string object containing the version number (for example ``'1.2b1'``),
- *error_on_huge_major_num* a boolean specifying whether to consider an
- apparent use of a year or full date as the major version number an error.
-
- The rationale for the second argument is that there were projects using years
- or full dates as version numbers, which could cause problems with some
- packaging systems sorting.
-
- Instances of this class can be compared and sorted::
-
- >>> NormalizedVersion('1.2b1') < NormalizedVersion('1.2')
- True
-
- :class:`NormalizedVersion` is used internally by :class:`VersionPredicate` to
- do its work.
-
-
-.. class:: IrrationalVersionError
-
- Exception raised when an invalid string is given to
- :class:`NormalizedVersion`.
-
- >>> NormalizedVersion("irrational_version_number")
- ...
- IrrationalVersionError: irrational_version_number
-
-
-.. function:: suggest_normalized_version(s)
-
- Before standardization in PEP 386, various schemes were in use. Packaging
- provides a function to try to convert any string to a valid, normalized
- version::
-
- >>> suggest_normalized_version('2.1-rc1')
- 2.1c1
-
-
- If :func:`suggest_normalized_version` can't make sense of the given string,
- it will return ``None``::
-
- >>> print(suggest_normalized_version('not a version'))
- None
-
-
-Version predicates
-------------------
-
-.. class:: VersionPredicate(predicate)
-
- This class deals with the parsing of field values like
- ``ProjectName (>=version)``.
-
- .. method:: match(version)
-
- Test if a version number matches the predicate:
-
- >>> version = VersionPredicate("ProjectName (<1.2, >1.0)")
- >>> version.match("1.2.1")
- False
- >>> version.match("1.1.1")
- True
-
-
-Validation helpers
-------------------
-
-If you want to use :term:`LBYL`-style checks instead of instantiating the
-classes and catching :class:`IrrationalVersionError` and :class:`ValueError`,
-you can use these functions:
-
-.. function:: is_valid_version(predicate)
-
- Check whether the given string is a valid version number. Example of valid
- strings: ``'1.2'``, ``'4.2.0.dev4'``, ``'2.5.4.post2'``.
-
-
-.. function:: is_valid_versions(predicate)
-
- Check whether the given string is a valid value for specifying multiple
- versions, such as in the Requires-Python field. Example: ``'2.7, >=3.2'``.
-
-
-.. function:: is_valid_predicate(predicate)
-
- Check whether the given string is a valid version predicate. Examples:
- ``'some.project == 4.5, <= 4.7'``, ``'speciallib (> 1.0, != 1.4.2, < 2.0)'``.
diff --git a/Doc/library/python.rst b/Doc/library/python.rst
index 07eadb4faa..b67fbfc281 100644
--- a/Doc/library/python.rst
+++ b/Doc/library/python.rst
@@ -25,5 +25,4 @@ overview:
inspect.rst
site.rst
fpectl.rst
- packaging.rst
distutils.rst
diff --git a/Doc/library/site.rst b/Doc/library/site.rst
index b9878973c7..071706a428 100644
--- a/Doc/library/site.rst
+++ b/Doc/library/site.rst
@@ -134,9 +134,9 @@ empty, and the path manipulations are skipped; however the import of
:func:`getuserbase` hasn't been called yet. Default value is
:file:`~/.local` for UNIX and Mac OS X non-framework builds,
:file:`~/Library/Python/{X.Y}` for Mac framework builds, and
- :file:`{%APPDATA%}\\Python` for Windows. This value is used by Packaging to
+ :file:`{%APPDATA%}\\Python` for Windows. This value is used by Distutils to
compute the installation directories for scripts, data files, Python modules,
- etc. for the :ref:`user installation scheme `.
+ etc. for the :ref:`user installation scheme `.
See also :envvar:`PYTHONUSERBASE`.
diff --git a/Doc/library/venv.rst b/Doc/library/venv.rst
index 035e8d6587..5c1e9ad2f6 100644
--- a/Doc/library/venv.rst
+++ b/Doc/library/venv.rst
@@ -35,8 +35,7 @@ directories that don't exist already) and places a ``pyvenv.cfg`` file
in it with a ``home`` key pointing to the Python installation the
command was run from. It also creates a ``bin`` (or ``Scripts`` on
Windows) subdirectory containing a copy of the ``python`` binary (or
-binaries, in the case of Windows) and the ``pysetup3`` script (to
-facilitate easy installation of packages from PyPI into the new virtualenv).
+binaries, in the case of Windows).
It also creates an (initially empty) ``lib/pythonX.Y/site-packages``
subdirectory (on Windows, this is ``Lib\site-packages``).
diff --git a/Doc/packaging/builtdist.rst b/Doc/packaging/builtdist.rst
deleted file mode 100644
index 1d9a3498a7..0000000000
--- a/Doc/packaging/builtdist.rst
+++ /dev/null
@@ -1,302 +0,0 @@
-.. _packaging-built-dist:
-
-****************************
-Creating Built Distributions
-****************************
-
-A "built distribution" is what you're probably used to thinking of either as a
-"binary package" or an "installer" (depending on your background). It's not
-necessarily binary, though, because it might contain only Python source code
-and/or byte-code; and we don't call it a package, because that word is already
-spoken for in Python. (And "installer" is a term specific to the world of
-mainstream desktop systems.)
-
-A built distribution is how you make life as easy as possible for installers of
-your module distribution: for users of RPM-based Linux systems, it's a binary
-RPM; for Windows users, it's an executable installer; for Debian-based Linux
-users, it's a Debian package; and so forth. Obviously, no one person will be
-able to create built distributions for every platform under the sun, so the
-Distutils are designed to enable module developers to concentrate on their
-specialty---writing code and creating source distributions---while an
-intermediary species called *packagers* springs up to turn source distributions
-into built distributions for as many platforms as there are packagers.
-
-Of course, the module developer could be his own packager; or the packager could
-be a volunteer "out there" somewhere who has access to a platform which the
-original developer does not; or it could be software periodically grabbing new
-source distributions and turning them into built distributions for as many
-platforms as the software has access to. Regardless of who they are, a packager
-uses the setup script and the :command:`bdist` command family to generate built
-distributions.
-
-As a simple example, if I run the following command in the Distutils source
-tree::
-
- python setup.py bdist
-
-then the Distutils builds my module distribution (the Distutils itself in this
-case), does a "fake" installation (also in the :file:`build` directory), and
-creates the default type of built distribution for my platform. The default
-format for built distributions is a "dumb" tar file on Unix, and a simple
-executable installer on Windows. (That tar file is considered "dumb" because it
-has to be unpacked in a specific location to work.)
-
-Thus, the above command on a Unix system creates
-:file:`Distutils-1.0.{plat}.tar.gz`; unpacking this tarball from the right place
-installs the Distutils just as though you had downloaded the source distribution
-and run ``python setup.py install``. (The "right place" is either the root of
-the filesystem or Python's :file:`{prefix}` directory, depending on the options
-given to the :command:`bdist_dumb` command; the default is to make dumb
-distributions relative to :file:`{prefix}`.)
-
-Obviously, for pure Python distributions, this isn't any simpler than just
-running ``python setup.py install``\ ---but for non-pure distributions, which
-include extensions that would need to be compiled, it can mean the difference
-between someone being able to use your extensions or not. And creating "smart"
-built distributions, such as an executable installer for
-Windows, is far more convenient for users even if your distribution doesn't
-include any extensions.
-
-The :command:`bdist` command has a :option:`--formats` option, similar to the
-:command:`sdist` command, which you can use to select the types of built
-distribution to generate: for example, ::
-
- python setup.py bdist --format=zip
-
-would, when run on a Unix system, create :file:`Distutils-1.0.{plat}.zip`\
----again, this archive would be unpacked from the root directory to install the
-Distutils.
-
-The available formats for built distributions are:
-
-+-------------+------------------------------+---------+
-| Format | Description | Notes |
-+=============+==============================+=========+
-| ``gztar`` | gzipped tar file | (1),(3) |
-| | (:file:`.tar.gz`) | |
-+-------------+------------------------------+---------+
-| ``tar`` | tar file (:file:`.tar`) | \(3) |
-+-------------+------------------------------+---------+
-| ``zip`` | zip file (:file:`.zip`) | (2),(4) |
-+-------------+------------------------------+---------+
-| ``wininst`` | self-extracting ZIP file for | \(4) |
-| | Windows | |
-+-------------+------------------------------+---------+
-| ``msi`` | Microsoft Installer. | |
-+-------------+------------------------------+---------+
-
-
-Notes:
-
-(1)
- default on Unix
-
-(2)
- default on Windows
-
-(3)
- requires external utilities: :program:`tar` and possibly one of :program:`gzip`
- or :program:`bzip2`
-
-(4)
- requires either external :program:`zip` utility or :mod:`zipfile` module (part
- of the standard Python library since Python 1.6)
-
-You don't have to use the :command:`bdist` command with the :option:`--formats`
-option; you can also use the command that directly implements the format you're
-interested in. Some of these :command:`bdist` "sub-commands" actually generate
-several similar formats; for instance, the :command:`bdist_dumb` command
-generates all the "dumb" archive formats (``tar``, ``gztar``, and
-``zip``). The :command:`bdist` sub-commands, and the formats generated by
-each, are:
-
-+--------------------------+-----------------------+
-| Command | Formats |
-+==========================+=======================+
-| :command:`bdist_dumb` | tar, gztar, zip |
-+--------------------------+-----------------------+
-| :command:`bdist_wininst` | wininst |
-+--------------------------+-----------------------+
-| :command:`bdist_msi` | msi |
-+--------------------------+-----------------------+
-
-The following sections give details on the individual :command:`bdist_\*`
-commands.
-
-
-.. _packaging-creating-dumb:
-
-Creating dumb built distributions
-=================================
-
-.. XXX Need to document absolute vs. prefix-relative packages here, but first
- I have to implement it!
-
-
-.. _packaging-creating-wininst:
-
-Creating Windows Installers
-===========================
-
-Executable installers are the natural format for binary distributions on
-Windows. They display a nice graphical user interface, display some information
-about the module distribution to be installed taken from the metadata in the
-setup script, let the user select a few options, and start or cancel the
-installation.
-
-Since the metadata is taken from the setup script, creating Windows installers
-is usually as easy as running::
-
- python setup.py bdist_wininst
-
-or the :command:`bdist` command with the :option:`--formats` option::
-
- python setup.py bdist --formats=wininst
-
-If you have a pure module distribution (only containing pure Python modules and
-packages), the resulting installer will be version independent and have a name
-like :file:`foo-1.0.win32.exe`. These installers can even be created on Unix
-platforms or Mac OS X.
-
-If you have a non-pure distribution, the extensions can only be created on a
-Windows platform, and will be Python version dependent. The installer filename
-will reflect this and now has the form :file:`foo-1.0.win32-py2.0.exe`. You
-have to create a separate installer for every Python version you want to
-support.
-
-The installer will try to compile pure modules into :term:`bytecode` after installation
-on the target system in normal and optimizing mode. If you don't want this to
-happen for some reason, you can run the :command:`bdist_wininst` command with
-the :option:`--no-target-compile` and/or the :option:`--no-target-optimize`
-option.
-
-By default the installer will display the cool "Python Powered" logo when it is
-run, but you can also supply your own 152x261 bitmap which must be a Windows
-:file:`.bmp` file with the :option:`--bitmap` option.
-
-The installer will also display a large title on the desktop background window
-when it is run, which is constructed from the name of your distribution and the
-version number. This can be changed to another text by using the
-:option:`--title` option.
-
-The installer file will be written to the "distribution directory" --- normally
-:file:`dist/`, but customizable with the :option:`--dist-dir` option.
-
-.. _packaging-cross-compile-windows:
-
-Cross-compiling on Windows
-==========================
-
-Starting with Python 2.6, packaging is capable of cross-compiling between
-Windows platforms. In practice, this means that with the correct tools
-installed, you can use a 32bit version of Windows to create 64bit extensions
-and vice-versa.
-
-To build for an alternate platform, specify the :option:`--plat-name` option
-to the build command. Valid values are currently 'win32', 'win-amd64' and
-'win-ia64'. For example, on a 32bit version of Windows, you could execute::
-
- python setup.py build --plat-name=win-amd64
-
-to build a 64bit version of your extension. The Windows Installers also
-support this option, so the command::
-
- python setup.py build --plat-name=win-amd64 bdist_wininst
-
-would create a 64bit installation executable on your 32bit version of Windows.
-
-To cross-compile, you must download the Python source code and cross-compile
-Python itself for the platform you are targetting - it is not possible from a
-binary installtion of Python (as the .lib etc file for other platforms are
-not included.) In practice, this means the user of a 32 bit operating
-system will need to use Visual Studio 2008 to open the
-:file:`PCBuild/PCbuild.sln` solution in the Python source tree and build the
-"x64" configuration of the 'pythoncore' project before cross-compiling
-extensions is possible.
-
-Note that by default, Visual Studio 2008 does not install 64bit compilers or
-tools. You may need to reexecute the Visual Studio setup process and select
-these tools (using Control Panel->[Add/Remove] Programs is a convenient way to
-check or modify your existing install.)
-
-.. _packaging-postinstallation-script:
-
-The Postinstallation script
----------------------------
-
-Starting with Python 2.3, a postinstallation script can be specified with the
-:option:`--install-script` option. The basename of the script must be
-specified, and the script filename must also be listed in the scripts argument
-to the setup function.
-
-This script will be run at installation time on the target system after all the
-files have been copied, with ``argv[1]`` set to :option:`-install`, and again at
-uninstallation time before the files are removed with ``argv[1]`` set to
-:option:`-remove`.
-
-The installation script runs embedded in the windows installer, every output
-(``sys.stdout``, ``sys.stderr``) is redirected into a buffer and will be
-displayed in the GUI after the script has finished.
-
-Some functions especially useful in this context are available as additional
-built-in functions in the installation script.
-
-.. currentmodule:: bdist_wininst-postinst-script
-
-.. function:: directory_created(path)
- file_created(path)
-
- These functions should be called when a directory or file is created by the
- postinstall script at installation time. It will register *path* with the
- uninstaller, so that it will be removed when the distribution is uninstalled.
- To be safe, directories are only removed if they are empty.
-
-
-.. function:: get_special_folder_path(csidl_string)
-
- This function can be used to retrieve special folder locations on Windows like
- the Start Menu or the Desktop. It returns the full path to the folder.
- *csidl_string* must be one of the following strings::
-
- "CSIDL_APPDATA"
-
- "CSIDL_COMMON_STARTMENU"
- "CSIDL_STARTMENU"
-
- "CSIDL_COMMON_DESKTOPDIRECTORY"
- "CSIDL_DESKTOPDIRECTORY"
-
- "CSIDL_COMMON_STARTUP"
- "CSIDL_STARTUP"
-
- "CSIDL_COMMON_PROGRAMS"
- "CSIDL_PROGRAMS"
-
- "CSIDL_FONTS"
-
- If the folder cannot be retrieved, :exc:`OSError` is raised.
-
- Which folders are available depends on the exact Windows version, and probably
- also the configuration. For details refer to Microsoft's documentation of the
- :c:func:`SHGetSpecialFolderPath` function.
-
-
-.. function:: create_shortcut(target, description, filename[, arguments[, workdir[, iconpath[, iconindex]]]])
-
- This function creates a shortcut. *target* is the path to the program to be
- started by the shortcut. *description* is the description of the shortcut.
- *filename* is the title of the shortcut that the user will see. *arguments*
- specifies the command-line arguments, if any. *workdir* is the working directory
- for the program. *iconpath* is the file containing the icon for the shortcut,
- and *iconindex* is the index of the icon in the file *iconpath*. Again, for
- details consult the Microsoft documentation for the :class:`IShellLink`
- interface.
-
-
-Vista User Access Control (UAC)
-===============================
-
-Starting with Python 2.6, bdist_wininst supports a :option:`--user-access-control`
-option. The default is 'none' (meaning no UAC handling is done), and other
-valid values are 'auto' (meaning prompt for UAC elevation if Python was
-installed for all users) and 'force' (meaning always prompt for elevation).
diff --git a/Doc/packaging/commandhooks.rst b/Doc/packaging/commandhooks.rst
deleted file mode 100644
index b261d00270..0000000000
--- a/Doc/packaging/commandhooks.rst
+++ /dev/null
@@ -1,47 +0,0 @@
-.. TODO integrate this in commandref and configfile
-
-.. _packaging-command-hooks:
-
-=============
-Command hooks
-=============
-
-Packaging provides a way of extending its commands by the use of pre- and
-post-command hooks. Hooks are Python functions (or any callable object) that
-take a command object as argument. They're specified in :ref:`config files
-` using their fully qualified names. After a
-command is finalized (its options are processed), the pre-command hooks are
-executed, then the command itself is run, and finally the post-command hooks are
-executed.
-
-See also global setup hooks in :ref:`setupcfg-spec`.
-
-
-.. _packaging-finding-hooks:
-
-Finding hooks
-=============
-
-As a hook is configured with a Python dotted name, it must either be defined in
-a module installed on the system, or in a module present in the project
-directory, where the :file:`setup.cfg` file lives::
-
- # file: _setuphooks.py
-
- def hook(install_cmd):
- metadata = install_cmd.dist.metadata
- print('Hooked while installing %r %s!' % (metadata['Name'],
- metadata['Version']))
-
-Then you need to configure it in :file:`setup.cfg`::
-
- [install_dist]
- pre-hook.a = _setuphooks.hook
-
-Packaging will add the project directory to :data:`sys.path` and find the
-``_setuphooks`` module.
-
-Hooks defined in different config files (system-wide, user-wide and
-project-wide) do not override each other as long as they are specified with
-different aliases (additional names after the dot). The alias in the example
-above is ``a``.
diff --git a/Doc/packaging/commandref.rst b/Doc/packaging/commandref.rst
deleted file mode 100644
index 2165b56fd4..0000000000
--- a/Doc/packaging/commandref.rst
+++ /dev/null
@@ -1,374 +0,0 @@
-.. _packaging-command-reference:
-
-*****************
-Command Reference
-*****************
-
-This reference briefly documents all standard Packaging commands and some of
-their options.
-
-.. FIXME does not work: Use pysetup run --help-commands to list all
- standard and extra commands availavble on your system, with their
- description. Use pysetup run --help to get help about the options
- of one command.
-
-.. XXX sections from this document should be merged with other docs (e.g. check
- and upload with uploading.rst, install_* with install/install.rst, etc.);
- there is no value in partially duplicating information. this file could
- however serve as an index, i.e. just a list of all commands with links to
- every section that describes options or usage
-
-
-Preparing distributions
-=======================
-
-:command:`check`
-----------------
-
-Perform some tests on the metadata of a distribution.
-
-For example, it verifies that all required metadata fields are provided in the
-:file:`setup.cfg` file.
-
-.. TODO document reST checks
-
-
-:command:`test`
----------------
-
-Run a test suite.
-
-When doing test-driven development, or running automated builds that need
-testing before they are installed for downloading or use, it's often useful to
-be able to run a project's unit tests without actually installing the project
-anywhere. The :command:`test` command runs project's unit tests without
-actually installing it, by temporarily putting the project's source on
-:data:`sys.path`, after first running :command:`build_ext -i` to ensure that any
-C extensions are built.
-
-You can use this command in one of two ways: either by specifying a
-unittest-compatible test suite for your project (or any callable that returns
-it) or by passing a test runner function that will run your tests and display
-results in the console. Both options take a Python dotted name in the form
-``package.module.callable`` to specify the object to use.
-
-If none of these options are specified, Packaging will try to perform test
-discovery using either unittest (for Python 3.2 and higher) or unittest2 (for
-older versions, if installed).
-
-.. this is a pseudo-command name used to disambiguate the options in indexes and
- links
-.. program:: packaging test
-
-.. cmdoption:: --suite=NAME, -s NAME
-
- Specify the test suite (or module, class, or method) to be run. The default
- for this option can be set by in the project's :file:`setup.cfg` file:
-
- .. code-block:: cfg
-
- [test]
- suite = mypackage.tests.get_all_tests
-
-.. cmdoption:: --runner=NAME, -r NAME
-
- Specify the test runner to be called.
-
-
-:command:`config`
------------------
-
-Perform distribution configuration.
-
-
-The build step
-==============
-
-This step is mainly useful to compile C/C++ libraries or extension modules. The
-build commands can be run manually to check for syntax errors or packaging
-issues (for example if the addition of a new source file was forgotten in the
-:file:`setup.cfg` file), and is also run automatically by commands which need
-it. Packaging checks the mtime of source and built files to avoid re-building
-if it's not necessary.
-
-
-:command:`build`
-----------------
-
-Build all files of a distribution, delegating to the other :command:`build_*`
-commands to do the work.
-
-
-:command:`build_clib`
----------------------
-
-Build C libraries.
-
-
-:command:`build_ext`
---------------------
-
-Build C/C++ extension modules.
-
-
-:command:`build_py`
--------------------
-
-Build the Python modules (just copy them to the build directory) and
-:term:`byte-compile ` them to :file:`.pyc` and/or :file:`.pyo` files.
-
-The byte compilation is controlled by two sets of options:
-
-- ``--compile`` and ``--no-compile`` are used to control the creation of
- :file:`.pyc` files; the default is ``--no-compile``.
-
-- ``--optimize N`` (or ``-ON``) is used to control the creation of :file:`.pyo`
- files: ``-O1`` turns on basic optimizations, ``-O2`` also discards docstrings,
- ``-O0`` does not create :file:`.pyo` files; the default is ``-O0``.
-
-You can mix and match these options: for example, ``--no-compile --optimize 2``
-will create :file:`.pyo` files but no :file:`.pyc` files.
-
-.. XXX these option roles do not work
-
-Calling Python with :option:`-O` or :option:`-B` does not control the creation
-of bytecode files, only the options described above do.
-
-
-:command:`build_scripts`
-------------------------
-Build the scripts (just copy them to the build directory and adjust their
-shebang if they're Python scripts).
-
-
-:command:`clean`
-----------------
-
-Clean the build tree of the release.
-
-.. program:: packaging clean
-
-.. cmdoption:: --all, -a
-
- Remove build directories for modules, scripts, etc., not only temporary build
- by-products.
-
-
-Creating source and built distributions
-=======================================
-
-:command:`sdist`
-----------------
-
-Build a source distribution for a release.
-
-It is recommended that you always build and upload a source distribution. Users
-of OSes with easy access to compilers and users of advanced packaging tools will
-prefer to compile from source rather than using pre-built distributions. For
-Windows users, providing a binary installer is also recommended practice.
-
-
-:command:`bdist`
-----------------
-
-Build a binary distribution for a release.
-
-This command will call other :command:`bdist_*` commands to create one or more
-distributions depending on the options given. The default is to create a
-.tar.gz archive on Unix and a zip archive on Windows or OS/2.
-
-.. program:: packaging bdist
-
-.. cmdoption:: --formats
-
- Binary formats to build (comma-separated list).
-
-.. cmdoption:: --show-formats
-
- Dump list of available formats.
-
-
-:command:`bdist_dumb`
----------------------
-
-Build a "dumb" installer, a simple archive of files that could be unpacked under
-``$prefix`` or ``$exec_prefix``.
-
-
-:command:`bdist_wininst`
-------------------------
-
-Build a Windows installer.
-
-
-:command:`bdist_msi`
---------------------
-
-Build a `Microsoft Installer`_ (.msi) file.
-
-.. _Microsoft Installer: http://msdn.microsoft.com/en-us/library/cc185688(VS.85).aspx
-
-In most cases, the :command:`bdist_msi` installer is a better choice than the
-:command:`bdist_wininst` installer, because it provides better support for Win64
-platforms, allows administrators to perform non-interactive installations, and
-allows installation through group policies.
-
-
-Publishing distributions
-========================
-
-:command:`register`
--------------------
-
-This command registers the current release with the Python Package Index. This
-is described in more detail in :PEP:`301`.
-
-.. TODO explain user and project registration with the web UI
-
-
-:command:`upload`
------------------
-
-Upload source and/or binary distributions to PyPI.
-
-The distributions have to be built on the same command line as the
-:command:`upload` command; see :ref:`packaging-package-upload` for more info.
-
-.. program:: packaging upload
-
-.. cmdoption:: --sign, -s
-
- Sign each uploaded file using GPG (GNU Privacy Guard). The ``gpg`` program
- must be available for execution on the system ``PATH``.
-
-.. cmdoption:: --identity=NAME, -i NAME
-
- Specify the identity or key name for GPG to use when signing. The value of
- this option will be passed through the ``--local-user`` option of the
- ``gpg`` program.
-
-.. cmdoption:: --show-response
-
- Display the full response text from server; this is useful for debugging
- PyPI problems.
-
-.. cmdoption:: --repository=URL, -r URL
-
- The URL of the repository to upload to. Defaults to
- http://pypi.python.org/pypi (i.e., the main PyPI installation).
-
-.. cmdoption:: --upload-docs
-
- Also run :command:`upload_docs`. Mainly useful as a default value in
- :file:`setup.cfg` (on the command line, it's shorter to just type both
- commands).
-
-
-:command:`upload_docs`
-----------------------
-
-Upload HTML documentation to PyPI.
-
-PyPI now supports publishing project documentation at a URI of the form
-``http://packages.python.org/``. :command:`upload_docs` will create
-the necessary zip file out of a documentation directory and will post to the
-repository.
-
-Note that to upload the documentation of a project, the corresponding version
-must already be registered with PyPI, using the :command:`register` command ---
-just like with :command:`upload`.
-
-Assuming there is an ``Example`` project with documentation in the subdirectory
-:file:`docs`, for example::
-
- Example/
- example.py
- setup.cfg
- docs/
- build/
- html/
- index.html
- tips_tricks.html
- conf.py
- index.txt
- tips_tricks.txt
-
-You can simply specify the directory with the HTML files in your
-:file:`setup.cfg` file:
-
-.. code-block:: cfg
-
- [upload_docs]
- upload-dir = docs/build/html
-
-
-.. program:: packaging upload_docs
-
-.. cmdoption:: --upload-dir
-
- The directory to be uploaded to the repository. By default documentation
- is searched for in ``docs`` (or ``doc``) directory in project root.
-
-.. cmdoption:: --show-response
-
- Display the full response text from server; this is useful for debugging
- PyPI problems.
-
-.. cmdoption:: --repository=URL, -r URL
-
- The URL of the repository to upload to. Defaults to
- http://pypi.python.org/pypi (i.e., the main PyPI installation).
-
-
-The install step
-================
-
-These commands are used by end-users of a project using :program:`pysetup` or
-another compatible installer. Each command will run the corresponding
-:command:`build_*` command and then move the built files to their destination on
-the target system.
-
-
-:command:`install_dist`
------------------------
-
-Install a distribution, delegating to the other :command:`install_*` commands to
-do the work. See :ref:`packaging-how-install-works` for complete usage
-instructions.
-
-
-:command:`install_data`
------------------------
-
-Install data files.
-
-
-:command:`install_distinfo`
----------------------------
-
-Install files recording details of the installation as specified in :PEP:`376`.
-
-
-:command:`install_headers`
---------------------------
-
-Install C/C++ header files.
-
-
-:command:`install_lib`
-----------------------
-
-Install all modules (extensions and pure Python).
-
-.. XXX what about C libraries created with build_clib?
-
-Similarly to ``build_py``, there are options to control the compilation of
-Python code to :term:`bytecode` files (see above). By default, :file:`.pyc`
-files will be created (``--compile``) and :file:`.pyo` files will not
-(``--optimize 0``).
-
-
-:command:`install_scripts`
---------------------------
-
-Install scripts.
diff --git a/Doc/packaging/configfile.rst b/Doc/packaging/configfile.rst
deleted file mode 100644
index 825b5cb558..0000000000
--- a/Doc/packaging/configfile.rst
+++ /dev/null
@@ -1,125 +0,0 @@
-.. _packaging-setup-config:
-
-************************************
-Writing the Setup Configuration File
-************************************
-
-Often, it's not possible to write down everything needed to build a distribution
-*a priori*: you may need to get some information from the user, or from the
-user's system, in order to proceed. As long as that information is fairly
-simple---a list of directories to search for C header files or libraries, for
-example---then providing a configuration file, :file:`setup.cfg`, for users to
-edit is a cheap and easy way to solicit it. Configuration files also let you
-provide default values for any command option, which the installer can then
-override either on the command line or by editing the config file.
-
-The setup configuration file is a useful middle-ground between the setup script
----which, ideally, would be opaque to installers [#]_---and the command line to
-the setup script, which is outside of your control and entirely up to the
-installer. In fact, :file:`setup.cfg` (and any other Distutils configuration
-files present on the target system) are processed after the contents of the
-setup script, but before the command line. This has several useful
-consequences:
-
-.. If you have more advanced needs, such as determining which extensions to
- build based on what capabilities are present on the target system, then you
- need the Distutils auto-configuration facility. This started to appear in
- Distutils 0.9 but, as of this writing, isn't mature or stable enough yet
- for real-world use.
-
-* installers can override some of what you put in :file:`setup.py` by editing
- :file:`setup.cfg`
-
-* you can provide non-standard defaults for options that are not easily set in
- :file:`setup.py`
-
-* installers can override anything in :file:`setup.cfg` using the command-line
- options to :file:`setup.py`
-
-The basic syntax of the configuration file is simple::
-
- [command]
- option = value
- ...
-
-where *command* is one of the Distutils commands (e.g. :command:`build_py`,
-:command:`install_dist`), and *option* is one of the options that command supports.
-Any number of options can be supplied for each command, and any number of
-command sections can be included in the file. Blank lines are ignored, as are
-comments, which run from a ``'#'`` character until the end of the line. Long
-option values can be split across multiple lines simply by indenting the
-continuation lines.
-
-You can find out the list of options supported by a particular command with the
-universal :option:`--help` option, e.g. ::
-
- > python setup.py --help build_ext
- [...]
- Options for 'build_ext' command:
- --build-lib (-b) directory for compiled extension modules
- --build-temp (-t) directory for temporary files (build by-products)
- --inplace (-i) ignore build-lib and put compiled extensions into the
- source directory alongside your pure Python modules
- --include-dirs (-I) list of directories to search for header files
- --define (-D) C preprocessor macros to define
- --undef (-U) C preprocessor macros to undefine
- --swig-opts list of SWIG command-line options
- [...]
-
-.. XXX do we want to support ``setup.py --help metadata``?
-
-Note that an option spelled :option:`--foo-bar` on the command line is spelled
-:option:`foo_bar` in configuration files.
-
-For example, say you want your extensions to be built "in-place"---that is, you
-have an extension :mod:`pkg.ext`, and you want the compiled extension file
-(:file:`ext.so` on Unix, say) to be put in the same source directory as your
-pure Python modules :mod:`pkg.mod1` and :mod:`pkg.mod2`. You can always use the
-:option:`--inplace` option on the command line to ensure this::
-
- python setup.py build_ext --inplace
-
-But this requires that you always specify the :command:`build_ext` command
-explicitly, and remember to provide :option:`--inplace`. An easier way is to
-"set and forget" this option, by encoding it in :file:`setup.cfg`, the
-configuration file for this distribution::
-
- [build_ext]
- inplace = 1
-
-This will affect all builds of this module distribution, whether or not you
-explicitly specify :command:`build_ext`. If you include :file:`setup.cfg` in
-your source distribution, it will also affect end-user builds---which is
-probably a bad idea for this option, since always building extensions in-place
-would break installation of the module distribution. In certain peculiar cases,
-though, modules are built right in their installation directory, so this is
-conceivably a useful ability. (Distributing extensions that expect to be built
-in their installation directory is almost always a bad idea, though.)
-
-Another example: certain commands take options that vary from project to
-project but not depending on the installation system, for example,
-:command:`test` needs to know where your test suite is located and what test
-runner to use; likewise, :command:`upload_docs` can find HTML documentation in
-a :file:`doc` or :file:`docs` directory, but needs an option to find files in
-:file:`docs/build/html`. Instead of having to type out these options each
-time you want to run the command, you can put them in the project's
-:file:`setup.cfg`::
-
- [test]
- suite = packaging.tests
-
- [upload_docs]
- upload-dir = docs/build/html
-
-
-.. seealso::
-
- :ref:`packaging-config-syntax` in "Installing Python Projects"
- More information on the configuration files is available in the manual for
- system administrators.
-
-
-.. rubric:: Footnotes
-
-.. [#] This ideal probably won't be achieved until auto-configuration is fully
- supported by the Distutils.
diff --git a/Doc/packaging/examples.rst b/Doc/packaging/examples.rst
deleted file mode 100644
index 594ade01d7..0000000000
--- a/Doc/packaging/examples.rst
+++ /dev/null
@@ -1,334 +0,0 @@
-.. _packaging-examples:
-
-********
-Examples
-********
-
-This chapter provides a number of basic examples to help get started with
-Packaging.
-
-
-.. _packaging-pure-mod:
-
-Pure Python distribution (by module)
-====================================
-
-If you're just distributing a couple of modules, especially if they don't live
-in a particular package, you can specify them individually using the
-:option:`py_modules` option in the setup script.
-
-In the simplest case, you'll have two files to worry about: a setup script and
-the single module you're distributing, :file:`foo.py` in this example::
-
- /
- setup.py
- foo.py
-
-(In all diagrams in this section, ** will refer to the distribution root
-directory.) A minimal setup script to describe this situation would be::
-
- from packaging.core import setup
- setup(name='foo',
- version='1.0',
- py_modules=['foo'])
-
-Note that the name of the distribution is specified independently with the
-:option:`name` option, and there's no rule that says it has to be the same as
-the name of the sole module in the distribution (although that's probably a good
-convention to follow). However, the distribution name is used to generate
-filenames, so you should stick to letters, digits, underscores, and hyphens.
-
-Since :option:`py_modules` is a list, you can of course specify multiple
-modules, e.g. if you're distributing modules :mod:`foo` and :mod:`bar`, your
-setup might look like this::
-
- /
- setup.py
- foo.py
- bar.py
-
-and the setup script might be ::
-
- from packaging.core import setup
- setup(name='foobar',
- version='1.0',
- py_modules=['foo', 'bar'])
-
-You can put module source files into another directory, but if you have enough
-modules to do that, it's probably easier to specify modules by package rather
-than listing them individually.
-
-
-.. _packaging-pure-pkg:
-
-Pure Python distribution (by package)
-=====================================
-
-If you have more than a couple of modules to distribute, especially if they are
-in multiple packages, it's probably easier to specify whole packages rather than
-individual modules. This works even if your modules are not in a package; you
-can just tell the Distutils to process modules from the root package, and that
-works the same as any other package (except that you don't have to have an
-:file:`__init__.py` file).
-
-The setup script from the last example could also be written as ::
-
- from packaging.core import setup
- setup(name='foobar',
- version='1.0',
- packages=[''])
-
-(The empty string stands for the root package.)
-
-If those two files are moved into a subdirectory, but remain in the root
-package, e.g.::
-
- /
- setup.py
- src/
- foo.py
- bar.py
-
-then you would still specify the root package, but you have to tell the
-Distutils where source files in the root package live::
-
- from packaging.core import setup
- setup(name='foobar',
- version='1.0',
- package_dir={'': 'src'},
- packages=[''])
-
-More typically, though, you will want to distribute multiple modules in the same
-package (or in sub-packages). For example, if the :mod:`foo` and :mod:`bar`
-modules belong in package :mod:`foobar`, one way to lay out your source tree is
-
-::
-
- /
- setup.py
- foobar/
- __init__.py
- foo.py
- bar.py
-
-This is in fact the default layout expected by the Distutils, and the one that
-requires the least work to describe in your setup script::
-
- from packaging.core import setup
- setup(name='foobar',
- version='1.0',
- packages=['foobar'])
-
-If you want to put modules in directories not named for their package, then you
-need to use the :option:`package_dir` option again. For example, if the
-:file:`src` directory holds modules in the :mod:`foobar` package::
-
- /
- setup.py
- src/
- __init__.py
- foo.py
- bar.py
-
-an appropriate setup script would be ::
-
- from packaging.core import setup
- setup(name='foobar',
- version='1.0',
- package_dir={'foobar': 'src'},
- packages=['foobar'])
-
-Or, you might put modules from your main package right in the distribution
-root::
-
- /
- setup.py
- __init__.py
- foo.py
- bar.py
-
-in which case your setup script would be ::
-
- from packaging.core import setup
- setup(name='foobar',
- version='1.0',
- package_dir={'foobar': ''},
- packages=['foobar'])
-
-(The empty string also stands for the current directory.)
-
-If you have sub-packages, they must be explicitly listed in :option:`packages`,
-but any entries in :option:`package_dir` automatically extend to sub-packages.
-(In other words, the Distutils does *not* scan your source tree, trying to
-figure out which directories correspond to Python packages by looking for
-:file:`__init__.py` files.) Thus, if the default layout grows a sub-package::
-
- /
- setup.py
- foobar/
- __init__.py
- foo.py
- bar.py
- subfoo/
- __init__.py
- blah.py
-
-then the corresponding setup script would be ::
-
- from packaging.core import setup
- setup(name='foobar',
- version='1.0',
- packages=['foobar', 'foobar.subfoo'])
-
-(Again, the empty string in :option:`package_dir` stands for the current
-directory.)
-
-
-.. _packaging-single-ext:
-
-Single extension module
-=======================
-
-Extension modules are specified using the :option:`ext_modules` option.
-:option:`package_dir` has no effect on where extension source files are found;
-it only affects the source for pure Python modules. The simplest case, a
-single extension module in a single C source file, is::
-
- /
- setup.py
- foo.c
-
-If the :mod:`foo` extension belongs in the root package, the setup script for
-this could be ::
-
- from packaging.core import setup, Extension
- setup(name='foobar',
- version='1.0',
- ext_modules=[Extension('foo', ['foo.c'])])
-
-If the extension actually belongs in a package, say :mod:`foopkg`, then
-
-With exactly the same source tree layout, this extension can be put in the
-:mod:`foopkg` package simply by changing the name of the extension::
-
- from packaging.core import setup, Extension
- setup(name='foobar',
- version='1.0',
- packages=['foopkg'],
- ext_modules=[Extension('foopkg.foo', ['foo.c'])])
-
-
-Checking metadata
-=================
-
-The ``check`` command allows you to verify if your project's metadata
-meets the minimum requirements to build a distribution.
-
-To run it, just call it using your :file:`setup.py` script. If something is
-missing, ``check`` will display a warning.
-
-Let's take an example with a simple script::
-
- from packaging.core import setup
-
- setup(name='foobar')
-
-.. TODO configure logging StreamHandler to match this output
-
-Running the ``check`` command will display some warnings::
-
- $ python setup.py check
- running check
- warning: check: missing required metadata: version, home_page
- warning: check: missing metadata: either (author and author_email) or
- (maintainer and maintainer_email) must be supplied
-
-
-If you use the reStructuredText syntax in the ``long_description`` field and
-`Docutils `_ is installed you can check if
-the syntax is fine with the ``check`` command, using the ``restructuredtext``
-option.
-
-For example, if the :file:`setup.py` script is changed like this::
-
- from packaging.core import setup
-
- desc = """\
- Welcome to foobar!
- ===============
-
- This is the description of the ``foobar`` project.
- """
-
- setup(name='foobar',
- version='1.0',
- author=u'Tarek Ziadé',
- author_email='tarek@ziade.org',
- summary='Foobar utilities'
- description=desc,
- home_page='http://example.com')
-
-Where the long description is broken, ``check`` will be able to detect it
-by using the :mod:`docutils` parser::
-
- $ python setup.py check --restructuredtext
- running check
- warning: check: Title underline too short. (line 2)
- warning: check: Could not finish the parsing.
-
-
-.. _packaging-reading-metadata:
-
-Reading the metadata
-====================
-
-The :func:`packaging.core.setup` function provides a command-line interface
-that allows you to query the metadata fields of a project through the
-:file:`setup.py` script of a given project::
-
- $ python setup.py --name
- foobar
-
-This call reads the ``name`` metadata by running the
-:func:`packaging.core.setup` function. When a source or binary
-distribution is created with Distutils, the metadata fields are written
-in a static file called :file:`PKG-INFO`. When a Distutils-based project is
-installed in Python, the :file:`PKG-INFO` file is copied alongside the modules
-and packages of the distribution under :file:`NAME-VERSION-pyX.X.egg-info`,
-where ``NAME`` is the name of the project, ``VERSION`` its version as defined
-in the Metadata, and ``pyX.X`` the major and minor version of Python like
-``2.7`` or ``3.2``.
-
-You can read back this static file, by using the
-:class:`packaging.dist.Metadata` class and its
-:func:`read_pkg_file` method::
-
- >>> from packaging.metadata import Metadata
- >>> metadata = Metadata()
- >>> metadata.read_pkg_file(open('distribute-0.6.8-py2.7.egg-info'))
- >>> metadata.name
- 'distribute'
- >>> metadata.version
- '0.6.8'
- >>> metadata.description
- 'Easily download, build, install, upgrade, and uninstall Python packages'
-
-Notice that the class can also be instantiated with a metadata file path to
-loads its values::
-
- >>> pkg_info_path = 'distribute-0.6.8-py2.7.egg-info'
- >>> Metadata(pkg_info_path).name
- 'distribute'
-
-
-.. XXX These comments have been here for at least ten years. Write the
- sections or delete the comments (we can maybe ask Greg Ward about
- the planned contents). (Unindent to make them section titles)
-
- .. multiple-ext::
-
- Multiple extension modules
- ==========================
-
- Putting it all together
- =======================
diff --git a/Doc/packaging/extending.rst b/Doc/packaging/extending.rst
deleted file mode 100644
index f2d3863171..0000000000
--- a/Doc/packaging/extending.rst
+++ /dev/null
@@ -1,95 +0,0 @@
-.. _extending-packaging:
-
-*******************
-Extending Distutils
-*******************
-
-Distutils can be extended in various ways. Most extensions take the form of new
-commands or replacements for existing commands. New commands may be written to
-support new types of platform-specific packaging, for example, while
-replacements for existing commands may be made to modify details of how the
-command operates on a package.
-
-Most extensions of the packaging are made within :file:`setup.py` scripts that
-want to modify existing commands; many simply add a few file extensions that
-should be copied into packages in addition to :file:`.py` files as a
-convenience.
-
-Most packaging command implementations are subclasses of the
-:class:`packaging.cmd.Command` class. New commands may directly inherit from
-:class:`Command`, while replacements often derive from :class:`Command`
-indirectly, directly subclassing the command they are replacing. Commands are
-required to derive from :class:`Command`.
-
-.. .. _extend-existing:
- Extending existing commands
- ===========================
-
-
-.. .. _new-commands:
- Writing new commands
- ====================
-
-
-Integrating new commands
-========================
-
-There are different ways to integrate new command implementations into
-packaging. The most difficult is to lobby for the inclusion of the new features
-in packaging itself, and wait for (and require) a version of Python that
-provides that support. This is really hard for many reasons.
-
-The most common, and possibly the most reasonable for most needs, is to include
-the new implementations with your :file:`setup.py` script, and cause the
-:func:`packaging.core.setup` function use them::
-
- from packaging.core import setup
- from packaging.command.build_py import build_py as _build_py
-
- class build_py(_build_py):
- """Specialized Python source builder."""
-
- # implement whatever needs to be different...
-
- setup(..., cmdclass={'build_py': build_py})
-
-This approach is most valuable if the new implementations must be used to use a
-particular package, as everyone interested in the package will need to have the
-new command implementation.
-
-Beginning with Python 2.4, a third option is available, intended to allow new
-commands to be added which can support existing :file:`setup.py` scripts without
-requiring modifications to the Python installation. This is expected to allow
-third-party extensions to provide support for additional packaging systems, but
-the commands can be used for anything packaging commands can be used for. A new
-configuration option, :option:`command_packages` (command-line option
-:option:`--command-packages`), can be used to specify additional packages to be
-searched for modules implementing commands. Like all packaging options, this
-can be specified on the command line or in a configuration file. This option
-can only be set in the ``[global]`` section of a configuration file, or before
-any commands on the command line. If set in a configuration file, it can be
-overridden from the command line; setting it to an empty string on the command
-line causes the default to be used. This should never be set in a configuration
-file provided with a package.
-
-This new option can be used to add any number of packages to the list of
-packages searched for command implementations; multiple package names should be
-separated by commas. When not specified, the search is only performed in the
-:mod:`packaging.command` package. When :file:`setup.py` is run with the option
-:option:`--command-packages` :option:`distcmds,buildcmds`, however, the packages
-:mod:`packaging.command`, :mod:`distcmds`, and :mod:`buildcmds` will be searched
-in that order. New commands are expected to be implemented in modules of the
-same name as the command by classes sharing the same name. Given the example
-command-line option above, the command :command:`bdist_openpkg` could be
-implemented by the class :class:`distcmds.bdist_openpkg.bdist_openpkg` or
-:class:`buildcmds.bdist_openpkg.bdist_openpkg`.
-
-
-Adding new distribution types
-=============================
-
-Commands that create distributions (files in the :file:`dist/` directory) need
-to add ``(command, filename)`` pairs to ``self.distribution.dist_files`` so that
-:command:`upload` can upload it to PyPI. The *filename* in the pair contains no
-path information, only the name of the file itself. In dry-run mode, pairs
-should still be added to represent what would have been created.
diff --git a/Doc/packaging/index.rst b/Doc/packaging/index.rst
deleted file mode 100644
index d3d0dec4de..0000000000
--- a/Doc/packaging/index.rst
+++ /dev/null
@@ -1,45 +0,0 @@
-.. _packaging-index:
-
-##############################
- Distributing Python Projects
-##############################
-
-:Authors: The Fellowship of the Packaging
-:Email: distutils-sig@python.org
-:Release: |version|
-:Date: |today|
-
-This document describes Packaging for Python authors, describing how to use the
-module to make Python applications, packages or modules easily available to a
-wider audience with very little overhead for build/release/install mechanics.
-
-.. toctree::
- :maxdepth: 2
- :numbered:
-
- tutorial
- setupcfg
- introduction
- setupscript
- configfile
- sourcedist
- builtdist
- packageindex
- uploading
- examples
- extending
- commandhooks
- commandref
-
-
-.. seealso::
-
- :ref:`packaging-install-index`
- A user-centered manual which includes information on adding projects
- into an existing Python installation. You do not need to be a Python
- programmer to read this manual.
-
- :mod:`packaging`
- A library reference for developers of packaging tools wanting to use
- standalone building blocks like :mod:`~packaging.version` or
- :mod:`~packaging.metadata`, or extend Packaging itself.
diff --git a/Doc/packaging/introduction.rst b/Doc/packaging/introduction.rst
deleted file mode 100644
index a757ffc38b..0000000000
--- a/Doc/packaging/introduction.rst
+++ /dev/null
@@ -1,193 +0,0 @@
-.. _packaging-intro:
-
-*****************************
-An Introduction to Packaging
-*****************************
-
-This document covers using Packaging to distribute your Python modules,
-concentrating on the role of developer/distributor. If you're looking for
-information on installing Python modules you should refer to the
-:ref:`packaging-install-index` chapter.
-
-Throughout this documentation, the terms "Distutils", "the Distutils" and
-"Packaging" will be used interchangeably.
-
-.. _packaging-concepts:
-
-Concepts & Terminology
-======================
-
-Using Distutils is quite simple both for module developers and for
-users/administrators installing third-party modules. As a developer, your
-responsibilities (apart from writing solid, well-documented and well-tested
-code, of course!) are:
-
-* writing a setup script (:file:`setup.py` by convention)
-
-* (optional) writing a setup configuration file
-
-* creating a source distribution
-
-* (optional) creating one or more "built" (binary) distributions of your
- project
-
-All of these tasks are covered in this document.
-
-Not all module developers have access to multiple platforms, so one cannot
-expect them to create buildt distributions for every platform. To remedy
-this, it is hoped that intermediaries called *packagers* will arise to address
-this need. Packagers take source distributions released by module developers,
-build them on one or more platforms and release the resulting built
-distributions. Thus, users on a greater range of platforms will be able to
-install the most popular Python modules in the most natural way for their
-platform without having to run a setup script or compile a single line of code.
-
-
-.. _packaging-simple-example:
-
-A Simple Example
-================
-
-A setup script is usually quite simple, although since it's written in Python
-there are no arbitrary limits to what you can do with it, though you should be
-careful about putting expensive operations in your setup script.
-Unlike, say, Autoconf-style configure scripts the setup script may be run
-multiple times in the course of building and installing a module
-distribution.
-
-If all you want to do is distribute a module called :mod:`foo`, contained in a
-file :file:`foo.py`, then your setup script can be as simple as::
-
- from packaging.core import setup
- setup(name='foo',
- version='1.0',
- py_modules=['foo'])
-
-Some observations:
-
-* most information that you supply to the Distutils is supplied as keyword
- arguments to the :func:`setup` function
-
-* those keyword arguments fall into two categories: package metadata (name,
- version number, etc.) and information about what's in the package (a list
- of pure Python modules in this case)
-
-* modules are specified by module name, not filename (the same will hold true
- for packages and extensions)
-
-* it's recommended that you supply a little more metadata than we have in the
- example. In particular your name, email address and a URL for the
- project if appropriate (see section :ref:`packaging-setup-script` for an example)
-
-To create a source distribution for this module you would create a setup
-script, :file:`setup.py`, containing the above code and run::
-
- python setup.py sdist
-
-which will create an archive file (e.g., tarball on Unix, ZIP file on Windows)
-containing your setup script :file:`setup.py`, and your module :file:`foo.py`.
-The archive file will be named :file:`foo-1.0.tar.gz` (or :file:`.zip`), and
-will unpack into a directory :file:`foo-1.0`.
-
-If an end-user wishes to install your :mod:`foo` module all he has to do is
-download :file:`foo-1.0.tar.gz` (or :file:`.zip`), unpack it, and from the
-:file:`foo-1.0` directory run ::
-
- python setup.py install
-
-which will copy :file:`foo.py` to the appropriate directory for
-third-party modules in their Python installation.
-
-This simple example demonstrates some fundamental concepts of Distutils.
-First, both developers and installers have the same basic user interface, i.e.
-the setup script. The difference is which Distutils *commands* they use: the
-:command:`sdist` command is almost exclusively for module developers, while
-:command:`install` is more often used by installers (although some developers
-will want to install their own code occasionally).
-
-If you want to make things really easy for your users, you can create more
-than one built distributions for them. For instance, if you are running on a
-Windows machine and want to make things easy for other Windows users, you can
-create an executable installer (the most appropriate type of built distribution
-for this platform) with the :command:`bdist_wininst` command. For example::
-
- python setup.py bdist_wininst
-
-will create an executable installer, :file:`foo-1.0.win32.exe`, in the current
-directory. You can find out what distribution formats are available at any time
-by running ::
-
- python setup.py bdist --help-formats
-
-
-.. _packaging-python-terms:
-
-General Python terminology
-==========================
-
-If you're reading this document, you probably have a good idea of what Python
-modules, extensions and so forth are. Nevertheless, just to be sure that
-everyone is on the same page, here's a quick overview of Python terms:
-
-module
- The basic unit of code reusability in Python: a block of code imported by
- some other code. Three types of modules are important to us here: pure
- Python modules, extension modules and packages.
-
-pure Python module
- A module written in Python and contained in a single :file:`.py` file (and
- possibly associated :file:`.pyc` and/or :file:`.pyo` files). Sometimes
- referred to as a "pure module."
-
-extension module
- A module written in the low-level language of the Python implementation: C/C++
- for Python, Java for Jython. Typically contained in a single dynamically
- loaded pre-compiled file, e.g. a shared object (:file:`.so`) file for Python
- extensions on Unix, a DLL (given the :file:`.pyd` extension) for Python
- extensions on Windows, or a Java class file for Jython extensions. Note that
- currently Distutils only handles C/C++ extensions for Python.
-
-package
- A module that contains other modules, typically contained in a directory of
- the filesystem and distinguished from other directories by the presence of a
- file :file:`__init__.py`.
-
-root package
- The root of the hierarchy of packages. (This isn't really a package,
- since it doesn't have an :file:`__init__.py` file. But... we have to
- call it something, right?) The vast majority of the standard library is
- in the root package, as are many small standalone third-party modules that
- don't belong to a larger module collection. Unlike regular packages,
- modules in the root package can be found in many directories: in fact,
- every directory listed in ``sys.path`` contributes modules to the root
- package.
-
-
-.. _packaging-term:
-
-Distutils-specific terminology
-==============================
-
-The following terms apply more specifically to the domain of distributing Python
-modules using Distutils:
-
-module distribution
- A collection of Python modules distributed together as a single downloadable
- resource and meant to be installed all as one. Examples of some well-known
- module distributions are NumPy, SciPy, PIL (the Python Imaging
- Library) or mxBase. (Module distributions would be called a *package*,
- except that term is already taken in the Python context: a single module
- distribution may contain zero, one, or many Python packages.)
-
-pure module distribution
- A module distribution that contains only pure Python modules and packages.
- Sometimes referred to as a "pure distribution."
-
-non-pure module distribution
- A module distribution that contains at least one extension module. Sometimes
- referred to as a "non-pure distribution."
-
-distribution root
- The top-level directory of your source tree (or source distribution). The
- directory where :file:`setup.py` exists. Generally :file:`setup.py` will
- be run from this directory.
diff --git a/Doc/packaging/packageindex.rst b/Doc/packaging/packageindex.rst
deleted file mode 100644
index cd1d598631..0000000000
--- a/Doc/packaging/packageindex.rst
+++ /dev/null
@@ -1,104 +0,0 @@
-.. _packaging-package-index:
-
-**********************************
-Registering with the Package Index
-**********************************
-
-The Python Package Index (PyPI) holds metadata describing distributions
-packaged with packaging. The packaging command :command:`register` is used to
-submit your distribution's metadata to the index. It is invoked as follows::
-
- python setup.py register
-
-Distutils will respond with the following prompt::
-
- running register
- We need to know who you are, so please choose either:
- 1. use your existing login,
- 2. register as a new user,
- 3. have the server generate a new password for you (and email it to you), or
- 4. quit
- Your selection [default 1]:
-
-Note: if your username and password are saved locally, you will not see this
-menu.
-
-If you have not registered with PyPI, then you will need to do so now. You
-should choose option 2, and enter your details as required. Soon after
-submitting your details, you will receive an email which will be used to confirm
-your registration.
-
-Once you are registered, you may choose option 1 from the menu. You will be
-prompted for your PyPI username and password, and :command:`register` will then
-submit your metadata to the index.
-
-You may submit any number of versions of your distribution to the index. If you
-alter the metadata for a particular version, you may submit it again and the
-index will be updated.
-
-PyPI holds a record for each (name, version) combination submitted. The first
-user to submit information for a given name is designated the Owner of that
-name. They may submit changes through the :command:`register` command or through
-the web interface. They may also designate other users as Owners or Maintainers.
-Maintainers may edit the package information, but not designate other Owners or
-Maintainers.
-
-By default PyPI will list all versions of a given package. To hide certain
-versions, the Hidden property should be set to yes. This must be edited through
-the web interface.
-
-
-.. _packaging-pypirc:
-
-The .pypirc file
-================
-
-The format of the :file:`.pypirc` file is as follows::
-
- [packaging]
- index-servers =
- pypi
-
- [pypi]
- repository:
- username:
- password:
-
-The *packaging* section defines a *index-servers* variable that lists the
-name of all sections describing a repository.
-
-Each section describing a repository defines three variables:
-
-- *repository*, that defines the url of the PyPI server. Defaults to
- ``http://www.python.org/pypi``.
-- *username*, which is the registered username on the PyPI server.
-- *password*, that will be used to authenticate. If omitted the user
- will be prompt to type it when needed.
-
-If you want to define another server a new section can be created and
-listed in the *index-servers* variable::
-
- [packaging]
- index-servers =
- pypi
- other
-
- [pypi]
- repository:
- username:
- password:
-
- [other]
- repository: http://example.com/pypi
- username:
- password:
-
-:command:`register` can then be called with the -r option to point the
-repository to work with::
-
- python setup.py register -r http://example.com/pypi
-
-For convenience, the name of the section that describes the repository
-may also be used::
-
- python setup.py register -r other
diff --git a/Doc/packaging/setupcfg.rst b/Doc/packaging/setupcfg.rst
deleted file mode 100644
index a38101751e..0000000000
--- a/Doc/packaging/setupcfg.rst
+++ /dev/null
@@ -1,890 +0,0 @@
-.. highlightlang:: cfg
-
-.. _setupcfg-spec:
-
-*******************************************
-Specification of the :file:`setup.cfg` file
-*******************************************
-
-:version: 0.9
-
-This document describes the :file:`setup.cfg`, an ini-style configuration file
-used by Packaging to replace the :file:`setup.py` file used by Distutils.
-This specification is language-agnostic, and will therefore repeat some
-information that's already documented for Python in the
-:class:`configparser.RawConfigParser` documentation.
-
-.. contents::
- :depth: 3
- :local:
-
-
-.. _setupcfg-syntax:
-
-Syntax
-======
-
-The ini-style format used in the configuration file is a simple collection of
-sections that group sets of key-value fields separated by ``=`` or ``:`` and
-optional whitespace. Lines starting with ``#`` or ``;`` are comments and will
-be ignored. Empty lines are also ignored. Example::
-
- [section1]
- # comment
- name = value
- name2 = "other value"
-
- [section2]
- foo = bar
-
-
-Parsing values
----------------
-
-Here are a set of rules to parse values:
-
-- If a value is quoted with ``"`` chars, it's a string. If a quote character is
- present in the quoted value, it can be escaped as ``\"`` or left as-is.
-
-- If the value is ``true``, ``t``, ``yes``, ``y`` (case-insensitive) or ``1``,
- it's converted to the language equivalent of a ``True`` value; if it's
- ``false``, ``f``, ``no``, ``n`` (case-insensitive) or ``0``, it's converted to
- the equivalent of ``False``.
-
-- A value can contain multiple lines. When read, lines are converted into a
- sequence of values. Each line after the first must start with a least one
- space or tab character; this leading indentation will be stripped.
-
-- All other values are considered strings.
-
-Examples::
-
- [section]
- foo = one
- two
- three
-
- bar = false
- baz = 1.3
- boo = "ok"
- beee = "wqdqw pojpj w\"ddq"
-
-
-Extending files
----------------
-
-A configuration file can be extended (i.e. included) by other files. For this,
-a ``DEFAULT`` section must contain an ``extends`` key whose value points to one
-or more files which will be merged into the current files by adding new sections
-and fields. If a file loaded by ``extends`` contains sections or keys that
-already exist in the original file, they will not override the previous values.
-
-Contents of :file:`one.cfg`::
-
- [section1]
- name = value
-
- [section2]
- foo = foo from one.cfg
-
-Contents of :file:`two.cfg`::
-
- [DEFAULT]
- extends = one.cfg
-
- [section2]
- foo = foo from two.cfg
- baz = baz from two.cfg
-
-The result of parsing :file:`two.cfg` is equivalent to this file::
-
- [section1]
- name = value
-
- [section2]
- foo = foo from one.cfg
- baz = baz from two.cfg
-
-Example use of multi-line notation to include more than one file::
-
- [DEFAULT]
- extends = one.cfg
- two.cfg
-
-When several files are provided, they are processed sequentially, following the
-precedence rules explained above. This means that the list of files should go
-from most specialized to most common.
-
-**Tools will need to provide a way to produce a merged version of the
-file**. This will be useful to let users publish a single file.
-
-
-.. _setupcfg-sections:
-
-Description of sections and fields
-==================================
-
-Each section contains a description of its options.
-
-- Options that are marked *multi* can have multiple values, one value per
- line.
-- Options that are marked *optional* can be omitted.
-- Options that are marked *environ* can use environment markers, as described
- in :PEP:`345`.
-
-
-The sections are:
-
-global
- Global options not related to one command.
-
-metadata
- Name, version and other information defined by :PEP:`345`.
-
-files
- Modules, scripts, data, documentation and other files to include in the
- distribution.
-
-extension sections
- Options used to build extension modules.
-
-command sections
- Options given for specific commands, identical to those that can be given
- on the command line.
-
-
-.. _setupcfg-section-global:
-
-Global options
---------------
-
-Contains global options for Packaging. This section is shared with Distutils.
-
-
-commands
- Defined Packaging command. A command is defined by its fully
- qualified name. *optional*, *multi*
-
- Examples::
-
- [global]
- commands =
- package.setup.CustomSdistCommand
- package.setup.BdistDeb
-
-compilers
- Defined Packaging compiler. A compiler is defined by its fully
- qualified name. *optional*, *multi*
-
- Example::
-
- [global]
- compilers =
- hotcompiler.SmartCCompiler
-
-setup_hooks
- Defines a list of callables to be called right after the :file:`setup.cfg`
- file is read, before any other processing. Each value is a Python dotted
- name to an object, which has to be defined in a module present in the project
- directory alonside :file:`setup.cfg` or on Python's :data:`sys.path` (see
- :ref:`packaging-finding-hooks`). The callables are executed in the
- order they're found in the file; if one of them cannot be found, tools should
- not stop, but for example produce a warning and continue with the next line.
- Each callable receives the configuration as a dictionary (keys are
- :file:`setup.cfg` sections, values are dictionaries of fields) and can make
- any change to it. *optional*, *multi*
-
- Example::
-
- [global]
- setup_hooks = _setuphooks.customize_config
-
-
-
-.. _setupcfg-section-metadata:
-
-Metadata
---------
-
-The metadata section contains the metadata for the project as described in
-:PEP:`345`. Field names are case-insensitive.
-
-Fields:
-
-name
- Name of the project.
-
-version
- Version of the project. Must comply with :PEP:`386`.
-
-platform
- Platform specification describing an operating system
- supported by the distribution which is not listed in the "Operating System"
- Trove classifiers (:PEP:`301`). *optional*, *multi*
-
-supported-platform
- Binary distributions containing a PKG-INFO file will
- use the Supported-Platform field in their metadata to specify the OS and
- CPU for which the binary distribution was compiled. The semantics of
- the Supported-Platform field are free form. *optional*, *multi*
-
-summary
- A one-line summary of what the distribution does.
- (Used to be called *description* in Distutils1.)
-
-description
- A longer description. (Used to be called *long_description*
- in Distutils1.) A file can be provided in the *description-file* field.
- *optional*
-
-keywords
- A list of additional keywords to be used to assist searching
- for the distribution in a larger catalog. Comma or space-separated.
- *optional*
-
-home-page
- The URL for the distribution's home page.
-
-download-url
- The URL from which this version of the distribution
- can be downloaded. *optional*
-
-author
- Author's name. *optional*
-
-author-email
- Author's e-mail. *optional*
-
-maintainer
- Maintainer's name. *optional*
-
-maintainer-email
- Maintainer's e-mail. *optional*
-
-license
- A text indicating the term of uses, when a trove classifier does
- not match. *optional*.
-
-classifiers
- Classification for the distribution, as described in PEP 301.
- *optional*, *multi*, *environ*
-
-requires-dist
- name of another packaging project required as a dependency.
- The format is *name (version)* where version is an optional
- version declaration, as described in PEP 345. *optional*, *multi*, *environ*
-
-provides-dist
- name of another packaging project contained within this
- distribution. Same format than *requires-dist*. *optional*, *multi*,
- *environ*
-
-obsoletes-dist
- name of another packaging project this version obsoletes.
- Same format than *requires-dist*. *optional*, *multi*, *environ*
-
-requires-python
- Specifies the Python version the distribution requires. The value is a
- comma-separated list of version predicates, as described in PEP 345.
- *optional*, *environ*
-
-requires-externals
- a dependency in the system. This field is free-form,
- and just a hint for downstream maintainers. *optional*, *multi*,
- *environ*
-
-project-url
- A label, followed by a browsable URL for the project.
- "label, url". The label is limited to 32 signs. *optional*, *multi*
-
-One extra field not present in PEP 345 is supported:
-
-description-file
- Path to a text file that will be used to fill the ``description`` field.
- Multiple values are accepted; they must be separated by whitespace.
- ``description-file`` and ``description`` are mutually exclusive. *optional*
-
-
-
-Example::
-
- [metadata]
- name = pypi2rpm
- version = 0.1
- author = Tarek Ziadé
- author-email = tarek@ziade.org
- summary = Script that transforms an sdist archive into a RPM package
- description-file = README
- home-page = http://bitbucket.org/tarek/pypi2rpm/wiki/Home
- project-url:
- Repository, http://bitbucket.org/tarek/pypi2rpm/
- RSS feed, https://bitbucket.org/tarek/pypi2rpm/rss
- classifier =
- Development Status :: 3 - Alpha
- License :: OSI Approved :: Mozilla Public License 1.1 (MPL 1.1)
-
-You should not give any explicit value for metadata-version: it will be guessed
-from the fields present in the file.
-
-
-.. _setupcfg-section-files:
-
-Files
------
-
-This section describes the files included in the project.
-
-packages_root
- the root directory containing all packages and modules
- (default: current directory, i.e. the project's top-level
- directory where :file:`setup.cfg` lives). *optional*
-
-packages
- a list of packages the project includes *optional*, *multi*
-
-modules
- a list of packages the project includes *optional*, *multi*
-
-scripts
- a list of scripts the project includes *optional*, *multi*
-
-extra_files
- a list of patterns for additional files to include in source distributions
- (see :ref:`packaging-manifest`) *optional*, *multi*
-
-Example::
-
- [files]
- packages_root = src
- packages =
- pypi2rpm
- pypi2rpm.command
-
- scripts =
- pypi2rpm/pypi2rpm.py
-
- extra_files =
- setup.py
- README
-
-
-.. Note::
- The :file:`setup.cfg` configuration file is included by default. Contrary to
- Distutils, :file:`README` (or :file:`README.txt`) and :file:`setup.py` are
- not included by default.
-
-
-Resources
-^^^^^^^^^
-
-This section describes the files used by the project which must not be installed
-in the same place that python modules or libraries, they are called
-**resources**. They are for example documentation files, script files,
-databases, etc...
-
-For declaring resources, you must use this notation::
-
- source = destination
-
-Data-files are declared in the **resources** field in the **file** section, for
-example::
-
- [files]
- resources =
- source1 = destination1
- source2 = destination2
-
-The **source** part of the declaration are relative paths of resources files
-(using unix path separator **/**). For example, if you've this source tree::
-
- foo/
- doc/
- doc.man
- scripts/
- foo.sh
-
-Your setup.cfg will look like::
-
- [files]
- resources =
- doc/doc.man = destination_doc
- scripts/foo.sh = destination_scripts
-
-The final paths where files will be placed are composed by : **source** +
-**destination**. In the previous example, **doc/doc.man** will be placed in
-**destination_doc/doc/doc.man** and **scripts/foo.sh** will be placed in
-**destination_scripts/scripts/foo.sh**. (If you want more control on the final
-path, take a look at :ref:`setupcfg-resources-base-prefix`).
-
-The **destination** part of resources declaration are paths with categories.
-Indeed, it's generally a bad idea to give absolute path as it will be cross
-incompatible. So, you must use resources categories in your **destination**
-declaration. Categories will be replaced by their real path at the installation
-time. Using categories is all benefit, your declaration will be simpler, cross
-platform and it will allow packager to place resources files where they want
-without breaking your code.
-
-Categories can be specified by using this syntax::
-
- {category}
-
-Default categories are:
-
-* config
-* appdata
-* appdata.arch
-* appdata.persistent
-* appdata.disposable
-* help
-* icon
-* scripts
-* doc
-* info
-* man
-
-A special category also exists **{distribution.name}** that will be replaced by
-the name of the distribution, but as most of the defaults categories use them,
-so it's not necessary to add **{distribution.name}** into your destination.
-
-If you use categories in your declarations, and you are encouraged to do, final
-path will be::
-
- source + destination_expanded
-
-.. _example_final_path:
-
-For example, if you have this setup.cfg::
-
- [metadata]
- name = foo
-
- [files]
- resources =
- doc/doc.man = {doc}
-
-And if **{doc}** is replaced by **{datadir}/doc/{distribution.name}**, final
-path will be::
-
- {datadir}/doc/foo/doc/doc.man
-
-Where {datafir} category will be platform-dependent.
-
-
-More control on source part
-"""""""""""""""""""""""""""
-
-Glob syntax
-'''''''''''
-
-When you declare source file, you can use a glob-like syntax to match multiples file, for example::
-
- scripts/* = {script}
-
-Will match all the files in the scripts directory and placed them in the script category.
-
-Glob tokens are:
-
- * ``*``: match all files.
- * ``?``: match any character.
- * ``**``: match any level of tree recursion (even 0).
- * ``{}``: will match any part separated by comma (example: ``{sh,bat}``).
-
-.. TODO Add examples
-
-Order of declaration
-''''''''''''''''''''
-
-The order of declaration is important if one file match multiple rules. The last
-rules matched by file is used, this is useful if you have this source tree::
-
- foo/
- doc/
- index.rst
- setup.rst
- documentation.txt
- doc.tex
- README
-
-And you want all the files in the doc directory to be placed in {doc} category,
-but README must be placed in {help} category, instead of listing all the files
-one by one, you can declare them in this way::
-
- [files]
- resources =
- doc/* = {doc}
- doc/README = {help}
-
-Exclude
-'''''''
-
-You can exclude some files of resources declaration by giving no destination, it
-can be useful if you have a non-resources file in the same directory of
-resources files::
-
- foo/
- doc/
- RELEASES
- doc.tex
- documentation.txt
- docu.rst
-
-Your **files** section will be::
-
- [files]
- resources =
- doc/* = {doc}
- doc/RELEASES =
-
-More control on destination part
-""""""""""""""""""""""""""""""""
-
-.. _setupcfg-resources-base-prefix:
-
-Defining a base prefix
-''''''''''''''''''''''
-
-When you define your resources, you can have more control of how the final path
-is computed.
-
-By default, the final path is::
-
- destination + source
-
-This can generate long paths, for example (example_final_path_)::
-
- {datadir}/doc/foo/doc/doc.man
-
-When you declare your source, you can use whitespace to split the source in
-**prefix** **suffix**. So, for example, if you have this source::
-
- docs/ doc.man
-
-The **prefix** is "docs/" and the **suffix** is "doc.html".
-
-.. note::
-
- Separator can be placed after a path separator or replace it. So these two
- sources are equivalent::
-
- docs/ doc.man
- docs doc.man
-
-.. note::
-
- Glob syntax is working the same way with standard source and split source.
- So these rules::
-
- docs/*
- docs/ *
- docs *
-
- Will match all the files in the docs directory.
-
-When you use split source, the final path is computed this way::
-
- destination + prefix
-
-So for example, if you have this setup.cfg::
-
- [metadata]
- name = foo
-
- [files]
- resources =
- doc/ doc.man = {doc}
-
-And if **{doc}** is replaced by **{datadir}/doc/{distribution.name}**, final
-path will be::
-
- {datadir}/doc/foo/doc.man
-
-
-Overwriting paths for categories
-""""""""""""""""""""""""""""""""
-
-This part is intended for system administrators or downstream OS packagers.
-
-The real paths of categories are registered in the *sysconfig.cfg* file
-installed in your python installation. This file uses an ini format too.
-The content of the file is organized into several sections:
-
-* globals: Standard categories's paths.
-* posix_prefix: Standard paths for categories and installation paths for posix
- system.
-* other ones XXX
-
-Standard categories paths are platform independent, they generally refers to
-other categories, which are platform dependent. :mod:`sysconfig` will choose
-these category from sections matching os.name. For example::
-
- doc = {datadir}/doc/{distribution.name}
-
-It refers to datadir category, which can be different between platforms. In
-posix system, it may be::
-
- datadir = /usr/share
-
-So the final path will be::
-
- doc = /usr/share/doc/{distribution.name}
-
-The platform-dependent categories are:
-
-* confdir
-* datadir
-* libdir
-* base
-
-
-Defining extra categories
-"""""""""""""""""""""""""
-
-.. TODO
-
-
-Examples
-""""""""
-
-These examples are incremental but work unitarily.
-
-Resources in root dir
-'''''''''''''''''''''
-
-Source tree::
-
- babar-1.0/
- README
- babar.sh
- launch.sh
- babar.py
-
-:file:`setup.cfg`::
-
- [files]
- resources =
- README = {doc}
- *.sh = {scripts}
-
-So babar.sh and launch.sh will be placed in {scripts} directory.
-
-Now let's move all the scripts into a scripts directory.
-
-Resources in sub-directory
-''''''''''''''''''''''''''
-
-Source tree::
-
- babar-1.1/
- README
- scripts/
- babar.sh
- launch.sh
- LAUNCH
- babar.py
-
-:file:`setup.cfg`::
-
- [files]
- resources =
- README = {doc}
- scripts/ LAUNCH = {doc}
- scripts/ *.sh = {scripts}
-
-It's important to use the separator after scripts/ to install all the shell
-scripts into {scripts} instead of {scripts}/scripts.
-
-Now let's add some docs.
-
-Resources in multiple sub-directories
-'''''''''''''''''''''''''''''''''''''
-
-Source tree::
-
- babar-1.2/
- README
- scripts/
- babar.sh
- launch.sh
- LAUNCH
- docs/
- api
- man
- babar.py
-
-:file:`setup.cfg`::
-
- [files]
- resources =
- README = {doc}
- scripts/ LAUNCH = {doc}
- scripts/ *.sh = {scripts}
- doc/ * = {doc}
- doc/ man = {man}
-
-You want to place all the file in the docs script into {doc} category, instead
-of man, which must be placed into {man} category, we will use the order of
-declaration of globs to choose the destination, the last glob that match the
-file is used.
-
-Now let's add some scripts for windows users.
-
-Complete example
-''''''''''''''''
-
-Source tree::
-
- babar-1.3/
- README
- doc/
- api
- man
- scripts/
- babar.sh
- launch.sh
- babar.bat
- launch.bat
- LAUNCH
-
-:file:`setup.cfg`::
-
- [files]
- resources =
- README = {doc}
- scripts/ LAUNCH = {doc}
- scripts/ *.{sh,bat} = {scripts}
- doc/ * = {doc}
- doc/ man = {man}
-
-We use brace expansion syntax to place all the shell and batch scripts into
-{scripts} category.
-
-
-.. _setupcfg-section-extensions:
-
-Extension modules sections
---------------------------
-
-If a project includes extension modules written in C or C++, each one of them
-needs to have its options defined in a dedicated section. Here's an example::
-
- [files]
- packages = coconut
-
- [extension: coconut._fastcoconut]
- language = cxx
- sources = cxx_src/cononut_utils.cxx
- cxx_src/python_module.cxx
- include_dirs = /usr/include/gecode
- /usr/include/blitz
- extra_compile_args =
- -fPIC -O2
- -DGECODE_VERSION=$(./gecode_version) -- sys.platform != 'win32'
- /DGECODE_VERSION=win32 -- sys.platform == 'win32'
-
-The section name must start with ``extension:``; the right-hand part is used as
-the full name (including a parent package, if any) of the extension. Whitespace
-around the extension name is allowed. If the extension module is not standalone
-(e.g. ``_bisect``) but part of a package (e.g. ``thing._speedups``), the parent
-package must be listed in the ``packages`` field.
-Valid fields and their values are listed in the documentation of the
-:class:`packaging.compiler.extension.Extension` class; values documented as
-Python lists translate to multi-line values in the configuration file. In
-addition, multi-line values accept environment markers on each line, after a
-``--``.
-
-
-.. _setupcfg-section-commands:
-
-Commands sections
------------------
-
-To pass options to commands without having to type them on the command line
-for each invocation, you can write them in the :file:`setup.cfg` file, in a
-section named after the command. Example::
-
- [sdist]
- # special function to add custom files
- manifest-builders = package.setup.list_extra_files
-
- [build]
- use-2to3 = True
-
- [build_ext]
- inplace = on
-
- [check]
- strict = on
- all = on
-
-Option values given in the configuration file can be overriden on the command
-line. See :ref:`packaging-setup-config` for more information.
-
-These sections are also used to define :ref:`command hooks
-`.
-
-
-.. _setupcfg-extensibility:
-
-Extensibility
-=============
-
-Every section can have fields that are not part of this specification. They are
-called **extensions**.
-
-An extension field starts with ``X-``. Example::
-
- [metadata]
- name = Distribute
- X-Debian-Name = python-distribute
-
-
-.. _setupcfg-changes:
-
-Changes in the specification
-============================
-
-The versioning scheme for this specification is **MAJOR.MINOR**. Changes in the
-specification will cause the version number to be updated.
-
-Changes to the minor number reflect backwards-compatible changes:
-
-- New fields and sections (optional or mandatory) can be added.
-- Optional fields can be removed.
-
-The major number will be incremented for backwards-incompatible changes:
-
-- Mandatory fields or sections are removed.
-- Fields change their meaning.
-
-As a consequence, a tool written to consume 1.5 has these properties:
-
-- Can read 1.1, 1.2 and all versions < 1.5, since the tool knows what
- optional fields weren't there.
-
- .. XXX clarify
-
-- Can also read 1.6 and other 1.x versions: The tool will just ignore fields it
- doesn't know about, even if they are mandatory in the new version. If
- optional fields were removed, the tool will just consider them absent.
-
-- Cannot read 2.x and should refuse to interpret such files.
-
-A tool written to produce 1.x should have these properties:
-
-- Writes all mandatory fields.
-- May write optional fields.
-
-
-.. _setupcfg-acks:
-
-Acknowledgments
-===============
-
-This specification includes work and feedback from these people:
-
-- Tarek Ziadé
-- Julien Jehannet
-- Boris Feld
-- Éric Araujo
-
-(If your name is missing, please :ref:`let us know `.)
diff --git a/Doc/packaging/setupscript.rst b/Doc/packaging/setupscript.rst
deleted file mode 100644
index cafde20e54..0000000000
--- a/Doc/packaging/setupscript.rst
+++ /dev/null
@@ -1,693 +0,0 @@
-.. _packaging-setup-script:
-
-************************
-Writing the Setup Script
-************************
-
-The setup script is the center of all activity in building, distributing, and
-installing modules using Distutils. The main purpose of the setup script is
-to describe your module distribution to Distutils, so that the various
-commands that operate on your modules do the right thing. As we saw in section
-:ref:`packaging-simple-example`, the setup script consists mainly of a
-call to :func:`setup` where the most information is supplied as
-keyword arguments to :func:`setup`.
-
-Here's a slightly more involved example, which we'll follow for the next couple
-of sections: a setup script that could be used for Packaging itself::
-
- #!/usr/bin/env python
-
- from packaging.core import setup, find_packages
-
- setup(name='Packaging',
- version='1.0',
- summary='Python Distribution Utilities',
- keywords=['packaging', 'packaging'],
- author=u'Tarek Ziadé',
- author_email='tarek@ziade.org',
- home_page='http://bitbucket.org/tarek/packaging/wiki/Home',
- license='PSF',
- packages=find_packages())
-
-
-There are only two differences between this and the trivial one-file
-distribution presented in section :ref:`packaging-simple-example`: more
-metadata and the specification of pure Python modules by package rather than
-by module. This is important since Ristutils consist of a couple of dozen
-modules split into (so far) two packages; an explicit list of every module
-would be tedious to generate and difficult to maintain. For more information
-on the additional metadata, see section :ref:`packaging-metadata`.
-
-Note that any pathnames (files or directories) supplied in the setup script
-should be written using the Unix convention, i.e. slash-separated. The
-Distutils will take care of converting this platform-neutral representation into
-whatever is appropriate on your current platform before actually using the
-pathname. This makes your setup script portable across operating systems, which
-of course is one of the major goals of the Distutils. In this spirit, all
-pathnames in this document are slash-separated.
-
-This, of course, only applies to pathnames given to Distutils functions. If
-you, for example, use standard Python functions such as :func:`glob.glob` or
-:func:`os.listdir` to specify files, you should be careful to write portable
-code instead of hardcoding path separators::
-
- glob.glob(os.path.join('mydir', 'subdir', '*.html'))
- os.listdir(os.path.join('mydir', 'subdir'))
-
-
-.. _packaging-listing-packages:
-
-Listing whole packages
-======================
-
-The :option:`packages` option tells the Distutils to process (build, distribute,
-install, etc.) all pure Python modules found in each package mentioned in the
-:option:`packages` list. In order to do this, of course, there has to be a
-correspondence between package names and directories in the filesystem. The
-default correspondence is the most obvious one, i.e. package :mod:`packaging` is
-found in the directory :file:`packaging` relative to the distribution root.
-Thus, when you say ``packages = ['foo']`` in your setup script, you are
-promising that the Distutils will find a file :file:`foo/__init__.py` (which
-might be spelled differently on your system, but you get the idea) relative to
-the directory where your setup script lives. If you break this promise, the
-Distutils will issue a warning but still process the broken package anyway.
-
-If you use a different convention to lay out your source directory, that's no
-problem: you just have to supply the :option:`package_dir` option to tell the
-Distutils about your convention. For example, say you keep all Python source
-under :file:`lib`, so that modules in the "root package" (i.e., not in any
-package at all) are in :file:`lib`, modules in the :mod:`foo` package are in
-:file:`lib/foo`, and so forth. Then you would put ::
-
- package_dir = {'': 'lib'}
-
-in your setup script. The keys to this dictionary are package names, and an
-empty package name stands for the root package. The values are directory names
-relative to your distribution root. In this case, when you say ``packages =
-['foo']``, you are promising that the file :file:`lib/foo/__init__.py` exists.
-
-Another possible convention is to put the :mod:`foo` package right in
-:file:`lib`, the :mod:`foo.bar` package in :file:`lib/bar`, etc. This would be
-written in the setup script as ::
-
- package_dir = {'foo': 'lib'}
-
-A ``package: dir`` entry in the :option:`package_dir` dictionary implicitly
-applies to all packages below *package*, so the :mod:`foo.bar` case is
-automatically handled here. In this example, having ``packages = ['foo',
-'foo.bar']`` tells the Distutils to look for :file:`lib/__init__.py` and
-:file:`lib/bar/__init__.py`. (Keep in mind that although :option:`package_dir`
-applies recursively, you must explicitly list all packages in
-:option:`packages`: the Distutils will *not* recursively scan your source tree
-looking for any directory with an :file:`__init__.py` file.)
-
-
-.. _packaging-listing-modules:
-
-Listing individual modules
-==========================
-
-For a small module distribution, you might prefer to list all modules rather
-than listing packages---especially the case of a single module that goes in the
-"root package" (i.e., no package at all). This simplest case was shown in
-section :ref:`packaging-simple-example`; here is a slightly more involved
-example::
-
- py_modules = ['mod1', 'pkg.mod2']
-
-This describes two modules, one of them in the "root" package, the other in the
-:mod:`pkg` package. Again, the default package/directory layout implies that
-these two modules can be found in :file:`mod1.py` and :file:`pkg/mod2.py`, and
-that :file:`pkg/__init__.py` exists as well. And again, you can override the
-package/directory correspondence using the :option:`package_dir` option.
-
-
-.. _packaging-describing-extensions:
-
-Describing extension modules
-============================
-
-Just as writing Python extension modules is a bit more complicated than writing
-pure Python modules, describing them to the Distutils is a bit more complicated.
-Unlike pure modules, it's not enough just to list modules or packages and expect
-the Distutils to go out and find the right files; you have to specify the
-extension name, source file(s), and any compile/link requirements (include
-directories, libraries to link with, etc.).
-
-.. XXX read over this section
-
-All of this is done through another keyword argument to :func:`setup`, the
-:option:`ext_modules` option. :option:`ext_modules` is just a list of
-:class:`Extension` instances, each of which describes a single extension module.
-Suppose your distribution includes a single extension, called :mod:`foo` and
-implemented by :file:`foo.c`. If no additional instructions to the
-compiler/linker are needed, describing this extension is quite simple::
-
- Extension('foo', ['foo.c'])
-
-The :class:`Extension` class can be imported from :mod:`packaging.core` along
-with :func:`setup`. Thus, the setup script for a module distribution that
-contains only this one extension and nothing else might be::
-
- from packaging.core import setup, Extension
- setup(name='foo',
- version='1.0',
- ext_modules=[Extension('foo', ['foo.c'])])
-
-The :class:`Extension` class (actually, the underlying extension-building
-machinery implemented by the :command:`build_ext` command) supports a great deal
-of flexibility in describing Python extensions, which is explained in the
-following sections.
-
-
-Extension names and packages
-----------------------------
-
-The first argument to the :class:`Extension` constructor is always the name of
-the extension, including any package names. For example, ::
-
- Extension('foo', ['src/foo1.c', 'src/foo2.c'])
-
-describes an extension that lives in the root package, while ::
-
- Extension('pkg.foo', ['src/foo1.c', 'src/foo2.c'])
-
-describes the same extension in the :mod:`pkg` package. The source files and
-resulting object code are identical in both cases; the only difference is where
-in the filesystem (and therefore where in Python's namespace hierarchy) the
-resulting extension lives.
-
-If your distribution contains only one or more extension modules in a package,
-you need to create a :file:`{package}/__init__.py` file anyway, otherwise Python
-won't be able to import anything.
-
-If you have a number of extensions all in the same package (or all under the
-same base package), use the :option:`ext_package` keyword argument to
-:func:`setup`. For example, ::
-
- setup(...,
- ext_package='pkg',
- ext_modules=[Extension('foo', ['foo.c']),
- Extension('subpkg.bar', ['bar.c'])])
-
-will compile :file:`foo.c` to the extension :mod:`pkg.foo`, and :file:`bar.c` to
-:mod:`pkg.subpkg.bar`.
-
-
-Extension source files
-----------------------
-
-The second argument to the :class:`Extension` constructor is a list of source
-files. Since the Distutils currently only support C, C++, and Objective-C
-extensions, these are normally C/C++/Objective-C source files. (Be sure to use
-appropriate extensions to distinguish C++\ source files: :file:`.cc` and
-:file:`.cpp` seem to be recognized by both Unix and Windows compilers.)
-
-However, you can also include SWIG interface (:file:`.i`) files in the list; the
-:command:`build_ext` command knows how to deal with SWIG extensions: it will run
-SWIG on the interface file and compile the resulting C/C++ file into your
-extension.
-
-.. XXX SWIG support is rough around the edges and largely untested!
-
-This warning notwithstanding, options to SWIG can be currently passed like
-this::
-
- setup(...,
- ext_modules=[Extension('_foo', ['foo.i'],
- swig_opts=['-modern', '-I../include'])],
- py_modules=['foo'])
-
-Or on the command line like this::
-
- > python setup.py build_ext --swig-opts="-modern -I../include"
-
-On some platforms, you can include non-source files that are processed by the
-compiler and included in your extension. Currently, this just means Windows
-message text (:file:`.mc`) files and resource definition (:file:`.rc`) files for
-Visual C++. These will be compiled to binary resource (:file:`.res`) files and
-linked into the executable.
-
-
-Preprocessor options
---------------------
-
-Three optional arguments to :class:`Extension` will help if you need to specify
-include directories to search or preprocessor macros to define/undefine:
-``include_dirs``, ``define_macros``, and ``undef_macros``.
-
-For example, if your extension requires header files in the :file:`include`
-directory under your distribution root, use the ``include_dirs`` option::
-
- Extension('foo', ['foo.c'], include_dirs=['include'])
-
-You can specify absolute directories there; if you know that your extension will
-only be built on Unix systems with X11R6 installed to :file:`/usr`, you can get
-away with ::
-
- Extension('foo', ['foo.c'], include_dirs=['/usr/include/X11'])
-
-You should avoid this sort of non-portable usage if you plan to distribute your
-code: it's probably better to write C code like ::
-
- #include
-
-If you need to include header files from some other Python extension, you can
-take advantage of the fact that header files are installed in a consistent way
-by the Distutils :command:`install_header` command. For example, the Numerical
-Python header files are installed (on a standard Unix installation) to
-:file:`/usr/local/include/python1.5/Numerical`. (The exact location will differ
-according to your platform and Python installation.) Since the Python include
-directory---\ :file:`/usr/local/include/python1.5` in this case---is always
-included in the search path when building Python extensions, the best approach
-is to write C code like ::
-
- #include
-
-.. TODO check if it's d2.sysconfig or the new sysconfig module now
-
-If you must put the :file:`Numerical` include directory right into your header
-search path, though, you can find that directory using the Distutils
-:mod:`packaging.sysconfig` module::
-
- from packaging.sysconfig import get_python_inc
- incdir = os.path.join(get_python_inc(plat_specific=1), 'Numerical')
- setup(...,
- Extension(..., include_dirs=[incdir]))
-
-Even though this is quite portable---it will work on any Python installation,
-regardless of platform---it's probably easier to just write your C code in the
-sensible way.
-
-You can define and undefine preprocessor macros with the ``define_macros`` and
-``undef_macros`` options. ``define_macros`` takes a list of ``(name, value)``
-tuples, where ``name`` is the name of the macro to define (a string) and
-``value`` is its value: either a string or ``None``. (Defining a macro ``FOO``
-to ``None`` is the equivalent of a bare ``#define FOO`` in your C source: with
-most compilers, this sets ``FOO`` to the string ``1``.) ``undef_macros`` is
-just a list of macros to undefine.
-
-For example::
-
- Extension(...,
- define_macros=[('NDEBUG', '1'),
- ('HAVE_STRFTIME', None)],
- undef_macros=['HAVE_FOO', 'HAVE_BAR'])
-
-is the equivalent of having this at the top of every C source file::
-
- #define NDEBUG 1
- #define HAVE_STRFTIME
- #undef HAVE_FOO
- #undef HAVE_BAR
-
-
-Library options
----------------
-
-You can also specify the libraries to link against when building your extension,
-and the directories to search for those libraries. The ``libraries`` option is
-a list of libraries to link against, ``library_dirs`` is a list of directories
-to search for libraries at link-time, and ``runtime_library_dirs`` is a list of
-directories to search for shared (dynamically loaded) libraries at run-time.
-
-For example, if you need to link against libraries known to be in the standard
-library search path on target systems ::
-
- Extension(...,
- libraries=['gdbm', 'readline'])
-
-If you need to link with libraries in a non-standard location, you'll have to
-include the location in ``library_dirs``::
-
- Extension(...,
- library_dirs=['/usr/X11R6/lib'],
- libraries=['X11', 'Xt'])
-
-(Again, this sort of non-portable construct should be avoided if you intend to
-distribute your code.)
-
-.. XXX Should mention clib libraries here or somewhere else!
-
-
-Other options
--------------
-
-There are still some other options which can be used to handle special cases.
-
-The :option:`optional` option is a boolean; if it is true,
-a build failure in the extension will not abort the build process, but
-instead simply not install the failing extension.
-
-The :option:`extra_objects` option is a list of object files to be passed to the
-linker. These files must not have extensions, as the default extension for the
-compiler is used.
-
-:option:`extra_compile_args` and :option:`extra_link_args` can be used to
-specify additional command-line options for the respective compiler and linker
-command lines.
-
-:option:`export_symbols` is only useful on Windows. It can contain a list of
-symbols (functions or variables) to be exported. This option is not needed when
-building compiled extensions: Distutils will automatically add ``initmodule``
-to the list of exported symbols.
-
-The :option:`depends` option is a list of files that the extension depends on
-(for example header files). The build command will call the compiler on the
-sources to rebuild extension if any on this files has been modified since the
-previous build.
-
-Relationships between Distributions and Packages
-================================================
-
-.. FIXME rewrite to update to PEP 345 (but without dist/release confusion)
-
-A distribution may relate to packages in three specific ways:
-
-#. It can require packages or modules.
-
-#. It can provide packages or modules.
-
-#. It can obsolete packages or modules.
-
-These relationships can be specified using keyword arguments to the
-:func:`packaging.core.setup` function.
-
-Dependencies on other Python modules and packages can be specified by supplying
-the *requires* keyword argument to :func:`setup`. The value must be a list of
-strings. Each string specifies a package that is required, and optionally what
-versions are sufficient.
-
-To specify that any version of a module or package is required, the string
-should consist entirely of the module or package name. Examples include
-``'mymodule'`` and ``'xml.parsers.expat'``.
-
-If specific versions are required, a sequence of qualifiers can be supplied in
-parentheses. Each qualifier may consist of a comparison operator and a version
-number. The accepted comparison operators are::
-
- < > ==
- <= >= !=
-
-These can be combined by using multiple qualifiers separated by commas (and
-optional whitespace). In this case, all of the qualifiers must be matched; a
-logical AND is used to combine the evaluations.
-
-Let's look at a bunch of examples:
-
-+-------------------------+----------------------------------------------+
-| Requires Expression | Explanation |
-+=========================+==============================================+
-| ``==1.0`` | Only version ``1.0`` is compatible |
-+-------------------------+----------------------------------------------+
-| ``>1.0, !=1.5.1, <2.0`` | Any version after ``1.0`` and before ``2.0`` |
-| | is compatible, except ``1.5.1`` |
-+-------------------------+----------------------------------------------+
-
-Now that we can specify dependencies, we also need to be able to specify what we
-provide that other distributions can require. This is done using the *provides*
-keyword argument to :func:`setup`. The value for this keyword is a list of
-strings, each of which names a Python module or package, and optionally
-identifies the version. If the version is not specified, it is assumed to match
-that of the distribution.
-
-Some examples:
-
-+---------------------+----------------------------------------------+
-| Provides Expression | Explanation |
-+=====================+==============================================+
-| ``mypkg`` | Provide ``mypkg``, using the distribution |
-| | version |
-+---------------------+----------------------------------------------+
-| ``mypkg (1.1)`` | Provide ``mypkg`` version 1.1, regardless of |
-| | the distribution version |
-+---------------------+----------------------------------------------+
-
-A package can declare that it obsoletes other packages using the *obsoletes*
-keyword argument. The value for this is similar to that of the *requires*
-keyword: a list of strings giving module or package specifiers. Each specifier
-consists of a module or package name optionally followed by one or more version
-qualifiers. Version qualifiers are given in parentheses after the module or
-package name.
-
-The versions identified by the qualifiers are those that are obsoleted by the
-distribution being described. If no qualifiers are given, all versions of the
-named module or package are understood to be obsoleted.
-
-.. _packaging-installing-scripts:
-
-Installing Scripts
-==================
-
-So far we have been dealing with pure and non-pure Python modules, which are
-usually not run by themselves but imported by scripts.
-
-Scripts are files containing Python source code, intended to be started from the
-command line. Scripts don't require Distutils to do anything very complicated.
-The only clever feature is that if the first line of the script starts with
-``#!`` and contains the word "python", the Distutils will adjust the first line
-to refer to the current interpreter location. By default, it is replaced with
-the current interpreter location. The :option:`--executable` (or :option:`-e`)
-option will allow the interpreter path to be explicitly overridden.
-
-The :option:`scripts` option simply is a list of files to be handled in this
-way. From the PyXML setup script::
-
- setup(...,
- scripts=['scripts/xmlproc_parse', 'scripts/xmlproc_val'])
-
-All the scripts will also be added to the ``MANIFEST`` file if no template is
-provided. See :ref:`packaging-manifest`.
-
-.. _packaging-installing-package-data:
-
-Installing Package Data
-=======================
-
-Often, additional files need to be installed into a package. These files are
-often data that's closely related to the package's implementation, or text files
-containing documentation that might be of interest to programmers using the
-package. These files are called :dfn:`package data`.
-
-Package data can be added to packages using the ``package_data`` keyword
-argument to the :func:`setup` function. The value must be a mapping from
-package name to a list of relative path names that should be copied into the
-package. The paths are interpreted as relative to the directory containing the
-package (information from the ``package_dir`` mapping is used if appropriate);
-that is, the files are expected to be part of the package in the source
-directories. They may contain glob patterns as well.
-
-The path names may contain directory portions; any necessary directories will be
-created in the installation.
-
-For example, if a package should contain a subdirectory with several data files,
-the files can be arranged like this in the source tree::
-
- setup.py
- src/
- mypkg/
- __init__.py
- module.py
- data/
- tables.dat
- spoons.dat
- forks.dat
-
-The corresponding call to :func:`setup` might be::
-
- setup(...,
- packages=['mypkg'],
- package_dir={'mypkg': 'src/mypkg'},
- package_data={'mypkg': ['data/*.dat']})
-
-
-All the files that match ``package_data`` will be added to the ``MANIFEST``
-file if no template is provided. See :ref:`packaging-manifest`.
-
-
-.. _packaging-additional-files:
-
-Installing Additional Files
-===========================
-
-The :option:`data_files` option can be used to specify additional files needed
-by the module distribution: configuration files, message catalogs, data files,
-anything which doesn't fit in the previous categories.
-
-:option:`data_files` specifies a sequence of (*directory*, *files*) pairs in the
-following way::
-
- setup(...,
- data_files=[('bitmaps', ['bm/b1.gif', 'bm/b2.gif']),
- ('config', ['cfg/data.cfg']),
- ('/etc/init.d', ['init-script'])])
-
-Note that you can specify the directory names where the data files will be
-installed, but you cannot rename the data files themselves.
-
-Each (*directory*, *files*) pair in the sequence specifies the installation
-directory and the files to install there. If *directory* is a relative path, it
-is interpreted relative to the installation prefix (Python's ``sys.prefix`` for
-pure-Python packages, ``sys.exec_prefix`` for packages that contain extension
-modules). Each file name in *files* is interpreted relative to the
-:file:`setup.py` script at the top of the package source distribution. No
-directory information from *files* is used to determine the final location of
-the installed file; only the name of the file is used.
-
-You can specify the :option:`data_files` options as a simple sequence of files
-without specifying a target directory, but this is not recommended, and the
-:command:`install_dist` command will print a warning in this case. To install data
-files directly in the target directory, an empty string should be given as the
-directory.
-
-All the files that match ``data_files`` will be added to the ``MANIFEST`` file
-if no template is provided. See :ref:`packaging-manifest`.
-
-
-
-.. _packaging-metadata:
-
-Metadata reference
-==================
-
-The setup script may include additional metadata beyond the name and version.
-This table describes required and additional information:
-
-.. TODO synchronize with setupcfg; link to it (but don't remove it, it's a
- useful summary)
-
-+----------------------+---------------------------+-----------------+--------+
-| Meta-Data | Description | Value | Notes |
-+======================+===========================+=================+========+
-| ``name`` | name of the project | short string | \(1) |
-+----------------------+---------------------------+-----------------+--------+
-| ``version`` | version of this release | short string | (1)(2) |
-+----------------------+---------------------------+-----------------+--------+
-| ``author`` | project author's name | short string | \(3) |
-+----------------------+---------------------------+-----------------+--------+
-| ``author_email`` | email address of the | email address | \(3) |
-| | project author | | |
-+----------------------+---------------------------+-----------------+--------+
-| ``maintainer`` | project maintainer's name | short string | \(3) |
-+----------------------+---------------------------+-----------------+--------+
-| ``maintainer_email`` | email address of the | email address | \(3) |
-| | project maintainer | | |
-+----------------------+---------------------------+-----------------+--------+
-| ``home_page`` | home page for the project | URL | \(1) |
-+----------------------+---------------------------+-----------------+--------+
-| ``summary`` | short description of the | short string | |
-| | project | | |
-+----------------------+---------------------------+-----------------+--------+
-| ``description`` | longer description of the | long string | \(5) |
-| | project | | |
-+----------------------+---------------------------+-----------------+--------+
-| ``download_url`` | location where the | URL | |
-| | project may be downloaded | | |
-+----------------------+---------------------------+-----------------+--------+
-| ``classifiers`` | a list of classifiers | list of strings | \(4) |
-+----------------------+---------------------------+-----------------+--------+
-| ``platforms`` | a list of platforms | list of strings | |
-+----------------------+---------------------------+-----------------+--------+
-| ``license`` | license for the release | short string | \(6) |
-+----------------------+---------------------------+-----------------+--------+
-
-Notes:
-
-(1)
- These fields are required.
-
-(2)
- It is recommended that versions take the form *major.minor[.patch[.sub]]*.
-
-(3)
- Either the author or the maintainer must be identified.
-
-(4)
- The list of classifiers is available from the `PyPI website
- `_. See also :mod:`packaging.create`.
-
-(5)
- The ``description`` field is used by PyPI when you are registering a
- release, to build its PyPI page.
-
-(6)
- The ``license`` field is a text indicating the license covering the
- distribution where the license is not a selection from the "License" Trove
- classifiers. See the ``Classifier`` field. Notice that
- there's a ``licence`` distribution option which is deprecated but still
- acts as an alias for ``license``.
-
-'short string'
- A single line of text, not more than 200 characters.
-
-'long string'
- Multiple lines of plain text in reStructuredText format (see
- http://docutils.sf.net/).
-
-'list of strings'
- See below.
-
-In Python 2.x, "string value" means a unicode object. If a byte string (str or
-bytes) is given, it has to be valid ASCII.
-
-.. TODO move this section to the version document, keep a summary, add a link
-
-Encoding the version information is an art in itself. Python projects generally
-adhere to the version format *major.minor[.patch][sub]*. The major number is 0
-for initial, experimental releases of software. It is incremented for releases
-that represent major milestones in a project. The minor number is incremented
-when important new features are added to the project. The patch number
-increments when bug-fix releases are made. Additional trailing version
-information is sometimes used to indicate sub-releases. These are
-"a1,a2,...,aN" (for alpha releases, where functionality and API may change),
-"b1,b2,...,bN" (for beta releases, which only fix bugs) and "pr1,pr2,...,prN"
-(for final pre-release release testing). Some examples:
-
-0.1.0
- the first, experimental release of a project
-
-1.0.1a2
- the second alpha release of the first patch version of 1.0
-
-:option:`classifiers` are specified in a Python list::
-
- setup(...,
- classifiers=[
- 'Development Status :: 4 - Beta',
- 'Environment :: Console',
- 'Environment :: Web Environment',
- 'Intended Audience :: End Users/Desktop',
- 'Intended Audience :: Developers',
- 'Intended Audience :: System Administrators',
- 'License :: OSI Approved :: Python Software Foundation License',
- 'Operating System :: MacOS :: MacOS X',
- 'Operating System :: Microsoft :: Windows',
- 'Operating System :: POSIX',
- 'Programming Language :: Python',
- 'Topic :: Communications :: Email',
- 'Topic :: Office/Business',
- 'Topic :: Software Development :: Bug Tracking',
- ])
-
-
-Debugging the setup script
-==========================
-
-Sometimes things go wrong, and the setup script doesn't do what the developer
-wants.
-
-Distutils catches any exceptions when running the setup script, and print a
-simple error message before the script is terminated. The motivation for this
-behaviour is to not confuse administrators who don't know much about Python and
-are trying to install a project. If they get a big long traceback from deep
-inside the guts of Distutils, they may think the project or the Python
-installation is broken because they don't read all the way down to the bottom
-and see that it's a permission problem.
-
-.. FIXME DISTUTILS_DEBUG is dead, document logging/warnings here
-
-On the other hand, this doesn't help the developer to find the cause of the
-failure. For this purpose, the DISTUTILS_DEBUG environment variable can be set
-to anything except an empty string, and Packaging will now print detailed
-information about what it is doing, and prints the full traceback in case an
-exception occurs.
diff --git a/Doc/packaging/sourcedist.rst b/Doc/packaging/sourcedist.rst
deleted file mode 100644
index 2cedc15ea9..0000000000
--- a/Doc/packaging/sourcedist.rst
+++ /dev/null
@@ -1,266 +0,0 @@
-.. _packaging-source-dist:
-
-******************************
-Creating a Source Distribution
-******************************
-
-As shown in section :ref:`packaging-simple-example`, you use the :command:`sdist` command
-to create a source distribution. In the simplest case, ::
-
- python setup.py sdist
-
-(assuming you haven't specified any :command:`sdist` options in the setup script
-or config file), :command:`sdist` creates the archive of the default format for
-the current platform. The default format is a gzip'ed tar file
-(:file:`.tar.gz`) on Unix, and ZIP file on Windows.
-
-You can specify as many formats as you like using the :option:`--formats`
-option, for example::
-
- python setup.py sdist --formats=gztar,zip
-
-to create a gzipped tarball and a zip file. The available formats are:
-
-+-----------+-------------------------+---------+
-| Format | Description | Notes |
-+===========+=========================+=========+
-| ``zip`` | zip file (:file:`.zip`) | (1),(3) |
-+-----------+-------------------------+---------+
-| ``gztar`` | gzip'ed tar file | \(2) |
-| | (:file:`.tar.gz`) | |
-+-----------+-------------------------+---------+
-| ``bztar`` | bzip2'ed tar file | |
-| | (:file:`.tar.bz2`) | |
-+-----------+-------------------------+---------+
-| ``tar`` | tar file (:file:`.tar`) | |
-+-----------+-------------------------+---------+
-
-Notes:
-
-(1)
- default on Windows
-
-(2)
- default on Unix
-
-(3)
- requires either external :program:`zip` utility or :mod:`zipfile` module (part
- of the standard Python library since Python 1.6)
-
-When using any ``tar`` format (``gztar``, ``bztar`` or
-``tar``) under Unix, you can specify the ``owner`` and ``group`` names
-that will be set for each member of the archive.
-
-For example, if you want all files of the archive to be owned by root::
-
- python setup.py sdist --owner=root --group=root
-
-
-.. _packaging-manifest:
-
-Specifying the files to distribute
-==================================
-
-If you don't supply an explicit list of files (or instructions on how to
-generate one), the :command:`sdist` command puts a minimal default set into the
-source distribution:
-
-* all Python source files implied by the :option:`py_modules` and
- :option:`packages` options
-
-* all C source files mentioned in the :option:`ext_modules` or
- :option:`libraries` options
-
-* scripts identified by the :option:`scripts` option
- See :ref:`packaging-installing-scripts`.
-
-* anything that looks like a test script: :file:`test/test\*.py` (currently, the
- Packaging don't do anything with test scripts except include them in source
- distributions, but in the future there will be a standard for testing Python
- module distributions)
-
-* the configuration file :file:`setup.cfg`
-
-* all files that matches the ``package_data`` metadata.
- See :ref:`packaging-installing-package-data`.
-
-* all files that matches the ``data_files`` metadata.
- See :ref:`packaging-additional-files`.
-
-Contrary to Distutils, :file:`README` (or :file:`README.txt`) and
-:file:`setup.py` are not included by default.
-
-Sometimes this is enough, but usually you will want to specify additional files
-to distribute. The typical way to do this is to write a *manifest template*,
-called :file:`MANIFEST.in` by default. The manifest template is just a list of
-instructions for how to generate your manifest file, :file:`MANIFEST`, which is
-the exact list of files to include in your source distribution. The
-:command:`sdist` command processes this template and generates a manifest based
-on its instructions and what it finds in the filesystem.
-
-If you prefer to roll your own manifest file, the format is simple: one filename
-per line, regular files (or symlinks to them) only. If you do supply your own
-:file:`MANIFEST`, you must specify everything: the default set of files
-described above does not apply in this case.
-
-:file:`MANIFEST` files start with a comment indicating they are generated.
-Files without this comment are not overwritten or removed.
-
-See :ref:`packaging-manifest-template` section for a syntax reference.
-
-
-.. _packaging-manifest-options:
-
-Manifest-related options
-========================
-
-The normal course of operations for the :command:`sdist` command is as follows:
-
-* if the manifest file, :file:`MANIFEST` doesn't exist, read :file:`MANIFEST.in`
- and create the manifest
-
-* if neither :file:`MANIFEST` nor :file:`MANIFEST.in` exist, create a manifest
- with just the default file set
-
-* if either :file:`MANIFEST.in` or the setup script (:file:`setup.py`) are more
- recent than :file:`MANIFEST`, recreate :file:`MANIFEST` by reading
- :file:`MANIFEST.in`
-
-* use the list of files now in :file:`MANIFEST` (either just generated or read
- in) to create the source distribution archive(s)
-
-There are a couple of options that modify this behaviour. First, use the
-:option:`--no-defaults` and :option:`--no-prune` to disable the standard
-"include" and "exclude" sets.
-
-Second, you might just want to (re)generate the manifest, but not create a
-source distribution::
-
- python setup.py sdist --manifest-only
-
-:option:`-o` is a shortcut for :option:`--manifest-only`.
-
-
-.. _packaging-manifest-template:
-
-The MANIFEST.in template
-========================
-
-A :file:`MANIFEST.in` file can be added in a project to define the list of
-files to include in the distribution built by the :command:`sdist` command.
-
-When :command:`sdist` is run, it will look for the :file:`MANIFEST.in` file
-and interpret it to generate the :file:`MANIFEST` file that contains the
-list of files that will be included in the package.
-
-This mechanism can be used when the default list of files is not enough.
-(See :ref:`packaging-manifest`).
-
-Principle
----------
-
-The manifest template has one command per line, where each command specifies a
-set of files to include or exclude from the source distribution. For an
-example, let's look at the Packaging' own manifest template::
-
- include *.txt
- recursive-include examples *.txt *.py
- prune examples/sample?/build
-
-The meanings should be fairly clear: include all files in the distribution root
-matching :file:`\*.txt`, all files anywhere under the :file:`examples` directory
-matching :file:`\*.txt` or :file:`\*.py`, and exclude all directories matching
-:file:`examples/sample?/build`. All of this is done *after* the standard
-include set, so you can exclude files from the standard set with explicit
-instructions in the manifest template. (Or, you can use the
-:option:`--no-defaults` option to disable the standard set entirely.)
-
-The order of commands in the manifest template matters: initially, we have the
-list of default files as described above, and each command in the template adds
-to or removes from that list of files. Once we have fully processed the
-manifest template, we remove files that should not be included in the source
-distribution:
-
-* all files in the Packaging "build" tree (default :file:`build/`)
-
-* all files in directories named :file:`RCS`, :file:`CVS`, :file:`.svn`,
- :file:`.hg`, :file:`.git`, :file:`.bzr` or :file:`_darcs`
-
-Now we have our complete list of files, which is written to the manifest for
-future reference, and then used to build the source distribution archive(s).
-
-You can disable the default set of included files with the
-:option:`--no-defaults` option, and you can disable the standard exclude set
-with :option:`--no-prune`.
-
-Following the Packaging' own manifest template, let's trace how the
-:command:`sdist` command builds the list of files to include in the Packaging
-source distribution:
-
-#. include all Python source files in the :file:`packaging` and
- :file:`packaging/command` subdirectories (because packages corresponding to
- those two directories were mentioned in the :option:`packages` option in the
- setup script---see section :ref:`packaging-setup-script`)
-
-#. include :file:`README.txt`, :file:`setup.py`, and :file:`setup.cfg` (standard
- files)
-
-#. include :file:`test/test\*.py` (standard files)
-
-#. include :file:`\*.txt` in the distribution root (this will find
- :file:`README.txt` a second time, but such redundancies are weeded out later)
-
-#. include anything matching :file:`\*.txt` or :file:`\*.py` in the sub-tree
- under :file:`examples`,
-
-#. exclude all files in the sub-trees starting at directories matching
- :file:`examples/sample?/build`\ ---this may exclude files included by the
- previous two steps, so it's important that the ``prune`` command in the manifest
- template comes after the ``recursive-include`` command
-
-#. exclude the entire :file:`build` tree, and any :file:`RCS`, :file:`CVS`,
- :file:`.svn`, :file:`.hg`, :file:`.git`, :file:`.bzr` and :file:`_darcs`
- directories
-
-Just like in the setup script, file and directory names in the manifest template
-should always be slash-separated; the Packaging will take care of converting
-them to the standard representation on your platform. That way, the manifest
-template is portable across operating systems.
-
-Commands
---------
-
-The manifest template commands are:
-
-+-------------------------------------------+-----------------------------------------------+
-| Command | Description |
-+===========================================+===============================================+
-| :command:`include pat1 pat2 ...` | include all files matching any of the listed |
-| | patterns |
-+-------------------------------------------+-----------------------------------------------+
-| :command:`exclude pat1 pat2 ...` | exclude all files matching any of the listed |
-| | patterns |
-+-------------------------------------------+-----------------------------------------------+
-| :command:`recursive-include dir pat1 pat2 | include all files under *dir* matching any of |
-| ...` | the listed patterns |
-+-------------------------------------------+-----------------------------------------------+
-| :command:`recursive-exclude dir pat1 pat2 | exclude all files under *dir* matching any of |
-| ...` | the listed patterns |
-+-------------------------------------------+-----------------------------------------------+
-| :command:`global-include pat1 pat2 ...` | include all files anywhere in the source tree |
-| | matching --- & any of the listed patterns |
-+-------------------------------------------+-----------------------------------------------+
-| :command:`global-exclude pat1 pat2 ...` | exclude all files anywhere in the source tree |
-| | matching --- & any of the listed patterns |
-+-------------------------------------------+-----------------------------------------------+
-| :command:`prune dir` | exclude all files under *dir* |
-+-------------------------------------------+-----------------------------------------------+
-| :command:`graft dir` | include all files under *dir* |
-+-------------------------------------------+-----------------------------------------------+
-
-The patterns here are Unix-style "glob" patterns: ``*`` matches any sequence of
-regular filename characters, ``?`` matches any single regular filename
-character, and ``[range]`` matches any of the characters in *range* (e.g.,
-``a-z``, ``a-zA-Z``, ``a-f0-9_.``). The definition of "regular filename
-character" is platform-specific: on Unix it is anything except slash; on Windows
-anything except backslash or colon.
diff --git a/Doc/packaging/tutorial.rst b/Doc/packaging/tutorial.rst
deleted file mode 100644
index 04f41e519d..0000000000
--- a/Doc/packaging/tutorial.rst
+++ /dev/null
@@ -1,112 +0,0 @@
-==================
-Packaging tutorial
-==================
-
-Welcome to the Packaging tutorial! We will learn how to use Packaging
-to package your project.
-
-.. TODO merge with introduction.rst
-
-
-Getting started
----------------
-
-Packaging works with the *setup.cfg* file. It contains all the metadata for
-your project, as defined in PEP 345, but also declare what your project
-contains.
-
-Let's say you have a project called *CLVault* containing one package called
-*clvault*, and a few scripts inside. You can use the *pysetup* script to create
-a *setup.cfg* file for the project. The script will ask you a few questions::
-
- $ mkdir CLVault
- $ cd CLVault
- $ pysetup create
- Project name [CLVault]:
- Current version number: 0.1
- Package description:
- >Command-line utility to store and retrieve passwords
- Author name: Tarek Ziade
- Author e-mail address: tarek@ziade.org
- Project Home Page: http://bitbucket.org/tarek/clvault
- Do you want to add a package ? (y/n): y
- Package name: clvault
- Do you want to add a package ? (y/n): n
- Do you want to set Trove classifiers? (y/n): y
- Please select the project status:
-
- 1 - Planning
- 2 - Pre-Alpha
- 3 - Alpha
- 4 - Beta
- 5 - Production/Stable
- 6 - Mature
- 7 - Inactive
-
- Status: 3
- What license do you use: GPL
- Matching licenses:
-
- 1) License :: OSI Approved :: GNU General Public License (GPL)
- 2) License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
-
- Type the number of the license you wish to use or ? to try again:: 1
- Do you want to set other trove identifiers (y/n) [n]: n
- Wrote "setup.cfg".
-
-
-A setup.cfg file is created, containing the metadata of your project and the
-list of the packages it contains::
-
- $ cat setup.cfg
- [metadata]
- name = CLVault
- version = 0.1
- author = Tarek Ziade
- author_email = tarek@ziade.org
- description = Command-line utility to store and retrieve passwords
- home_page = http://bitbucket.org/tarek/clvault
-
- classifier = Development Status :: 3 - Alpha
- License :: OSI Approved :: GNU General Public License (GPL)
-
- [files]
- packages = clvault
-
-
-Our project will depend on the *keyring* project. Let's add it in the
-[metadata] section::
-
- [metadata]
- ...
- requires_dist =
- keyring
-
-
-Running commands
-----------------
-
-You can run useful commands on your project once the setup.cfg file is ready:
-
-- sdist: creates a source distribution
-- register: register your project to PyPI
-- upload: upload the distribution to PyPI
-- install_dist: install it
-
-All commands are run using the run script::
-
- $ pysetup run install_dist
- $ pysetup run sdist
- $ pysetup run upload
-
-If you want to push a source distribution of your project to PyPI, do::
-
- $ pysetup run sdist register upload
-
-
-Installing the project
-----------------------
-
-The project can be installed by manually running the packaging install command::
-
- $ pysetup run install_dist
diff --git a/Doc/packaging/uploading.rst b/Doc/packaging/uploading.rst
deleted file mode 100644
index 297518bb83..0000000000
--- a/Doc/packaging/uploading.rst
+++ /dev/null
@@ -1,80 +0,0 @@
-.. _packaging-package-upload:
-
-***************************************
-Uploading Packages to the Package Index
-***************************************
-
-The Python Package Index (PyPI) not only stores the package info, but also the
-package data if the author of the package wishes to. The packaging command
-:command:`upload` pushes the distribution files to PyPI.
-
-The command is invoked immediately after building one or more distribution
-files. For example, the command ::
-
- python setup.py sdist bdist_wininst upload
-
-will cause the source distribution and the Windows installer to be uploaded to
-PyPI. Note that these will be uploaded even if they are built using an earlier
-invocation of :file:`setup.py`, but that only distributions named on the command
-line for the invocation including the :command:`upload` command are uploaded.
-
-The :command:`upload` command uses the username, password, and repository URL
-from the :file:`$HOME/.pypirc` file (see section :ref:`packaging-pypirc` for more on this
-file). If a :command:`register` command was previously called in the same
-command, and if the password was entered in the prompt, :command:`upload` will
-reuse the entered password. This is useful if you do not want to store a clear
-text password in the :file:`$HOME/.pypirc` file.
-
-You can specify another PyPI server with the :option:`--repository=*url*`
-option::
-
- python setup.py sdist bdist_wininst upload -r http://example.com/pypi
-
-See section :ref:`packaging-pypirc` for more on defining several servers.
-
-You can use the :option:`--sign` option to tell :command:`upload` to sign each
-uploaded file using GPG (GNU Privacy Guard). The :program:`gpg` program must
-be available for execution on the system :envvar:`PATH`. You can also specify
-which key to use for signing using the :option:`--identity=*name*` option.
-
-Other :command:`upload` options include :option:`--repository=` or
-:option:`--repository=` where *url* is the url of the server and
-*section* the name of the section in :file:`$HOME/.pypirc`, and
-:option:`--show-response` (which displays the full response text from the PyPI
-server for help in debugging upload problems).
-
-PyPI package display
-====================
-
-The ``description`` field plays a special role at PyPI. It is used by
-the server to display a home page for the registered package.
-
-If you use the `reStructuredText `_
-syntax for this field, PyPI will parse it and display an HTML output for
-the package home page.
-
-The ``description`` field can be filled from a text file located in the
-project::
-
- from packaging.core import setup
-
- fp = open('README.txt')
- try:
- description = fp.read()
- finally:
- fp.close()
-
- setup(name='Packaging',
- description=description)
-
-In that case, :file:`README.txt` is a regular reStructuredText text file located
-in the root of the package besides :file:`setup.py`.
-
-To prevent registering broken reStructuredText content, you can use the
-:program:`rst2html` program that is provided by the :mod:`docutils` package
-and check the ``description`` from the command line::
-
- $ python setup.py --description | rst2html.py > output.html
-
-:mod:`docutils` will display a warning if there's something wrong with your
-syntax.
diff --git a/Doc/tools/sphinxext/indexcontent.html b/Doc/tools/sphinxext/indexcontent.html
index abe17f3d23..7f8547020f 100644
--- a/Doc/tools/sphinxext/indexcontent.html
+++ b/Doc/tools/sphinxext/indexcontent.html
@@ -20,10 +20,10 @@
tutorial for C/C++ programmers
Python/C API
reference for C/C++ programmers
- Installing Python Projects
- finding and installing modules and applications
- Distributing Python Projects
- packaging and distributing modules and applications
+ Installing Python Modules
+ information for installers & sys-admins
+ Distributing Python Modules
+ sharing modules with others
FAQs
frequently asked questions (with answers!)
diff --git a/Doc/tools/sphinxext/susp-ignored.csv b/Doc/tools/sphinxext/susp-ignored.csv
index e813f93d22..05b7c65d4d 100644
--- a/Doc/tools/sphinxext/susp-ignored.csv
+++ b/Doc/tools/sphinxext/susp-ignored.csv
@@ -243,28 +243,6 @@ license,,`,THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AN
license,,`,* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
license,,`,THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
license,,:zooko,mailto:zooko@zooko.com
-packaging/examples,,`,This is the description of the ``foobar`` project.
-packaging/setupcfg,,::,Development Status :: 3 - Alpha
-packaging/setupcfg,,::,License :: OSI Approved :: Mozilla Public License 1.1 (MPL 1.1)
-packaging/setupscript,,::,"'Development Status :: 4 - Beta',"
-packaging/setupscript,,::,"'Environment :: Console',"
-packaging/setupscript,,::,"'Environment :: Web Environment',"
-packaging/setupscript,,::,"'Intended Audience :: Developers',"
-packaging/setupscript,,::,"'Intended Audience :: End Users/Desktop',"
-packaging/setupscript,,::,"'Intended Audience :: System Administrators',"
-packaging/setupscript,,::,"'License :: OSI Approved :: Python Software Foundation License',"
-packaging/setupscript,,::,"'Operating System :: MacOS :: MacOS X',"
-packaging/setupscript,,::,"'Operating System :: Microsoft :: Windows',"
-packaging/setupscript,,::,"'Operating System :: POSIX',"
-packaging/setupscript,,::,"'Programming Language :: Python',"
-packaging/setupscript,,::,"'Topic :: Communications :: Email',"
-packaging/setupscript,,::,"'Topic :: Office/Business',"
-packaging/setupscript,,::,"'Topic :: Software Development :: Bug Tracking',"
-packaging/tutorial,,::,1) License :: OSI Approved :: GNU General Public License (GPL)
-packaging/tutorial,,::,2) License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
-packaging/tutorial,,::,classifier = Development Status :: 3 - Alpha
-packaging/tutorial,,::,License :: OSI Approved :: GNU General Public License (GPL)
-packaging/tutorial,,::,Type the number of the license you wish to use or ? to try again:: 1
reference/datamodel,,:max,
reference/datamodel,,:step,a[i:j:step]
reference/expressions,,:datum,{key:datum...}
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst
index 40e850e9ed..b14f3704dc 100644
--- a/Doc/using/cmdline.rst
+++ b/Doc/using/cmdline.rst
@@ -528,8 +528,8 @@ These environment variables influence Python's behavior.
Defines the :data:`user base directory `, which is used to
compute the path of the :data:`user site-packages directory `
- and :ref:`Packaging installation paths ` for
- ``pysetup run install_dist --user``.
+ and :ref:`Distutils installation paths ` for
+ ``python setup.py install --user``.
.. seealso::
diff --git a/Doc/using/scripts.rst b/Doc/using/scripts.rst
index 88a9de62c8..2d28246f8d 100644
--- a/Doc/using/scripts.rst
+++ b/Doc/using/scripts.rst
@@ -16,8 +16,7 @@ directories that don't exist already) and places a ``pyvenv.cfg`` file
in it with a ``home`` key pointing to the Python installation the
command was run from. It also creates a ``bin`` (or ``Scripts`` on
Windows) subdirectory containing a copy of the ``python`` binary (or
-binaries, in the case of Windows) and the ``pysetup3`` script (to
-facilitate easy installation of packages from PyPI into the new virtualenv).
+binaries, in the case of Windows).
It also creates an (initially empty) ``lib/pythonX.Y/site-packages``
subdirectory (on Windows, this is ``Lib\site-packages``).
diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst
index c6225c39c1..25a0ece768 100644
--- a/Doc/whatsnew/3.3.rst
+++ b/Doc/whatsnew/3.3.rst
@@ -53,23 +53,28 @@ This article explains the new features in Python 3.3, compared to 3.2.
release, so it's worth checking back even after reading earlier versions.
-New packaging infrastructure
-============================
+PEP 405: Virtual Environments
+=============================
-The standard library's packaging infrastructure has been updated to adopt
-some of the features developed by the wider community.
+- inspired by ``virtualenv``, a tool widely used by the community
+- change to the interpreter to avoid hacks
-* the :mod:`packaging` package and ``pysetup`` script (inspired by
- ``setuptools``, ``distribute``, ``distutil2`` and ``pip``)
-* the :mod:`venv` module and ``pyvenv`` script (inspired by ``virtualenv``)
- (Note: at time of writing, :pep:`405` is accepted, but not yet implemented)
-* native support for package directories that don't require ``__init__.py``
- marker files and can automatically span multiple path segments
- (inspired by various third party approaches to namespace packages, as
- described in :pep:`420`)
+The :mod:`venv` module and ``pyvenv`` script (inspired by ``virtualenv``, a
+tool widely used by the community).
+.. also mention the interpreter changes that avoid the hacks used in virtualenv
-.. pep-3118-update:
+
+PEP 420: Namespace Packages
+===========================
+
+Native support for package directories that don't require ``__init__.py``
+marker files and can automatically span multiple path segments (inspired by
+various third party approaches to namespace packages, as described in
+:pep:`420`)
+
+
+.. _pep-3118-update:
PEP 3118: New memoryview implementation and buffer protocol documentation
=========================================================================
@@ -1219,20 +1224,6 @@ os
* :func:`~os.getgrouplist` (:issue:`9344`)
-packaging
----------
-
-:mod:`distutils` has undergone additions and refactoring under a new name,
-:mod:`packaging`, to allow developers to make far-reaching changes without
-being constrained by backward compatibility.
-:mod:`distutils` is still provided in the standard library, but users are
-encouraged to transition to :mod:`packaging`. For older versions of Python, a
-backport compatible with Python 2.5 and newer and 3.2 is available on PyPI
-under the name `distutils2 `_.
-
-.. TODO add examples and howto to the packaging docs and link to them
-
-
pdb
---
@@ -1560,8 +1551,6 @@ are no longer supported due to maintenance burden.
Deprecated Python modules, functions and methods
------------------------------------------------
-* The :mod:`distutils` module has been deprecated. Use the new
- :mod:`packaging` module instead.
* The ``unicode_internal`` codec has been deprecated because of the
:pep:`393`, use UTF-8, UTF-16 (``utf-16-le`` or ``utf-16-be``), or UTF-32
(``utf-32-le`` or ``utf-32-be``)
diff --git a/Lib/packaging/__init__.py b/Lib/packaging/__init__.py
deleted file mode 100644
index 93b611765c..0000000000
--- a/Lib/packaging/__init__.py
+++ /dev/null
@@ -1,17 +0,0 @@
-"""Support for packaging, distribution and installation of Python projects.
-
-Third-party tools can use parts of packaging as building blocks
-without causing the other modules to be imported:
-
- import packaging.version
- import packaging.metadata
- import packaging.pypi.simple
- import packaging.tests.pypi_server
-"""
-
-from logging import getLogger
-
-__all__ = ['__version__', 'logger']
-
-__version__ = "1.0a3"
-logger = getLogger('packaging')
diff --git a/Lib/packaging/_trove.py b/Lib/packaging/_trove.py
deleted file mode 100644
index f527bc49ed..0000000000
--- a/Lib/packaging/_trove.py
+++ /dev/null
@@ -1,571 +0,0 @@
-"""Temporary helper for create."""
-
-# XXX get the list from PyPI and cache it instead of hardcoding
-
-# XXX see if it would be more useful to store it as another structure
-# than a list of strings
-
-all_classifiers = [
-'Development Status :: 1 - Planning',
-'Development Status :: 2 - Pre-Alpha',
-'Development Status :: 3 - Alpha',
-'Development Status :: 4 - Beta',
-'Development Status :: 5 - Production/Stable',
-'Development Status :: 6 - Mature',
-'Development Status :: 7 - Inactive',
-'Environment :: Console',
-'Environment :: Console :: Curses',
-'Environment :: Console :: Framebuffer',
-'Environment :: Console :: Newt',
-'Environment :: Console :: svgalib',
-"Environment :: Handhelds/PDA's",
-'Environment :: MacOS X',
-'Environment :: MacOS X :: Aqua',
-'Environment :: MacOS X :: Carbon',
-'Environment :: MacOS X :: Cocoa',
-'Environment :: No Input/Output (Daemon)',
-'Environment :: Other Environment',
-'Environment :: Plugins',
-'Environment :: Web Environment',
-'Environment :: Web Environment :: Buffet',
-'Environment :: Web Environment :: Mozilla',
-'Environment :: Web Environment :: ToscaWidgets',
-'Environment :: Win32 (MS Windows)',
-'Environment :: X11 Applications',
-'Environment :: X11 Applications :: Gnome',
-'Environment :: X11 Applications :: GTK',
-'Environment :: X11 Applications :: KDE',
-'Environment :: X11 Applications :: Qt',
-'Framework :: BFG',
-'Framework :: Buildout',
-'Framework :: Buildout :: Extension',
-'Framework :: Buildout :: Recipe',
-'Framework :: Chandler',
-'Framework :: CherryPy',
-'Framework :: CubicWeb',
-'Framework :: Django',
-'Framework :: IDLE',
-'Framework :: Paste',
-'Framework :: Plone',
-'Framework :: Plone :: 3.2',
-'Framework :: Plone :: 3.3',
-'Framework :: Plone :: 4.0',
-'Framework :: Plone :: 4.1',
-'Framework :: Plone :: 4.2',
-'Framework :: Plone :: 4.3',
-'Framework :: Pylons',
-'Framework :: Setuptools Plugin',
-'Framework :: Trac',
-'Framework :: Tryton',
-'Framework :: TurboGears',
-'Framework :: TurboGears :: Applications',
-'Framework :: TurboGears :: Widgets',
-'Framework :: Twisted',
-'Framework :: ZODB',
-'Framework :: Zope2',
-'Framework :: Zope3',
-'Intended Audience :: Customer Service',
-'Intended Audience :: Developers',
-'Intended Audience :: Education',
-'Intended Audience :: End Users/Desktop',
-'Intended Audience :: Financial and Insurance Industry',
-'Intended Audience :: Healthcare Industry',
-'Intended Audience :: Information Technology',
-'Intended Audience :: Legal Industry',
-'Intended Audience :: Manufacturing',
-'Intended Audience :: Other Audience',
-'Intended Audience :: Religion',
-'Intended Audience :: Science/Research',
-'Intended Audience :: System Administrators',
-'Intended Audience :: Telecommunications Industry',
-'License :: Aladdin Free Public License (AFPL)',
-'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication',
-'License :: DFSG approved',
-'License :: Eiffel Forum License (EFL)',
-'License :: Free For Educational Use',
-'License :: Free For Home Use',
-'License :: Free for non-commercial use',
-'License :: Freely Distributable',
-'License :: Free To Use But Restricted',
-'License :: Freeware',
-'License :: Netscape Public License (NPL)',
-'License :: Nokia Open Source License (NOKOS)',
-'License :: OSI Approved',
-'License :: OSI Approved :: Academic Free License (AFL)',
-'License :: OSI Approved :: Apache Software License',
-'License :: OSI Approved :: Apple Public Source License',
-'License :: OSI Approved :: Artistic License',
-'License :: OSI Approved :: Attribution Assurance License',
-'License :: OSI Approved :: BSD License',
-'License :: OSI Approved :: Common Public License',
-'License :: OSI Approved :: Eiffel Forum License',
-'License :: OSI Approved :: European Union Public Licence 1.0 (EUPL 1.0)',
-'License :: OSI Approved :: European Union Public Licence 1.1 (EUPL 1.1)',
-'License :: OSI Approved :: GNU Affero General Public License v3',
-'License :: OSI Approved :: GNU Free Documentation License (FDL)',
-'License :: OSI Approved :: GNU General Public License (GPL)',
-'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
-'License :: OSI Approved :: IBM Public License',
-'License :: OSI Approved :: Intel Open Source License',
-'License :: OSI Approved :: ISC License (ISCL)',
-'License :: OSI Approved :: Jabber Open Source License',
-'License :: OSI Approved :: MIT License',
-'License :: OSI Approved :: MITRE Collaborative Virtual Workspace License (CVW)',
-'License :: OSI Approved :: Motosoto License',
-'License :: OSI Approved :: Mozilla Public License 1.0 (MPL)',
-'License :: OSI Approved :: Mozilla Public License 1.1 (MPL 1.1)',
-'License :: OSI Approved :: Nethack General Public License',
-'License :: OSI Approved :: Nokia Open Source License',
-'License :: OSI Approved :: Open Group Test Suite License',
-'License :: OSI Approved :: Python License (CNRI Python License)',
-'License :: OSI Approved :: Python Software Foundation License',
-'License :: OSI Approved :: Qt Public License (QPL)',
-'License :: OSI Approved :: Ricoh Source Code Public License',
-'License :: OSI Approved :: Sleepycat License',
-'License :: OSI Approved :: Sun Industry Standards Source License (SISSL)',
-'License :: OSI Approved :: Sun Public License',
-'License :: OSI Approved :: University of Illinois/NCSA Open Source License',
-'License :: OSI Approved :: Vovida Software License 1.0',
-'License :: OSI Approved :: W3C License',
-'License :: OSI Approved :: X.Net License',
-'License :: OSI Approved :: zlib/libpng License',
-'License :: OSI Approved :: Zope Public License',
-'License :: Other/Proprietary License',
-'License :: Public Domain',
-'License :: Repoze Public License',
-'Natural Language :: Afrikaans',
-'Natural Language :: Arabic',
-'Natural Language :: Bengali',
-'Natural Language :: Bosnian',
-'Natural Language :: Bulgarian',
-'Natural Language :: Catalan',
-'Natural Language :: Chinese (Simplified)',
-'Natural Language :: Chinese (Traditional)',
-'Natural Language :: Croatian',
-'Natural Language :: Czech',
-'Natural Language :: Danish',
-'Natural Language :: Dutch',
-'Natural Language :: English',
-'Natural Language :: Esperanto',
-'Natural Language :: Finnish',
-'Natural Language :: French',
-'Natural Language :: German',
-'Natural Language :: Greek',
-'Natural Language :: Hebrew',
-'Natural Language :: Hindi',
-'Natural Language :: Hungarian',
-'Natural Language :: Icelandic',
-'Natural Language :: Indonesian',
-'Natural Language :: Italian',
-'Natural Language :: Japanese',
-'Natural Language :: Javanese',
-'Natural Language :: Korean',
-'Natural Language :: Latin',
-'Natural Language :: Latvian',
-'Natural Language :: Macedonian',
-'Natural Language :: Malay',
-'Natural Language :: Marathi',
-'Natural Language :: Norwegian',
-'Natural Language :: Panjabi',
-'Natural Language :: Persian',
-'Natural Language :: Polish',
-'Natural Language :: Portuguese',
-'Natural Language :: Portuguese (Brazilian)',
-'Natural Language :: Romanian',
-'Natural Language :: Russian',
-'Natural Language :: Serbian',
-'Natural Language :: Slovak',
-'Natural Language :: Slovenian',
-'Natural Language :: Spanish',
-'Natural Language :: Swedish',
-'Natural Language :: Tamil',
-'Natural Language :: Telugu',
-'Natural Language :: Thai',
-'Natural Language :: Turkish',
-'Natural Language :: Ukranian',
-'Natural Language :: Urdu',
-'Natural Language :: Vietnamese',
-'Operating System :: BeOS',
-'Operating System :: MacOS',
-'Operating System :: MacOS :: MacOS 9',
-'Operating System :: MacOS :: MacOS X',
-'Operating System :: Microsoft',
-'Operating System :: Microsoft :: MS-DOS',
-'Operating System :: Microsoft :: Windows',
-'Operating System :: Microsoft :: Windows :: Windows 3.1 or Earlier',
-'Operating System :: Microsoft :: Windows :: Windows 95/98/2000',
-'Operating System :: Microsoft :: Windows :: Windows CE',
-'Operating System :: Microsoft :: Windows :: Windows NT/2000',
-'Operating System :: OS/2',
-'Operating System :: OS Independent',
-'Operating System :: Other OS',
-'Operating System :: PalmOS',
-'Operating System :: PDA Systems',
-'Operating System :: POSIX',
-'Operating System :: POSIX :: AIX',
-'Operating System :: POSIX :: BSD',
-'Operating System :: POSIX :: BSD :: BSD/OS',
-'Operating System :: POSIX :: BSD :: FreeBSD',
-'Operating System :: POSIX :: BSD :: NetBSD',
-'Operating System :: POSIX :: BSD :: OpenBSD',
-'Operating System :: POSIX :: GNU Hurd',
-'Operating System :: POSIX :: HP-UX',
-'Operating System :: POSIX :: IRIX',
-'Operating System :: POSIX :: Linux',
-'Operating System :: POSIX :: Other',
-'Operating System :: POSIX :: SCO',
-'Operating System :: POSIX :: SunOS/Solaris',
-'Operating System :: Unix',
-'Programming Language :: Ada',
-'Programming Language :: APL',
-'Programming Language :: ASP',
-'Programming Language :: Assembly',
-'Programming Language :: Awk',
-'Programming Language :: Basic',
-'Programming Language :: C',
-'Programming Language :: C#',
-'Programming Language :: C++',
-'Programming Language :: Cold Fusion',
-'Programming Language :: Cython',
-'Programming Language :: Delphi/Kylix',
-'Programming Language :: Dylan',
-'Programming Language :: Eiffel',
-'Programming Language :: Emacs-Lisp',
-'Programming Language :: Erlang',
-'Programming Language :: Euler',
-'Programming Language :: Euphoria',
-'Programming Language :: Forth',
-'Programming Language :: Fortran',
-'Programming Language :: Haskell',
-'Programming Language :: Java',
-'Programming Language :: JavaScript',
-'Programming Language :: Lisp',
-'Programming Language :: Logo',
-'Programming Language :: ML',
-'Programming Language :: Modula',
-'Programming Language :: Objective C',
-'Programming Language :: Object Pascal',
-'Programming Language :: OCaml',
-'Programming Language :: Other',
-'Programming Language :: Other Scripting Engines',
-'Programming Language :: Pascal',
-'Programming Language :: Perl',
-'Programming Language :: PHP',
-'Programming Language :: Pike',
-'Programming Language :: Pliant',
-'Programming Language :: PL/SQL',
-'Programming Language :: PROGRESS',
-'Programming Language :: Prolog',
-'Programming Language :: Python',
-'Programming Language :: Python :: 2',
-'Programming Language :: Python :: 2.3',
-'Programming Language :: Python :: 2.4',
-'Programming Language :: Python :: 2.5',
-'Programming Language :: Python :: 2.6',
-'Programming Language :: Python :: 2.7',
-'Programming Language :: Python :: 3',
-'Programming Language :: Python :: 3.0',
-'Programming Language :: Python :: 3.1',
-'Programming Language :: Python :: 3.2',
-'Programming Language :: Python :: Implementation',
-'Programming Language :: Python :: Implementation :: CPython',
-'Programming Language :: Python :: Implementation :: IronPython',
-'Programming Language :: Python :: Implementation :: Jython',
-'Programming Language :: Python :: Implementation :: PyPy',
-'Programming Language :: Python :: Implementation :: Stackless',
-'Programming Language :: REBOL',
-'Programming Language :: Rexx',
-'Programming Language :: Ruby',
-'Programming Language :: Scheme',
-'Programming Language :: Simula',
-'Programming Language :: Smalltalk',
-'Programming Language :: SQL',
-'Programming Language :: Tcl',
-'Programming Language :: Unix Shell',
-'Programming Language :: Visual Basic',
-'Programming Language :: XBasic',
-'Programming Language :: YACC',
-'Programming Language :: Zope',
-'Topic :: Adaptive Technologies',
-'Topic :: Artistic Software',
-'Topic :: Communications',
-'Topic :: Communications :: BBS',
-'Topic :: Communications :: Chat',
-'Topic :: Communications :: Chat :: AOL Instant Messenger',
-'Topic :: Communications :: Chat :: ICQ',
-'Topic :: Communications :: Chat :: Internet Relay Chat',
-'Topic :: Communications :: Chat :: Unix Talk',
-'Topic :: Communications :: Conferencing',
-'Topic :: Communications :: Email',
-'Topic :: Communications :: Email :: Address Book',
-'Topic :: Communications :: Email :: Email Clients (MUA)',
-'Topic :: Communications :: Email :: Filters',
-'Topic :: Communications :: Email :: Mailing List Servers',
-'Topic :: Communications :: Email :: Mail Transport Agents',
-'Topic :: Communications :: Email :: Post-Office',
-'Topic :: Communications :: Email :: Post-Office :: IMAP',
-'Topic :: Communications :: Email :: Post-Office :: POP3',
-'Topic :: Communications :: Fax',
-'Topic :: Communications :: FIDO',
-'Topic :: Communications :: File Sharing',
-'Topic :: Communications :: File Sharing :: Gnutella',
-'Topic :: Communications :: File Sharing :: Napster',
-'Topic :: Communications :: Ham Radio',
-'Topic :: Communications :: Internet Phone',
-'Topic :: Communications :: Telephony',
-'Topic :: Communications :: Usenet News',
-'Topic :: Database',
-'Topic :: Database :: Database Engines/Servers',
-'Topic :: Database :: Front-Ends',
-'Topic :: Desktop Environment',
-'Topic :: Desktop Environment :: File Managers',
-'Topic :: Desktop Environment :: Gnome',
-'Topic :: Desktop Environment :: GNUstep',
-'Topic :: Desktop Environment :: K Desktop Environment (KDE)',
-'Topic :: Desktop Environment :: K Desktop Environment (KDE) :: Themes',
-'Topic :: Desktop Environment :: PicoGUI',
-'Topic :: Desktop Environment :: PicoGUI :: Applications',
-'Topic :: Desktop Environment :: PicoGUI :: Themes',
-'Topic :: Desktop Environment :: Screen Savers',
-'Topic :: Desktop Environment :: Window Managers',
-'Topic :: Desktop Environment :: Window Managers :: Afterstep',
-'Topic :: Desktop Environment :: Window Managers :: Afterstep :: Themes',
-'Topic :: Desktop Environment :: Window Managers :: Applets',
-'Topic :: Desktop Environment :: Window Managers :: Blackbox',
-'Topic :: Desktop Environment :: Window Managers :: Blackbox :: Themes',
-'Topic :: Desktop Environment :: Window Managers :: CTWM',
-'Topic :: Desktop Environment :: Window Managers :: CTWM :: Themes',
-'Topic :: Desktop Environment :: Window Managers :: Enlightenment',
-'Topic :: Desktop Environment :: Window Managers :: Enlightenment :: Epplets',
-'Topic :: Desktop Environment :: Window Managers :: Enlightenment :: Themes DR15',
-'Topic :: Desktop Environment :: Window Managers :: Enlightenment :: Themes DR16',
-'Topic :: Desktop Environment :: Window Managers :: Enlightenment :: Themes DR17',
-'Topic :: Desktop Environment :: Window Managers :: Fluxbox',
-'Topic :: Desktop Environment :: Window Managers :: Fluxbox :: Themes',
-'Topic :: Desktop Environment :: Window Managers :: FVWM',
-'Topic :: Desktop Environment :: Window Managers :: FVWM :: Themes',
-'Topic :: Desktop Environment :: Window Managers :: IceWM',
-'Topic :: Desktop Environment :: Window Managers :: IceWM :: Themes',
-'Topic :: Desktop Environment :: Window Managers :: MetaCity',
-'Topic :: Desktop Environment :: Window Managers :: MetaCity :: Themes',
-'Topic :: Desktop Environment :: Window Managers :: Oroborus',
-'Topic :: Desktop Environment :: Window Managers :: Oroborus :: Themes',
-'Topic :: Desktop Environment :: Window Managers :: Sawfish',
-'Topic :: Desktop Environment :: Window Managers :: Sawfish :: Themes 0.30',
-'Topic :: Desktop Environment :: Window Managers :: Sawfish :: Themes pre-0.30',
-'Topic :: Desktop Environment :: Window Managers :: Waimea',
-'Topic :: Desktop Environment :: Window Managers :: Waimea :: Themes',
-'Topic :: Desktop Environment :: Window Managers :: Window Maker',
-'Topic :: Desktop Environment :: Window Managers :: Window Maker :: Applets',
-'Topic :: Desktop Environment :: Window Managers :: Window Maker :: Themes',
-'Topic :: Desktop Environment :: Window Managers :: XFCE',
-'Topic :: Desktop Environment :: Window Managers :: XFCE :: Themes',
-'Topic :: Documentation',
-'Topic :: Education',
-'Topic :: Education :: Computer Aided Instruction (CAI)',
-'Topic :: Education :: Testing',
-'Topic :: Games/Entertainment',
-'Topic :: Games/Entertainment :: Arcade',
-'Topic :: Games/Entertainment :: Board Games',
-'Topic :: Games/Entertainment :: First Person Shooters',
-'Topic :: Games/Entertainment :: Fortune Cookies',
-'Topic :: Games/Entertainment :: Multi-User Dungeons (MUD)',
-'Topic :: Games/Entertainment :: Puzzle Games',
-'Topic :: Games/Entertainment :: Real Time Strategy',
-'Topic :: Games/Entertainment :: Role-Playing',
-'Topic :: Games/Entertainment :: Side-Scrolling/Arcade Games',
-'Topic :: Games/Entertainment :: Simulation',
-'Topic :: Games/Entertainment :: Turn Based Strategy',
-'Topic :: Home Automation',
-'Topic :: Internet',
-'Topic :: Internet :: File Transfer Protocol (FTP)',
-'Topic :: Internet :: Finger',
-'Topic :: Internet :: Log Analysis',
-'Topic :: Internet :: Name Service (DNS)',
-'Topic :: Internet :: Proxy Servers',
-'Topic :: Internet :: WAP',
-'Topic :: Internet :: WWW/HTTP',
-'Topic :: Internet :: WWW/HTTP :: Browsers',
-'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
-'Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries',
-'Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Message Boards',
-'Topic :: Internet :: WWW/HTTP :: Dynamic Content :: News/Diary',
-'Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Page Counters',
-'Topic :: Internet :: WWW/HTTP :: HTTP Servers',
-'Topic :: Internet :: WWW/HTTP :: Indexing/Search',
-'Topic :: Internet :: WWW/HTTP :: Session',
-'Topic :: Internet :: WWW/HTTP :: Site Management',
-'Topic :: Internet :: WWW/HTTP :: Site Management :: Link Checking',
-'Topic :: Internet :: WWW/HTTP :: WSGI',
-'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
-'Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware',
-'Topic :: Internet :: WWW/HTTP :: WSGI :: Server',
-'Topic :: Internet :: Z39.50',
-'Topic :: Multimedia',
-'Topic :: Multimedia :: Graphics',
-'Topic :: Multimedia :: Graphics :: 3D Modeling',
-'Topic :: Multimedia :: Graphics :: 3D Rendering',
-'Topic :: Multimedia :: Graphics :: Capture',
-'Topic :: Multimedia :: Graphics :: Capture :: Digital Camera',
-'Topic :: Multimedia :: Graphics :: Capture :: Scanners',
-'Topic :: Multimedia :: Graphics :: Capture :: Screen Capture',
-'Topic :: Multimedia :: Graphics :: Editors',
-'Topic :: Multimedia :: Graphics :: Editors :: Raster-Based',
-'Topic :: Multimedia :: Graphics :: Editors :: Vector-Based',
-'Topic :: Multimedia :: Graphics :: Graphics Conversion',
-'Topic :: Multimedia :: Graphics :: Presentation',
-'Topic :: Multimedia :: Graphics :: Viewers',
-'Topic :: Multimedia :: Sound/Audio',
-'Topic :: Multimedia :: Sound/Audio :: Analysis',
-'Topic :: Multimedia :: Sound/Audio :: Capture/Recording',
-'Topic :: Multimedia :: Sound/Audio :: CD Audio',
-'Topic :: Multimedia :: Sound/Audio :: CD Audio :: CD Playing',
-'Topic :: Multimedia :: Sound/Audio :: CD Audio :: CD Ripping',
-'Topic :: Multimedia :: Sound/Audio :: CD Audio :: CD Writing',
-'Topic :: Multimedia :: Sound/Audio :: Conversion',
-'Topic :: Multimedia :: Sound/Audio :: Editors',
-'Topic :: Multimedia :: Sound/Audio :: MIDI',
-'Topic :: Multimedia :: Sound/Audio :: Mixers',
-'Topic :: Multimedia :: Sound/Audio :: Players',
-'Topic :: Multimedia :: Sound/Audio :: Players :: MP3',
-'Topic :: Multimedia :: Sound/Audio :: Sound Synthesis',
-'Topic :: Multimedia :: Sound/Audio :: Speech',
-'Topic :: Multimedia :: Video',
-'Topic :: Multimedia :: Video :: Capture',
-'Topic :: Multimedia :: Video :: Conversion',
-'Topic :: Multimedia :: Video :: Display',
-'Topic :: Multimedia :: Video :: Non-Linear Editor',
-'Topic :: Office/Business',
-'Topic :: Office/Business :: Financial',
-'Topic :: Office/Business :: Financial :: Accounting',
-'Topic :: Office/Business :: Financial :: Investment',
-'Topic :: Office/Business :: Financial :: Point-Of-Sale',
-'Topic :: Office/Business :: Financial :: Spreadsheet',
-'Topic :: Office/Business :: Groupware',
-'Topic :: Office/Business :: News/Diary',
-'Topic :: Office/Business :: Office Suites',
-'Topic :: Office/Business :: Scheduling',
-'Topic :: Other/Nonlisted Topic',
-'Topic :: Printing',
-'Topic :: Religion',
-'Topic :: Scientific/Engineering',
-'Topic :: Scientific/Engineering :: Artificial Life',
-'Topic :: Scientific/Engineering :: Artificial Intelligence',
-'Topic :: Scientific/Engineering :: Astronomy',
-'Topic :: Scientific/Engineering :: Atmospheric Science',
-'Topic :: Scientific/Engineering :: Bio-Informatics',
-'Topic :: Scientific/Engineering :: Chemistry',
-'Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)',
-'Topic :: Scientific/Engineering :: GIS',
-'Topic :: Scientific/Engineering :: Human Machine Interfaces',
-'Topic :: Scientific/Engineering :: Image Recognition',
-'Topic :: Scientific/Engineering :: Information Analysis',
-'Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator',
-'Topic :: Scientific/Engineering :: Mathematics',
-'Topic :: Scientific/Engineering :: Medical Science Apps.',
-'Topic :: Scientific/Engineering :: Physics',
-'Topic :: Scientific/Engineering :: Visualization',
-'Topic :: Security',
-'Topic :: Security :: Cryptography',
-'Topic :: Sociology',
-'Topic :: Sociology :: Genealogy',
-'Topic :: Sociology :: History',
-'Topic :: Software Development',
-'Topic :: Software Development :: Assemblers',
-'Topic :: Software Development :: Bug Tracking',
-'Topic :: Software Development :: Build Tools',
-'Topic :: Software Development :: Code Generators',
-'Topic :: Software Development :: Compilers',
-'Topic :: Software Development :: Debuggers',
-'Topic :: Software Development :: Disassemblers',
-'Topic :: Software Development :: Documentation',
-'Topic :: Software Development :: Embedded Systems',
-'Topic :: Software Development :: Internationalization',
-'Topic :: Software Development :: Interpreters',
-'Topic :: Software Development :: Libraries',
-'Topic :: Software Development :: Libraries :: Application Frameworks',
-'Topic :: Software Development :: Libraries :: Java Libraries',
-'Topic :: Software Development :: Libraries :: Perl Modules',
-'Topic :: Software Development :: Libraries :: PHP Classes',
-'Topic :: Software Development :: Libraries :: Pike Modules',
-'Topic :: Software Development :: Libraries :: pygame',
-'Topic :: Software Development :: Libraries :: Python Modules',
-'Topic :: Software Development :: Libraries :: Ruby Modules',
-'Topic :: Software Development :: Libraries :: Tcl Extensions',
-'Topic :: Software Development :: Localization',
-'Topic :: Software Development :: Object Brokering',
-'Topic :: Software Development :: Object Brokering :: CORBA',
-'Topic :: Software Development :: Pre-processors',
-'Topic :: Software Development :: Quality Assurance',
-'Topic :: Software Development :: Testing',
-'Topic :: Software Development :: Testing :: Traffic Generation',
-'Topic :: Software Development :: User Interfaces',
-'Topic :: Software Development :: Version Control',
-'Topic :: Software Development :: Version Control :: CVS',
-'Topic :: Software Development :: Version Control :: RCS',
-'Topic :: Software Development :: Version Control :: SCCS',
-'Topic :: Software Development :: Widget Sets',
-'Topic :: System',
-'Topic :: System :: Archiving',
-'Topic :: System :: Archiving :: Backup',
-'Topic :: System :: Archiving :: Compression',
-'Topic :: System :: Archiving :: Mirroring',
-'Topic :: System :: Archiving :: Packaging',
-'Topic :: System :: Benchmark',
-'Topic :: System :: Boot',
-'Topic :: System :: Boot :: Init',
-'Topic :: System :: Clustering',
-'Topic :: System :: Console Fonts',
-'Topic :: System :: Distributed Computing',
-'Topic :: System :: Emulators',
-'Topic :: System :: Filesystems',
-'Topic :: System :: Hardware',
-'Topic :: System :: Hardware :: Hardware Drivers',
-'Topic :: System :: Hardware :: Mainframes',
-'Topic :: System :: Hardware :: Symmetric Multi-processing',
-'Topic :: System :: Installation/Setup',
-'Topic :: System :: Logging',
-'Topic :: System :: Monitoring',
-'Topic :: System :: Networking',
-'Topic :: System :: Networking :: Firewalls',
-'Topic :: System :: Networking :: Monitoring',
-'Topic :: System :: Networking :: Monitoring :: Hardware Watchdog',
-'Topic :: System :: Networking :: Time Synchronization',
-'Topic :: System :: Operating System',
-'Topic :: System :: Operating System Kernels',
-'Topic :: System :: Operating System Kernels :: BSD',
-'Topic :: System :: Operating System Kernels :: GNU Hurd',
-'Topic :: System :: Operating System Kernels :: Linux',
-'Topic :: System :: Power (UPS)',
-'Topic :: System :: Recovery Tools',
-'Topic :: System :: Shells',
-'Topic :: System :: Software Distribution',
-'Topic :: System :: Systems Administration',
-'Topic :: System :: Systems Administration :: Authentication/Directory',
-'Topic :: System :: Systems Administration :: Authentication/Directory :: LDAP',
-'Topic :: System :: Systems Administration :: Authentication/Directory :: NIS',
-'Topic :: System :: System Shells',
-'Topic :: Terminals',
-'Topic :: Terminals :: Serial',
-'Topic :: Terminals :: Telnet',
-'Topic :: Terminals :: Terminal Emulators/X Terminals',
-'Topic :: Text Editors',
-'Topic :: Text Editors :: Documentation',
-'Topic :: Text Editors :: Emacs',
-'Topic :: Text Editors :: Integrated Development Environments (IDE)',
-'Topic :: Text Editors :: Text Processing',
-'Topic :: Text Editors :: Word Processors',
-'Topic :: Text Processing',
-'Topic :: Text Processing :: Filters',
-'Topic :: Text Processing :: Fonts',
-'Topic :: Text Processing :: General',
-'Topic :: Text Processing :: Indexing',
-'Topic :: Text Processing :: Linguistic',
-'Topic :: Text Processing :: Markup',
-'Topic :: Text Processing :: Markup :: HTML',
-'Topic :: Text Processing :: Markup :: LaTeX',
-'Topic :: Text Processing :: Markup :: SGML',
-'Topic :: Text Processing :: Markup :: VRML',
-'Topic :: Text Processing :: Markup :: XML',
-'Topic :: Utilities',
-]
diff --git a/Lib/packaging/command/__init__.py b/Lib/packaging/command/__init__.py
deleted file mode 100644
index 87227c0b69..0000000000
--- a/Lib/packaging/command/__init__.py
+++ /dev/null
@@ -1,53 +0,0 @@
-"""Subpackage containing all standard commands."""
-import os
-from packaging.errors import PackagingModuleError
-from packaging.util import resolve_name
-
-__all__ = ['get_command_names', 'set_command', 'get_command_class',
- 'STANDARD_COMMANDS']
-
-
-STANDARD_COMMANDS = [
- # packaging
- 'check', 'test',
- # building
- 'build', 'build_py', 'build_ext', 'build_clib', 'build_scripts', 'clean',
- # installing
- 'install_dist', 'install_lib', 'install_headers', 'install_scripts',
- 'install_data', 'install_distinfo',
- # distributing
- 'sdist', 'bdist', 'bdist_dumb', 'bdist_wininst',
- 'register', 'upload', 'upload_docs',
- ]
-
-if os.name == 'nt':
- STANDARD_COMMANDS.insert(STANDARD_COMMANDS.index('bdist_wininst'),
- 'bdist_msi')
-
-# XXX maybe we need more than one registry, so that --list-comands can display
-# standard, custom and overriden standard commands differently
-_COMMANDS = dict((name, 'packaging.command.%s.%s' % (name, name))
- for name in STANDARD_COMMANDS)
-
-
-def get_command_names():
- """Return registered commands"""
- return sorted(_COMMANDS)
-
-
-def set_command(location):
- cls = resolve_name(location)
- # XXX we want to do the duck-type checking here
- _COMMANDS[cls.get_command_name()] = cls
-
-
-def get_command_class(name):
- """Return the registered command"""
- try:
- cls = _COMMANDS[name]
- except KeyError:
- raise PackagingModuleError("Invalid command %s" % name)
- if isinstance(cls, str):
- cls = resolve_name(cls)
- _COMMANDS[name] = cls
- return cls
diff --git a/Lib/packaging/command/bdist.py b/Lib/packaging/command/bdist.py
deleted file mode 100644
index e390cdc369..0000000000
--- a/Lib/packaging/command/bdist.py
+++ /dev/null
@@ -1,141 +0,0 @@
-"""Create a built (binary) distribution.
-
-If a --formats option was given on the command line, this command will
-call the corresponding bdist_* commands; if the option was absent, a
-bdist_* command depending on the current platform will be called.
-"""
-
-import os
-
-from packaging import util
-from packaging.command.cmd import Command
-from packaging.errors import PackagingPlatformError, PackagingOptionError
-
-
-def show_formats():
- """Print list of available formats (arguments to "--format" option).
- """
- from packaging.fancy_getopt import FancyGetopt
- formats = []
- for format in bdist.format_commands:
- formats.append(("formats=" + format, None,
- bdist.format_command[format][1]))
- pretty_printer = FancyGetopt(formats)
- pretty_printer.print_help("List of available distribution formats:")
-
-
-class bdist(Command):
-
- description = "create a built (binary) distribution"
-
- user_options = [('bdist-base=', 'b',
- "temporary directory for creating built distributions"),
- ('plat-name=', 'p',
- "platform name to embed in generated filenames "
- "(default: %s)" % util.get_platform()),
- ('formats=', None,
- "formats for distribution (comma-separated list)"),
- ('dist-dir=', 'd',
- "directory to put final built distributions in "
- "[default: dist]"),
- ('skip-build', None,
- "skip rebuilding everything (for testing/debugging)"),
- ('owner=', 'u',
- "Owner name used when creating a tar file"
- " [default: current user]"),
- ('group=', 'g',
- "Group name used when creating a tar file"
- " [default: current group]"),
- ]
-
- boolean_options = ['skip-build']
-
- help_options = [
- ('help-formats', None,
- "lists available distribution formats", show_formats),
- ]
-
- # This is of course very simplistic. The various UNIX family operating
- # systems have their specific formats, but they are out of scope for us;
- # bdist_dumb is, well, dumb; it's more a building block for other
- # packaging tools than a real end-user binary format.
- default_format = {'posix': 'gztar',
- 'nt': 'zip',
- 'os2': 'zip'}
-
- # Establish the preferred order (for the --help-formats option).
- format_commands = ['gztar', 'bztar', 'tar',
- 'wininst', 'zip', 'msi']
-
- # And the real information.
- format_command = {'gztar': ('bdist_dumb', "gzip'ed tar file"),
- 'bztar': ('bdist_dumb', "bzip2'ed tar file"),
- 'tar': ('bdist_dumb', "tar file"),
- 'wininst': ('bdist_wininst',
- "Windows executable installer"),
- 'zip': ('bdist_dumb', "ZIP file"),
- 'msi': ('bdist_msi', "Microsoft Installer"),
- }
-
- def initialize_options(self):
- self.bdist_base = None
- self.plat_name = None
- self.formats = None
- self.dist_dir = None
- self.skip_build = False
- self.group = None
- self.owner = None
-
- def finalize_options(self):
- # have to finalize 'plat_name' before 'bdist_base'
- if self.plat_name is None:
- if self.skip_build:
- self.plat_name = util.get_platform()
- else:
- self.plat_name = self.get_finalized_command('build').plat_name
-
- # 'bdist_base' -- parent of per-built-distribution-format
- # temporary directories (eg. we'll probably have
- # "build/bdist./dumb", etc.)
- if self.bdist_base is None:
- build_base = self.get_finalized_command('build').build_base
- self.bdist_base = os.path.join(build_base,
- 'bdist.' + self.plat_name)
-
- self.ensure_string_list('formats')
- if self.formats is None:
- try:
- self.formats = [self.default_format[os.name]]
- except KeyError:
- raise PackagingPlatformError(
- "don't know how to create built distributions "
- "on platform %s" % os.name)
-
- if self.dist_dir is None:
- self.dist_dir = "dist"
-
- def run(self):
- # Figure out which sub-commands we need to run.
- commands = []
- for format in self.formats:
- try:
- commands.append(self.format_command[format][0])
- except KeyError:
- raise PackagingOptionError("invalid format '%s'" % format)
-
- # Reinitialize and run each command.
- for i in range(len(self.formats)):
- cmd_name = commands[i]
- sub_cmd = self.reinitialize_command(cmd_name)
- sub_cmd.format = self.formats[i]
-
- # passing the owner and group names for tar archiving
- if cmd_name == 'bdist_dumb':
- sub_cmd.owner = self.owner
- sub_cmd.group = self.group
-
- # If we're going to need to run this command again, tell it to
- # keep its temporary files around so subsequent runs go faster.
- if cmd_name in commands[i+1:]:
- sub_cmd.keep_temp = True
- self.run_command(cmd_name)
diff --git a/Lib/packaging/command/bdist_dumb.py b/Lib/packaging/command/bdist_dumb.py
deleted file mode 100644
index 548e3c4930..0000000000
--- a/Lib/packaging/command/bdist_dumb.py
+++ /dev/null
@@ -1,139 +0,0 @@
-"""Create a "dumb" built distribution.
-
-A dumb distribution is just an archive meant to be unpacked under
-sys.prefix or sys.exec_prefix.
-"""
-
-import os
-from shutil import rmtree
-from sysconfig import get_python_version
-
-from packaging.util import get_platform
-from packaging.command.cmd import Command
-from packaging.errors import PackagingPlatformError
-from packaging import logger
-
-
-class bdist_dumb(Command):
-
- description = 'create a "dumb" built distribution'
-
- user_options = [('bdist-dir=', 'd',
- "temporary directory for creating the distribution"),
- ('plat-name=', 'p',
- "platform name to embed in generated filenames "
- "(default: %s)" % get_platform()),
- ('format=', 'f',
- "archive format to create (tar, gztar, bztar, zip)"),
- ('keep-temp', 'k',
- "keep the pseudo-installation tree around after " +
- "creating the distribution archive"),
- ('dist-dir=', 'd',
- "directory to put final built distributions in"),
- ('skip-build', None,
- "skip rebuilding everything (for testing/debugging)"),
- ('relative', None,
- "build the archive using relative paths"
- "(default: false)"),
- ('owner=', 'u',
- "Owner name used when creating a tar file"
- " [default: current user]"),
- ('group=', 'g',
- "Group name used when creating a tar file"
- " [default: current group]"),
- ]
-
- boolean_options = ['keep-temp', 'skip-build', 'relative']
-
- default_format = {'posix': 'gztar',
- 'nt': 'zip',
- 'os2': 'zip'}
-
- def initialize_options(self):
- self.bdist_dir = None
- self.plat_name = None
- self.format = None
- self.keep_temp = False
- self.dist_dir = None
- self.skip_build = None
- self.relative = False
- self.owner = None
- self.group = None
-
- def finalize_options(self):
- if self.bdist_dir is None:
- bdist_base = self.get_finalized_command('bdist').bdist_base
- self.bdist_dir = os.path.join(bdist_base, 'dumb')
-
- if self.format is None:
- try:
- self.format = self.default_format[os.name]
- except KeyError:
- raise PackagingPlatformError(
- "don't know how to create dumb built distributions "
- "on platform %s" % os.name)
-
- self.set_undefined_options('bdist',
- 'dist_dir', 'plat_name', 'skip_build')
-
- def run(self):
- if not self.skip_build:
- self.run_command('build')
-
- install = self.reinitialize_command('install_dist',
- reinit_subcommands=True)
- install.root = self.bdist_dir
- install.skip_build = self.skip_build
- install.warn_dir = False
-
- logger.info("installing to %s", self.bdist_dir)
- self.run_command('install_dist')
-
- # And make an archive relative to the root of the
- # pseudo-installation tree.
- archive_basename = "%s.%s" % (self.distribution.get_fullname(),
- self.plat_name)
-
- # OS/2 objects to any ":" characters in a filename (such as when
- # a timestamp is used in a version) so change them to hyphens.
- if os.name == "os2":
- archive_basename = archive_basename.replace(":", "-")
-
- pseudoinstall_root = os.path.join(self.dist_dir, archive_basename)
- if not self.relative:
- archive_root = self.bdist_dir
- else:
- if (self.distribution.has_ext_modules() and
- (install.install_base != install.install_platbase)):
- raise PackagingPlatformError(
- "can't make a dumb built distribution where base and "
- "platbase are different (%r, %r)" %
- (install.install_base, install.install_platbase))
- else:
- archive_root = os.path.join(
- self.bdist_dir,
- self._ensure_relative(install.install_base))
-
- # Make the archive
- filename = self.make_archive(pseudoinstall_root,
- self.format, root_dir=archive_root,
- owner=self.owner, group=self.group)
- if self.distribution.has_ext_modules():
- pyversion = get_python_version()
- else:
- pyversion = 'any'
- self.distribution.dist_files.append(('bdist_dumb', pyversion,
- filename))
-
- if not self.keep_temp:
- if self.dry_run:
- logger.info('removing %s', self.bdist_dir)
- else:
- rmtree(self.bdist_dir)
-
- def _ensure_relative(self, path):
- # copied from dir_util, deleted
- drive, path = os.path.splitdrive(path)
- if path[0:1] == os.sep:
- path = drive + path[1:]
- return path
diff --git a/Lib/packaging/command/bdist_msi.py b/Lib/packaging/command/bdist_msi.py
deleted file mode 100644
index 995eec57e5..0000000000
--- a/Lib/packaging/command/bdist_msi.py
+++ /dev/null
@@ -1,743 +0,0 @@
-"""Create a Microsoft Installer (.msi) binary distribution."""
-
-# Copyright (C) 2005, 2006 Martin von Löwis
-# Licensed to PSF under a Contributor Agreement.
-
-import sys
-import os
-import msilib
-
-from shutil import rmtree
-from sysconfig import get_python_version
-from packaging.command.cmd import Command
-from packaging.version import NormalizedVersion
-from packaging.errors import PackagingOptionError
-from packaging import logger as log
-from packaging.util import get_platform
-from msilib import schema, sequence, text
-from msilib import Directory, Feature, Dialog, add_data
-
-class MSIVersion(NormalizedVersion):
- """
- MSI ProductVersion must be strictly numeric.
- MSIVersion disallows prerelease and postrelease versions.
- """
- def __init__(self, *args, **kwargs):
- super(MSIVersion, self).__init__(*args, **kwargs)
- if not self.is_final:
- raise ValueError("ProductVersion must be strictly numeric")
-
-class PyDialog(Dialog):
- """Dialog class with a fixed layout: controls at the top, then a ruler,
- then a list of buttons: back, next, cancel. Optionally a bitmap at the
- left."""
- def __init__(self, *args, **kw):
- """Dialog(database, name, x, y, w, h, attributes, title, first,
- default, cancel, bitmap=true)"""
- super(PyDialog, self).__init__(*args)
- ruler = self.h - 36
- #if kw.get("bitmap", True):
- # self.bitmap("Bitmap", 0, 0, bmwidth, ruler, "PythonWin")
- self.line("BottomLine", 0, ruler, self.w, 0)
-
- def title(self, title):
- "Set the title text of the dialog at the top."
- # name, x, y, w, h, flags=Visible|Enabled|Transparent|NoPrefix,
- # text, in VerdanaBold10
- self.text("Title", 15, 10, 320, 60, 0x30003,
- r"{\VerdanaBold10}%s" % title)
-
- def back(self, title, next, name = "Back", active = 1):
- """Add a back button with a given title, the tab-next button,
- its name in the Control table, possibly initially disabled.
-
- Return the button, so that events can be associated"""
- if active:
- flags = 3 # Visible|Enabled
- else:
- flags = 1 # Visible
- return self.pushbutton(name, 180, self.h-27 , 56, 17, flags, title, next)
-
- def cancel(self, title, next, name = "Cancel", active = 1):
- """Add a cancel button with a given title, the tab-next button,
- its name in the Control table, possibly initially disabled.
-
- Return the button, so that events can be associated"""
- if active:
- flags = 3 # Visible|Enabled
- else:
- flags = 1 # Visible
- return self.pushbutton(name, 304, self.h-27, 56, 17, flags, title, next)
-
- def next(self, title, next, name = "Next", active = 1):
- """Add a Next button with a given title, the tab-next button,
- its name in the Control table, possibly initially disabled.
-
- Return the button, so that events can be associated"""
- if active:
- flags = 3 # Visible|Enabled
- else:
- flags = 1 # Visible
- return self.pushbutton(name, 236, self.h-27, 56, 17, flags, title, next)
-
- def xbutton(self, name, title, next, xpos):
- """Add a button with a given title, the tab-next button,
- its name in the Control table, giving its x position; the
- y-position is aligned with the other buttons.
-
- Return the button, so that events can be associated"""
- return self.pushbutton(name, int(self.w*xpos - 28), self.h-27, 56, 17, 3, title, next)
-
-class bdist_msi(Command):
-
- description = "create a Microsoft Installer (.msi) binary distribution"
-
- user_options = [('bdist-dir=', None,
- "temporary directory for creating the distribution"),
- ('plat-name=', 'p',
- "platform name to embed in generated filenames "
- "(default: %s)" % get_platform()),
- ('keep-temp', 'k',
- "keep the pseudo-installation tree around after " +
- "creating the distribution archive"),
- ('target-version=', None,
- "require a specific python version" +
- " on the target system"),
- ('no-target-compile', 'c',
- "do not compile .py to .pyc on the target system"),
- ('no-target-optimize', 'o',
- "do not compile .py to .pyo (optimized)"
- "on the target system"),
- ('dist-dir=', 'd',
- "directory to put final built distributions in"),
- ('skip-build', None,
- "skip rebuilding everything (for testing/debugging)"),
- ('install-script=', None,
- "basename of installation script to be run after"
- "installation or before deinstallation"),
- ('pre-install-script=', None,
- "Fully qualified filename of a script to be run before "
- "any files are installed. This script need not be in the "
- "distribution"),
- ]
-
- boolean_options = ['keep-temp', 'no-target-compile', 'no-target-optimize',
- 'skip-build']
-
- all_versions = ['2.0', '2.1', '2.2', '2.3', '2.4',
- '2.5', '2.6', '2.7', '2.8', '2.9',
- '3.0', '3.1', '3.2', '3.3', '3.4',
- '3.5', '3.6', '3.7', '3.8', '3.9']
- other_version = 'X'
-
- def initialize_options(self):
- self.bdist_dir = None
- self.plat_name = None
- self.keep_temp = False
- self.no_target_compile = False
- self.no_target_optimize = False
- self.target_version = None
- self.dist_dir = None
- self.skip_build = None
- self.install_script = None
- self.pre_install_script = None
- self.versions = None
-
- def finalize_options(self):
- self.set_undefined_options('bdist', 'skip_build')
-
- if self.bdist_dir is None:
- bdist_base = self.get_finalized_command('bdist').bdist_base
- self.bdist_dir = os.path.join(bdist_base, 'msi')
-
- short_version = get_python_version()
- if (not self.target_version) and self.distribution.has_ext_modules():
- self.target_version = short_version
-
- if self.target_version:
- self.versions = [self.target_version]
- if not self.skip_build and self.distribution.has_ext_modules()\
- and self.target_version != short_version:
- raise PackagingOptionError("target version can only be %s, or the '--skip-build'" \
- " option must be specified" % (short_version,))
- else:
- self.versions = list(self.all_versions)
-
- self.set_undefined_options('bdist', 'dist_dir', 'plat_name')
-
- if self.pre_install_script:
- raise PackagingOptionError("the pre-install-script feature is not yet implemented")
-
- if self.install_script:
- for script in self.distribution.scripts:
- if self.install_script == os.path.basename(script):
- break
- else:
- raise PackagingOptionError("install_script '%s' not found in scripts" % \
- self.install_script)
- self.install_script_key = None
-
-
- def run(self):
- if not self.skip_build:
- self.run_command('build')
-
- install = self.reinitialize_command('install_dist',
- reinit_subcommands=True)
- install.prefix = self.bdist_dir
- install.skip_build = self.skip_build
- install.warn_dir = False
-
- install_lib = self.reinitialize_command('install_lib')
- # we do not want to include pyc or pyo files
- install_lib.compile = False
- install_lib.optimize = 0
-
- if self.distribution.has_ext_modules():
- # If we are building an installer for a Python version other
- # than the one we are currently running, then we need to ensure
- # our build_lib reflects the other Python version rather than ours.
- # Note that for target_version!=sys.version, we must have skipped the
- # build step, so there is no issue with enforcing the build of this
- # version.
- target_version = self.target_version
- if not target_version:
- assert self.skip_build, "Should have already checked this"
- target_version = '%s.%s' % sys.version_info[:2]
- plat_specifier = ".%s-%s" % (self.plat_name, target_version)
- build = self.get_finalized_command('build')
- build.build_lib = os.path.join(build.build_base,
- 'lib' + plat_specifier)
-
- log.info("installing to %s", self.bdist_dir)
- install.ensure_finalized()
-
- # avoid warning of 'install_lib' about installing
- # into a directory not in sys.path
- sys.path.insert(0, os.path.join(self.bdist_dir, 'PURELIB'))
-
- install.run()
-
- del sys.path[0]
-
- self.mkpath(self.dist_dir)
- fullname = self.distribution.get_fullname()
- installer_name = self.get_installer_filename(fullname)
- installer_name = os.path.abspath(installer_name)
- if os.path.exists(installer_name): os.unlink(installer_name)
-
- metadata = self.distribution.metadata
- author = metadata.author
- if not author:
- author = metadata.maintainer
- if not author:
- author = "UNKNOWN"
- version = MSIVersion(metadata.get_version())
- # Prefix ProductName with Python x.y, so that
- # it sorts together with the other Python packages
- # in Add-Remove-Programs (APR)
- fullname = self.distribution.get_fullname()
- if self.target_version:
- product_name = "Python %s %s" % (self.target_version, fullname)
- else:
- product_name = "Python %s" % (fullname)
- self.db = msilib.init_database(installer_name, schema,
- product_name, msilib.gen_uuid(),
- str(version), author)
- msilib.add_tables(self.db, sequence)
- props = [('DistVersion', version)]
- email = metadata.author_email or metadata.maintainer_email
- if email:
- props.append(("ARPCONTACT", email))
- if metadata.url:
- props.append(("ARPURLINFOABOUT", metadata.url))
- if props:
- add_data(self.db, 'Property', props)
-
- self.add_find_python()
- self.add_files()
- self.add_scripts()
- self.add_ui()
- self.db.Commit()
-
- if hasattr(self.distribution, 'dist_files'):
- tup = 'bdist_msi', self.target_version or 'any', fullname
- self.distribution.dist_files.append(tup)
-
- if not self.keep_temp:
- log.info("removing temporary build directory %s", self.bdist_dir)
- if not self.dry_run:
- rmtree(self.bdist_dir)
-
- def add_files(self):
- db = self.db
- cab = msilib.CAB("distfiles")
- rootdir = os.path.abspath(self.bdist_dir)
-
- root = Directory(db, cab, None, rootdir, "TARGETDIR", "SourceDir")
- f = Feature(db, "Python", "Python", "Everything",
- 0, 1, directory="TARGETDIR")
-
- items = [(f, root, '')]
- for version in self.versions + [self.other_version]:
- target = "TARGETDIR" + version
- name = default = "Python" + version
- desc = "Everything"
- if version is self.other_version:
- title = "Python from another location"
- level = 2
- else:
- title = "Python %s from registry" % version
- level = 1
- f = Feature(db, name, title, desc, 1, level, directory=target)
- dir = Directory(db, cab, root, rootdir, target, default)
- items.append((f, dir, version))
- db.Commit()
-
- seen = {}
- for feature, dir, version in items:
- todo = [dir]
- while todo:
- dir = todo.pop()
- for file in os.listdir(dir.absolute):
- afile = os.path.join(dir.absolute, file)
- if os.path.isdir(afile):
- short = "%s|%s" % (dir.make_short(file), file)
- default = file + version
- newdir = Directory(db, cab, dir, file, default, short)
- todo.append(newdir)
- else:
- if not dir.component:
- dir.start_component(dir.logical, feature, 0)
- if afile not in seen:
- key = seen[afile] = dir.add_file(file)
- if file==self.install_script:
- if self.install_script_key:
- raise PackagingOptionError(
- "Multiple files with name %s" % file)
- self.install_script_key = '[#%s]' % key
- else:
- key = seen[afile]
- add_data(self.db, "DuplicateFile",
- [(key + version, dir.component, key, None, dir.logical)])
- db.Commit()
- cab.commit(db)
-
- def add_find_python(self):
- """Adds code to the installer to compute the location of Python.
-
- Properties PYTHON.MACHINE.X.Y and PYTHON.USER.X.Y will be set from the
- registry for each version of Python.
-
- Properties TARGETDIRX.Y will be set from PYTHON.USER.X.Y if defined,
- else from PYTHON.MACHINE.X.Y.
-
- Properties PYTHONX.Y will be set to TARGETDIRX.Y\\python.exe"""
-
- start = 402
- for ver in self.versions:
- install_path = r"SOFTWARE\Python\PythonCore\%s\InstallPath" % ver
- machine_reg = "python.machine." + ver
- user_reg = "python.user." + ver
- machine_prop = "PYTHON.MACHINE." + ver
- user_prop = "PYTHON.USER." + ver
- machine_action = "PythonFromMachine" + ver
- user_action = "PythonFromUser" + ver
- exe_action = "PythonExe" + ver
- target_dir_prop = "TARGETDIR" + ver
- exe_prop = "PYTHON" + ver
- if msilib.Win64:
- # type: msidbLocatorTypeRawValue + msidbLocatorType64bit
- Type = 2+16
- else:
- Type = 2
- add_data(self.db, "RegLocator",
- [(machine_reg, 2, install_path, None, Type),
- (user_reg, 1, install_path, None, Type)])
- add_data(self.db, "AppSearch",
- [(machine_prop, machine_reg),
- (user_prop, user_reg)])
- add_data(self.db, "CustomAction",
- [(machine_action, 51+256, target_dir_prop, "[" + machine_prop + "]"),
- (user_action, 51+256, target_dir_prop, "[" + user_prop + "]"),
- (exe_action, 51+256, exe_prop, "[" + target_dir_prop + "]\\python.exe"),
- ])
- add_data(self.db, "InstallExecuteSequence",
- [(machine_action, machine_prop, start),
- (user_action, user_prop, start + 1),
- (exe_action, None, start + 2),
- ])
- add_data(self.db, "InstallUISequence",
- [(machine_action, machine_prop, start),
- (user_action, user_prop, start + 1),
- (exe_action, None, start + 2),
- ])
- add_data(self.db, "Condition",
- [("Python" + ver, 0, "NOT TARGETDIR" + ver)])
- start += 4
- assert start < 500
-
- def add_scripts(self):
- if self.install_script:
- start = 6800
- for ver in self.versions + [self.other_version]:
- install_action = "install_script." + ver
- exe_prop = "PYTHON" + ver
- add_data(self.db, "CustomAction",
- [(install_action, 50, exe_prop, self.install_script_key)])
- add_data(self.db, "InstallExecuteSequence",
- [(install_action, "&Python%s=3" % ver, start)])
- start += 1
- # XXX pre-install scripts are currently refused in finalize_options()
- # but if this feature is completed, it will also need to add
- # entries for each version as the above code does
- if self.pre_install_script:
- scriptfn = os.path.join(self.bdist_dir, "preinstall.bat")
- with open(scriptfn, "w") as f:
- # The batch file will be executed with [PYTHON], so that %1
- # is the path to the Python interpreter; %0 will be the path
- # of the batch file.
- # rem ="""
- # %1 %0
- # exit
- # """
- #
- f.write('rem ="""\n%1 %0\nexit\n"""\n')
- with open(self.pre_install_script) as fp:
- f.write(fp.read())
- add_data(self.db, "Binary",
- [("PreInstall", msilib.Binary(scriptfn)),
- ])
- add_data(self.db, "CustomAction",
- [("PreInstall", 2, "PreInstall", None),
- ])
- add_data(self.db, "InstallExecuteSequence",
- [("PreInstall", "NOT Installed", 450),
- ])
-
- def add_ui(self):
- db = self.db
- x = y = 50
- w = 370
- h = 300
- title = "[ProductName] Setup"
-
- # see "Dialog Style Bits"
- modal = 3 # visible | modal
- modeless = 1 # visible
-
- # UI customization properties
- add_data(db, "Property",
- # See "DefaultUIFont Property"
- [("DefaultUIFont", "DlgFont8"),
- # See "ErrorDialog Style Bit"
- ("ErrorDialog", "ErrorDlg"),
- ("Progress1", "Install"), # modified in maintenance type dlg
- ("Progress2", "installs"),
- ("MaintenanceForm_Action", "Repair"),
- # possible values: ALL, JUSTME
- ("WhichUsers", "ALL")
- ])
-
- # Fonts, see "TextStyle Table"
- add_data(db, "TextStyle",
- [("DlgFont8", "Tahoma", 9, None, 0),
- ("DlgFontBold8", "Tahoma", 8, None, 1), #bold
- ("VerdanaBold10", "Verdana", 10, None, 1),
- ("VerdanaRed9", "Verdana", 9, 255, 0),
- ])
-
- # UI Sequences, see "InstallUISequence Table", "Using a Sequence Table"
- # Numbers indicate sequence; see sequence.py for how these action integrate
- add_data(db, "InstallUISequence",
- [("PrepareDlg", "Not Privileged or Windows9x or Installed", 140),
- ("WhichUsersDlg", "Privileged and not Windows9x and not Installed", 141),
- # In the user interface, assume all-users installation if privileged.
- ("SelectFeaturesDlg", "Not Installed", 1230),
- # XXX no support for resume installations yet
- #("ResumeDlg", "Installed AND (RESUME OR Preselected)", 1240),
- ("MaintenanceTypeDlg", "Installed AND NOT RESUME AND NOT Preselected", 1250),
- ("ProgressDlg", None, 1280)])
-
- add_data(db, 'ActionText', text.ActionText)
- add_data(db, 'UIText', text.UIText)
- #####################################################################
- # Standard dialogs: FatalError, UserExit, ExitDialog
- fatal=PyDialog(db, "FatalError", x, y, w, h, modal, title,
- "Finish", "Finish", "Finish")
- fatal.title("[ProductName] Installer ended prematurely")
- fatal.back("< Back", "Finish", active = 0)
- fatal.cancel("Cancel", "Back", active = 0)
- fatal.text("Description1", 15, 70, 320, 80, 0x30003,
- "[ProductName] setup ended prematurely because of an error. Your system has not been modified. To install this program at a later time, please run the installation again.")
- fatal.text("Description2", 15, 155, 320, 20, 0x30003,
- "Click the Finish button to exit the Installer.")
- c=fatal.next("Finish", "Cancel", name="Finish")
- c.event("EndDialog", "Exit")
-
- user_exit=PyDialog(db, "UserExit", x, y, w, h, modal, title,
- "Finish", "Finish", "Finish")
- user_exit.title("[ProductName] Installer was interrupted")
- user_exit.back("< Back", "Finish", active = 0)
- user_exit.cancel("Cancel", "Back", active = 0)
- user_exit.text("Description1", 15, 70, 320, 80, 0x30003,
- "[ProductName] setup was interrupted. Your system has not been modified. "
- "To install this program at a later time, please run the installation again.")
- user_exit.text("Description2", 15, 155, 320, 20, 0x30003,
- "Click the Finish button to exit the Installer.")
- c = user_exit.next("Finish", "Cancel", name="Finish")
- c.event("EndDialog", "Exit")
-
- exit_dialog = PyDialog(db, "ExitDialog", x, y, w, h, modal, title,
- "Finish", "Finish", "Finish")
- exit_dialog.title("Completing the [ProductName] Installer")
- exit_dialog.back("< Back", "Finish", active = 0)
- exit_dialog.cancel("Cancel", "Back", active = 0)
- exit_dialog.text("Description", 15, 235, 320, 20, 0x30003,
- "Click the Finish button to exit the Installer.")
- c = exit_dialog.next("Finish", "Cancel", name="Finish")
- c.event("EndDialog", "Return")
-
- #####################################################################
- # Required dialog: FilesInUse, ErrorDlg
- inuse = PyDialog(db, "FilesInUse",
- x, y, w, h,
- 19, # KeepModeless|Modal|Visible
- title,
- "Retry", "Retry", "Retry", bitmap=False)
- inuse.text("Title", 15, 6, 200, 15, 0x30003,
- r"{\DlgFontBold8}Files in Use")
- inuse.text("Description", 20, 23, 280, 20, 0x30003,
- "Some files that need to be updated are currently in use.")
- inuse.text("Text", 20, 55, 330, 50, 3,
- "The following applications are using files that need to be updated by this setup. Close these applications and then click Retry to continue the installation or Cancel to exit it.")
- inuse.control("List", "ListBox", 20, 107, 330, 130, 7, "FileInUseProcess",
- None, None, None)
- c=inuse.back("Exit", "Ignore", name="Exit")
- c.event("EndDialog", "Exit")
- c=inuse.next("Ignore", "Retry", name="Ignore")
- c.event("EndDialog", "Ignore")
- c=inuse.cancel("Retry", "Exit", name="Retry")
- c.event("EndDialog","Retry")
-
- # See "Error Dialog". See "ICE20" for the required names of the controls.
- error = Dialog(db, "ErrorDlg",
- 50, 10, 330, 101,
- 65543, # Error|Minimize|Modal|Visible
- title,
- "ErrorText", None, None)
- error.text("ErrorText", 50,9,280,48,3, "")
- #error.control("ErrorIcon", "Icon", 15, 9, 24, 24, 5242881, None, "py.ico", None, None)
- error.pushbutton("N",120,72,81,21,3,"No",None).event("EndDialog","ErrorNo")
- error.pushbutton("Y",240,72,81,21,3,"Yes",None).event("EndDialog","ErrorYes")
- error.pushbutton("A",0,72,81,21,3,"Abort",None).event("EndDialog","ErrorAbort")
- error.pushbutton("C",42,72,81,21,3,"Cancel",None).event("EndDialog","ErrorCancel")
- error.pushbutton("I",81,72,81,21,3,"Ignore",None).event("EndDialog","ErrorIgnore")
- error.pushbutton("O",159,72,81,21,3,"Ok",None).event("EndDialog","ErrorOk")
- error.pushbutton("R",198,72,81,21,3,"Retry",None).event("EndDialog","ErrorRetry")
-
- #####################################################################
- # Global "Query Cancel" dialog
- cancel = Dialog(db, "CancelDlg", 50, 10, 260, 85, 3, title,
- "No", "No", "No")
- cancel.text("Text", 48, 15, 194, 30, 3,
- "Are you sure you want to cancel [ProductName] installation?")
- #cancel.control("Icon", "Icon", 15, 15, 24, 24, 5242881, None,
- # "py.ico", None, None)
- c=cancel.pushbutton("Yes", 72, 57, 56, 17, 3, "Yes", "No")
- c.event("EndDialog", "Exit")
-
- c=cancel.pushbutton("No", 132, 57, 56, 17, 3, "No", "Yes")
- c.event("EndDialog", "Return")
-
- #####################################################################
- # Global "Wait for costing" dialog
- costing = Dialog(db, "WaitForCostingDlg", 50, 10, 260, 85, modal, title,
- "Return", "Return", "Return")
- costing.text("Text", 48, 15, 194, 30, 3,
- "Please wait while the installer finishes determining your disk space requirements.")
- c = costing.pushbutton("Return", 102, 57, 56, 17, 3, "Return", None)
- c.event("EndDialog", "Exit")
-
- #####################################################################
- # Preparation dialog: no user input except cancellation
- prep = PyDialog(db, "PrepareDlg", x, y, w, h, modeless, title,
- "Cancel", "Cancel", "Cancel")
- prep.text("Description", 15, 70, 320, 40, 0x30003,
- "Please wait while the Installer prepares to guide you through the installation.")
- prep.title("Welcome to the [ProductName] Installer")
- c=prep.text("ActionText", 15, 110, 320, 20, 0x30003, "Pondering...")
- c.mapping("ActionText", "Text")
- c=prep.text("ActionData", 15, 135, 320, 30, 0x30003, None)
- c.mapping("ActionData", "Text")
- prep.back("Back", None, active=0)
- prep.next("Next", None, active=0)
- c=prep.cancel("Cancel", None)
- c.event("SpawnDialog", "CancelDlg")
-
- #####################################################################
- # Feature (Python directory) selection
- seldlg = PyDialog(db, "SelectFeaturesDlg", x, y, w, h, modal, title,
- "Next", "Next", "Cancel")
- seldlg.title("Select Python Installations")
-
- seldlg.text("Hint", 15, 30, 300, 20, 3,
- "Select the Python locations where %s should be installed."
- % self.distribution.get_fullname())
-
- seldlg.back("< Back", None, active=0)
- c = seldlg.next("Next >", "Cancel")
- order = 1
- c.event("[TARGETDIR]", "[SourceDir]", ordering=order)
- for version in self.versions + [self.other_version]:
- order += 1
- c.event("[TARGETDIR]", "[TARGETDIR%s]" % version,
- "FEATURE_SELECTED AND &Python%s=3" % version,
- ordering=order)
- c.event("SpawnWaitDialog", "WaitForCostingDlg", ordering=order + 1)
- c.event("EndDialog", "Return", ordering=order + 2)
- c = seldlg.cancel("Cancel", "Features")
- c.event("SpawnDialog", "CancelDlg")
-
- c = seldlg.control("Features", "SelectionTree", 15, 60, 300, 120, 3,
- "FEATURE", None, "PathEdit", None)
- c.event("[FEATURE_SELECTED]", "1")
- ver = self.other_version
- install_other_cond = "FEATURE_SELECTED AND &Python%s=3" % ver
- dont_install_other_cond = "FEATURE_SELECTED AND &Python%s<>3" % ver
-
- c = seldlg.text("Other", 15, 200, 300, 15, 3,
- "Provide an alternate Python location")
- c.condition("Enable", install_other_cond)
- c.condition("Show", install_other_cond)
- c.condition("Disable", dont_install_other_cond)
- c.condition("Hide", dont_install_other_cond)
-
- c = seldlg.control("PathEdit", "PathEdit", 15, 215, 300, 16, 1,
- "TARGETDIR" + ver, None, "Next", None)
- c.condition("Enable", install_other_cond)
- c.condition("Show", install_other_cond)
- c.condition("Disable", dont_install_other_cond)
- c.condition("Hide", dont_install_other_cond)
-
- #####################################################################
- # Disk cost
- cost = PyDialog(db, "DiskCostDlg", x, y, w, h, modal, title,
- "OK", "OK", "OK", bitmap=False)
- cost.text("Title", 15, 6, 200, 15, 0x30003,
- "{\DlgFontBold8}Disk Space Requirements")
- cost.text("Description", 20, 20, 280, 20, 0x30003,
- "The disk space required for the installation of the selected features.")
- cost.text("Text", 20, 53, 330, 60, 3,
- "The highlighted volumes (if any) do not have enough disk space "
- "available for the currently selected features. You can either "
- "remove some files from the highlighted volumes, or choose to "
- "install less features onto local drive(s), or select different "
- "destination drive(s).")
- cost.control("VolumeList", "VolumeCostList", 20, 100, 330, 150, 393223,
- None, "{120}{70}{70}{70}{70}", None, None)
- cost.xbutton("OK", "Ok", None, 0.5).event("EndDialog", "Return")
-
- #####################################################################
- # WhichUsers Dialog. Only available on NT, and for privileged users.
- # This must be run before FindRelatedProducts, because that will
- # take into account whether the previous installation was per-user
- # or per-machine. We currently don't support going back to this
- # dialog after "Next" was selected; to support this, we would need to
- # find how to reset the ALLUSERS property, and how to re-run
- # FindRelatedProducts.
- # On Windows9x, the ALLUSERS property is ignored on the command line
- # and in the Property table, but installer fails according to the documentation
- # if a dialog attempts to set ALLUSERS.
- whichusers = PyDialog(db, "WhichUsersDlg", x, y, w, h, modal, title,
- "AdminInstall", "Next", "Cancel")
- whichusers.title("Select whether to install [ProductName] for all users of this computer.")
- # A radio group with two options: allusers, justme
- g = whichusers.radiogroup("AdminInstall", 15, 60, 260, 50, 3,
- "WhichUsers", "", "Next")
- g.add("ALL", 0, 5, 150, 20, "Install for all users")
- g.add("JUSTME", 0, 25, 150, 20, "Install just for me")
-
- whichusers.back("Back", None, active=0)
-
- c = whichusers.next("Next >", "Cancel")
- c.event("[ALLUSERS]", "1", 'WhichUsers="ALL"', 1)
- c.event("EndDialog", "Return", ordering = 2)
-
- c = whichusers.cancel("Cancel", "AdminInstall")
- c.event("SpawnDialog", "CancelDlg")
-
- #####################################################################
- # Installation Progress dialog (modeless)
- progress = PyDialog(db, "ProgressDlg", x, y, w, h, modeless, title,
- "Cancel", "Cancel", "Cancel", bitmap=False)
- progress.text("Title", 20, 15, 200, 15, 0x30003,
- "{\DlgFontBold8}[Progress1] [ProductName]")
- progress.text("Text", 35, 65, 300, 30, 3,
- "Please wait while the Installer [Progress2] [ProductName]. "
- "This may take several minutes.")
- progress.text("StatusLabel", 35, 100, 35, 20, 3, "Status:")
-
- c=progress.text("ActionText", 70, 100, w-70, 20, 3, "Pondering...")
- c.mapping("ActionText", "Text")
-
- #c=progress.text("ActionData", 35, 140, 300, 20, 3, None)
- #c.mapping("ActionData", "Text")
-
- c=progress.control("ProgressBar", "ProgressBar", 35, 120, 300, 10, 65537,
- None, "Progress done", None, None)
- c.mapping("SetProgress", "Progress")
-
- progress.back("< Back", "Next", active=False)
- progress.next("Next >", "Cancel", active=False)
- progress.cancel("Cancel", "Back").event("SpawnDialog", "CancelDlg")
-
- ###################################################################
- # Maintenance type: repair/uninstall
- maint = PyDialog(db, "MaintenanceTypeDlg", x, y, w, h, modal, title,
- "Next", "Next", "Cancel")
- maint.title("Welcome to the [ProductName] Setup Wizard")
- maint.text("BodyText", 15, 63, 330, 42, 3,
- "Select whether you want to repair or remove [ProductName].")
- g=maint.radiogroup("RepairRadioGroup", 15, 108, 330, 60, 3,
- "MaintenanceForm_Action", "", "Next")
- #g.add("Change", 0, 0, 200, 17, "&Change [ProductName]")
- g.add("Repair", 0, 18, 200, 17, "&Repair [ProductName]")
- g.add("Remove", 0, 36, 200, 17, "Re&move [ProductName]")
-
- maint.back("< Back", None, active=False)
- c=maint.next("Finish", "Cancel")
- # Change installation: Change progress dialog to "Change", then ask
- # for feature selection
- #c.event("[Progress1]", "Change", 'MaintenanceForm_Action="Change"', 1)
- #c.event("[Progress2]", "changes", 'MaintenanceForm_Action="Change"', 2)
-
- # Reinstall: Change progress dialog to "Repair", then invoke reinstall
- # Also set list of reinstalled features to "ALL"
- c.event("[REINSTALL]", "ALL", 'MaintenanceForm_Action="Repair"', 5)
- c.event("[Progress1]", "Repairing", 'MaintenanceForm_Action="Repair"', 6)
- c.event("[Progress2]", "repairs", 'MaintenanceForm_Action="Repair"', 7)
- c.event("Reinstall", "ALL", 'MaintenanceForm_Action="Repair"', 8)
-
- # Uninstall: Change progress to "Remove", then invoke uninstall
- # Also set list of removed features to "ALL"
- c.event("[REMOVE]", "ALL", 'MaintenanceForm_Action="Remove"', 11)
- c.event("[Progress1]", "Removing", 'MaintenanceForm_Action="Remove"', 12)
- c.event("[Progress2]", "removes", 'MaintenanceForm_Action="Remove"', 13)
- c.event("Remove", "ALL", 'MaintenanceForm_Action="Remove"', 14)
-
- # Close dialog when maintenance action scheduled
- c.event("EndDialog", "Return", 'MaintenanceForm_Action<>"Change"', 20)
- #c.event("NewDialog", "SelectFeaturesDlg", 'MaintenanceForm_Action="Change"', 21)
-
- maint.cancel("Cancel", "RepairRadioGroup").event("SpawnDialog", "CancelDlg")
-
- def get_installer_filename(self, fullname):
- # Factored out to allow overriding in subclasses
- if self.target_version:
- base_name = "%s.%s-py%s.msi" % (fullname, self.plat_name,
- self.target_version)
- else:
- base_name = "%s.%s.msi" % (fullname, self.plat_name)
- installer_name = os.path.join(self.dist_dir, base_name)
- return installer_name
diff --git a/Lib/packaging/command/bdist_wininst.py b/Lib/packaging/command/bdist_wininst.py
deleted file mode 100644
index 3c66360ecd..0000000000
--- a/Lib/packaging/command/bdist_wininst.py
+++ /dev/null
@@ -1,345 +0,0 @@
-"""Create an executable installer for Windows."""
-
-import sys
-import os
-
-from shutil import rmtree
-from sysconfig import get_python_version
-from packaging.command.cmd import Command
-from packaging.errors import PackagingOptionError, PackagingPlatformError
-from packaging import logger
-from packaging.util import get_platform
-
-
-class bdist_wininst(Command):
-
- description = "create an executable installer for Windows"
-
- user_options = [('bdist-dir=', None,
- "temporary directory for creating the distribution"),
- ('plat-name=', 'p',
- "platform name to embed in generated filenames "
- "(default: %s)" % get_platform()),
- ('keep-temp', 'k',
- "keep the pseudo-installation tree around after " +
- "creating the distribution archive"),
- ('target-version=', None,
- "require a specific python version" +
- " on the target system"),
- ('no-target-compile', 'c',
- "do not compile .py to .pyc on the target system"),
- ('no-target-optimize', 'o',
- "do not compile .py to .pyo (optimized)"
- "on the target system"),
- ('dist-dir=', 'd',
- "directory to put final built distributions in"),
- ('bitmap=', 'b',
- "bitmap to use for the installer instead of python-powered logo"),
- ('title=', 't',
- "title to display on the installer background instead of default"),
- ('skip-build', None,
- "skip rebuilding everything (for testing/debugging)"),
- ('install-script=', None,
- "basename of installation script to be run after"
- "installation or before deinstallation"),
- ('pre-install-script=', None,
- "Fully qualified filename of a script to be run before "
- "any files are installed. This script need not be in the "
- "distribution"),
- ('user-access-control=', None,
- "specify Vista's UAC handling - 'none'/default=no "
- "handling, 'auto'=use UAC if target Python installed for "
- "all users, 'force'=always use UAC"),
- ]
-
- boolean_options = ['keep-temp', 'no-target-compile', 'no-target-optimize',
- 'skip-build']
-
- def initialize_options(self):
- self.bdist_dir = None
- self.plat_name = None
- self.keep_temp = False
- self.no_target_compile = False
- self.no_target_optimize = False
- self.target_version = None
- self.dist_dir = None
- self.bitmap = None
- self.title = None
- self.skip_build = None
- self.install_script = None
- self.pre_install_script = None
- self.user_access_control = None
-
-
- def finalize_options(self):
- self.set_undefined_options('bdist', 'skip_build')
-
- if self.bdist_dir is None:
- if self.skip_build and self.plat_name:
- # If build is skipped and plat_name is overridden, bdist will
- # not see the correct 'plat_name' - so set that up manually.
- bdist = self.distribution.get_command_obj('bdist')
- bdist.plat_name = self.plat_name
- # next the command will be initialized using that name
- bdist_base = self.get_finalized_command('bdist').bdist_base
- self.bdist_dir = os.path.join(bdist_base, 'wininst')
-
- if not self.target_version:
- self.target_version = ""
-
- if not self.skip_build and self.distribution.has_ext_modules():
- short_version = get_python_version()
- if self.target_version and self.target_version != short_version:
- raise PackagingOptionError("target version can only be %s, or the '--skip-build'" \
- " option must be specified" % (short_version,))
- self.target_version = short_version
-
- self.set_undefined_options('bdist', 'dist_dir', 'plat_name')
-
- if self.install_script:
- for script in self.distribution.scripts:
- if self.install_script == os.path.basename(script):
- break
- else:
- raise PackagingOptionError("install_script '%s' not found in scripts" % \
- self.install_script)
-
- def run(self):
- if (sys.platform != "win32" and
- (self.distribution.has_ext_modules() or
- self.distribution.has_c_libraries())):
- raise PackagingPlatformError \
- ("distribution contains extensions and/or C libraries; "
- "must be compiled on a Windows 32 platform")
-
- if not self.skip_build:
- self.run_command('build')
-
- install = self.reinitialize_command('install', reinit_subcommands=True)
- install.root = self.bdist_dir
- install.skip_build = self.skip_build
- install.warn_dir = False
- install.plat_name = self.plat_name
-
- install_lib = self.reinitialize_command('install_lib')
- # we do not want to include pyc or pyo files
- install_lib.compile = False
- install_lib.optimize = 0
-
- if self.distribution.has_ext_modules():
- # If we are building an installer for a Python version other
- # than the one we are currently running, then we need to ensure
- # our build_lib reflects the other Python version rather than ours.
- # Note that for target_version!=sys.version, we must have skipped the
- # build step, so there is no issue with enforcing the build of this
- # version.
- target_version = self.target_version
- if not target_version:
- assert self.skip_build, "Should have already checked this"
- target_version = '%s.%s' % sys.version_info[:2]
- plat_specifier = ".%s-%s" % (self.plat_name, target_version)
- build = self.get_finalized_command('build')
- build.build_lib = os.path.join(build.build_base,
- 'lib' + plat_specifier)
-
- # Use a custom scheme for the zip-file, because we have to decide
- # at installation time which scheme to use.
- for key in ('purelib', 'platlib', 'headers', 'scripts', 'data'):
- value = key.upper()
- if key == 'headers':
- value = value + '/Include/$dist_name'
- setattr(install,
- 'install_' + key,
- value)
-
- logger.info("installing to %s", self.bdist_dir)
- install.ensure_finalized()
-
- # avoid warning of 'install_lib' about installing
- # into a directory not in sys.path
- sys.path.insert(0, os.path.join(self.bdist_dir, 'PURELIB'))
-
- install.run()
-
- del sys.path[0]
-
- # And make an archive relative to the root of the
- # pseudo-installation tree.
- from tempfile import NamedTemporaryFile
- archive_basename = NamedTemporaryFile().name
- fullname = self.distribution.get_fullname()
- arcname = self.make_archive(archive_basename, "zip",
- root_dir=self.bdist_dir)
- # create an exe containing the zip-file
- self.create_exe(arcname, fullname, self.bitmap)
- if self.distribution.has_ext_modules():
- pyversion = get_python_version()
- else:
- pyversion = 'any'
- self.distribution.dist_files.append(('bdist_wininst', pyversion,
- self.get_installer_filename(fullname)))
- # remove the zip-file again
- logger.debug("removing temporary file '%s'", arcname)
- os.remove(arcname)
-
- if not self.keep_temp:
- logger.info('removing %s', self.bdist_dir)
- if not self.dry_run:
- rmtree(self.bdist_dir)
-
- def get_inidata(self):
- # Return data describing the installation.
-
- lines = []
- metadata = self.distribution.metadata
-
- # Write the [metadata] section.
- lines.append("[metadata]")
-
- # 'info' will be displayed in the installer's dialog box,
- # describing the items to be installed.
- info = (metadata.long_description or '') + '\n'
-
- # Escape newline characters
- def escape(s):
- return s.replace("\n", "\\n")
-
- for name in ["author", "author_email", "description", "maintainer",
- "maintainer_email", "name", "url", "version"]:
- data = getattr(metadata, name, "")
- if data:
- info = info + ("\n %s: %s" % \
- (name.capitalize(), escape(data)))
- lines.append("%s=%s" % (name, escape(data)))
-
- # The [setup] section contains entries controlling
- # the installer runtime.
- lines.append("\n[Setup]")
- if self.install_script:
- lines.append("install_script=%s" % self.install_script)
- lines.append("info=%s" % escape(info))
- lines.append("target_compile=%d" % (not self.no_target_compile))
- lines.append("target_optimize=%d" % (not self.no_target_optimize))
- if self.target_version:
- lines.append("target_version=%s" % self.target_version)
- if self.user_access_control:
- lines.append("user_access_control=%s" % self.user_access_control)
-
- title = self.title or self.distribution.get_fullname()
- lines.append("title=%s" % escape(title))
- import time
- import packaging
- build_info = "Built %s with packaging-%s" % \
- (time.ctime(time.time()), packaging.__version__)
- lines.append("build_info=%s" % build_info)
- return "\n".join(lines)
-
- def create_exe(self, arcname, fullname, bitmap=None):
- import struct
-
- self.mkpath(self.dist_dir)
-
- cfgdata = self.get_inidata()
-
- installer_name = self.get_installer_filename(fullname)
- logger.info("creating %s", installer_name)
-
- if bitmap:
- with open(bitmap, "rb") as fp:
- bitmapdata = fp.read()
- bitmaplen = len(bitmapdata)
- else:
- bitmaplen = 0
-
- with open(installer_name, "wb") as file:
- file.write(self.get_exe_bytes())
- if bitmap:
- file.write(bitmapdata)
-
- # Convert cfgdata from unicode to ascii, mbcs encoded
- if isinstance(cfgdata, str):
- cfgdata = cfgdata.encode("mbcs")
-
- # Append the pre-install script
- cfgdata = cfgdata + b"\0"
- if self.pre_install_script:
- # We need to normalize newlines, so we open in text mode and
- # convert back to bytes. "latin-1" simply avoids any possible
- # failures.
- with open(self.pre_install_script, encoding="latin-1") as fp:
- script_data = fp.read().encode("latin-1")
- cfgdata = cfgdata + script_data + b"\n\0"
- else:
- # empty pre-install script
- cfgdata = cfgdata + b"\0"
- file.write(cfgdata)
-
- # The 'magic number' 0x1234567B is used to make sure that the
- # binary layout of 'cfgdata' is what the wininst.exe binary
- # expects. If the layout changes, increment that number, make
- # the corresponding changes to the wininst.exe sources, and
- # recompile them.
- header = struct.pack(" cur_version:
- bv = get_build_version()
- else:
- if self.target_version < "2.4":
- bv = 6.0
- else:
- bv = 7.1
- else:
- # for current version - use authoritative check.
- bv = get_build_version()
-
- # wininst-x.y.exe is in the same directory as this file
- directory = os.path.dirname(__file__)
- # we must use a wininst-x.y.exe built with the same C compiler
- # used for python. XXX What about mingw, borland, and so on?
-
- # if plat_name starts with "win" but is not "win32"
- # we want to strip "win" and leave the rest (e.g. -amd64)
- # for all other cases, we don't want any suffix
- if self.plat_name != 'win32' and self.plat_name[:3] == 'win':
- sfix = self.plat_name[3:]
- else:
- sfix = ''
-
- filename = os.path.join(directory, "wininst-%.1f%s.exe" % (bv, sfix))
- with open(filename, "rb") as fp:
- return fp.read()
diff --git a/Lib/packaging/command/build.py b/Lib/packaging/command/build.py
deleted file mode 100644
index fcb50df4e4..0000000000
--- a/Lib/packaging/command/build.py
+++ /dev/null
@@ -1,151 +0,0 @@
-"""Main build command, which calls the other build_* commands."""
-
-import sys
-import os
-
-from packaging.util import get_platform
-from packaging.command.cmd import Command
-from packaging.errors import PackagingOptionError
-from packaging.compiler import show_compilers
-
-
-class build(Command):
-
- description = "build everything needed to install"
-
- user_options = [
- ('build-base=', 'b',
- "base directory for build library"),
- ('build-purelib=', None,
- "build directory for platform-neutral distributions"),
- ('build-platlib=', None,
- "build directory for platform-specific distributions"),
- ('build-lib=', None,
- "build directory for all distribution (defaults to either " +
- "build-purelib or build-platlib"),
- ('build-scripts=', None,
- "build directory for scripts"),
- ('build-temp=', 't',
- "temporary build directory"),
- ('plat-name=', 'p',
- "platform name to build for, if supported "
- "(default: %s)" % get_platform()),
- ('compiler=', 'c',
- "specify the compiler type"),
- ('debug', 'g',
- "compile extensions and libraries with debugging information"),
- ('force', 'f',
- "forcibly build everything (ignore file timestamps)"),
- ('executable=', 'e',
- "specify final destination interpreter path (build.py)"),
- ('use-2to3', None,
- "use 2to3 to make source python 3.x compatible"),
- ('convert-2to3-doctests', None,
- "use 2to3 to convert doctests in separate text files"),
- ('use-2to3-fixers', None,
- "list additional fixers opted for during 2to3 conversion"),
- ]
-
- boolean_options = ['debug', 'force']
-
- help_options = [
- ('help-compiler', None,
- "list available compilers", show_compilers),
- ]
-
- def initialize_options(self):
- self.build_base = 'build'
- # these are decided only after 'build_base' has its final value
- # (unless overridden by the user or client)
- self.build_purelib = None
- self.build_platlib = None
- self.build_lib = None
- self.build_temp = None
- self.build_scripts = None
- self.compiler = None
- self.plat_name = None
- self.debug = None
- self.force = False
- self.executable = None
- self.use_2to3 = False
- self.convert_2to3_doctests = None
- self.use_2to3_fixers = None
-
- def finalize_options(self):
- if self.plat_name is None:
- self.plat_name = get_platform()
- else:
- # plat-name only supported for windows (other platforms are
- # supported via ./configure flags, if at all). Avoid misleading
- # other platforms.
- if os.name != 'nt':
- raise PackagingOptionError(
- "--plat-name only supported on Windows (try "
- "using './configure --help' on your platform)")
- pyversion = '%s.%s' % sys.version_info[:2]
- plat_specifier = ".%s-%s" % (self.plat_name, pyversion)
-
- # Make it so Python 2.x and Python 2.x with --with-pydebug don't
- # share the same build directories. Doing so confuses the build
- # process for C modules
- if hasattr(sys, 'gettotalrefcount'):
- plat_specifier += '-pydebug'
-
- # 'build_purelib' and 'build_platlib' just default to 'lib' and
- # 'lib.' under the base build directory. We only use one of
- # them for a given distribution, though --
- if self.build_purelib is None:
- self.build_purelib = os.path.join(self.build_base, 'lib')
- if self.build_platlib is None:
- self.build_platlib = os.path.join(self.build_base,
- 'lib' + plat_specifier)
-
- # 'build_lib' is the actual directory that we will use for this
- # particular module distribution -- if user didn't supply it, pick
- # one of 'build_purelib' or 'build_platlib'.
- if self.build_lib is None:
- if self.distribution.ext_modules:
- self.build_lib = self.build_platlib
- else:
- self.build_lib = self.build_purelib
-
- # 'build_temp' -- temporary directory for compiler turds,
- # "build/temp."
- if self.build_temp is None:
- self.build_temp = os.path.join(self.build_base,
- 'temp' + plat_specifier)
- if self.build_scripts is None:
- self.build_scripts = os.path.join(self.build_base,
- 'scripts-' + pyversion)
-
- if self.executable is None:
- self.executable = os.path.normpath(sys.executable)
-
- def run(self):
- # Run all relevant sub-commands. This will be some subset of:
- # - build_py - pure Python modules
- # - build_clib - standalone C libraries
- # - build_ext - Python extension modules
- # - build_scripts - Python scripts
- for cmd_name in self.get_sub_commands():
- self.run_command(cmd_name)
-
- # -- Predicates for the sub-command list ---------------------------
-
- def has_pure_modules(self):
- return self.distribution.has_pure_modules()
-
- def has_c_libraries(self):
- return self.distribution.has_c_libraries()
-
- def has_ext_modules(self):
- return self.distribution.has_ext_modules()
-
- def has_scripts(self):
- return self.distribution.has_scripts()
-
- sub_commands = [('build_py', has_pure_modules),
- ('build_clib', has_c_libraries),
- ('build_ext', has_ext_modules),
- ('build_scripts', has_scripts),
- ]
diff --git a/Lib/packaging/command/build_clib.py b/Lib/packaging/command/build_clib.py
deleted file mode 100644
index 5388ccd4d4..0000000000
--- a/Lib/packaging/command/build_clib.py
+++ /dev/null
@@ -1,197 +0,0 @@
-"""Build C/C++ libraries.
-
-This command is useful to build libraries that are included in the
-distribution and needed by extension modules.
-"""
-
-# XXX this module has *lots* of code ripped-off quite transparently from
-# build_ext.py -- not surprisingly really, as the work required to build
-# a static library from a collection of C source files is not really all
-# that different from what's required to build a shared object file from
-# a collection of C source files. Nevertheless, I haven't done the
-# necessary refactoring to account for the overlap in code between the
-# two modules, mainly because a number of subtle details changed in the
-# cut 'n paste. Sigh.
-
-import os
-from packaging.command.cmd import Command
-from packaging.errors import PackagingSetupError
-from packaging.compiler import customize_compiler, new_compiler
-from packaging import logger
-
-
-def show_compilers():
- from packaging.compiler import show_compilers
- show_compilers()
-
-
-class build_clib(Command):
-
- description = "build C/C++ libraries used by extension modules"
-
- user_options = [
- ('build-clib=', 'b',
- "directory to build C/C++ libraries to"),
- ('build-temp=', 't',
- "directory to put temporary build by-products"),
- ('debug', 'g',
- "compile with debugging information"),
- ('force', 'f',
- "forcibly build everything (ignore file timestamps)"),
- ('compiler=', 'c',
- "specify the compiler type"),
- ]
-
- boolean_options = ['debug', 'force']
-
- help_options = [
- ('help-compiler', None,
- "list available compilers", show_compilers),
- ]
-
- def initialize_options(self):
- self.build_clib = None
- self.build_temp = None
-
- # List of libraries to build
- self.libraries = None
-
- # Compilation options for all libraries
- self.include_dirs = None
- self.define = None
- self.undef = None
- self.debug = None
- self.force = False
- self.compiler = None
-
-
- def finalize_options(self):
- # This might be confusing: both build-clib and build-temp default
- # to build-temp as defined by the "build" command. This is because
- # I think that C libraries are really just temporary build
- # by-products, at least from the point of view of building Python
- # extensions -- but I want to keep my options open.
- self.set_undefined_options('build',
- ('build_temp', 'build_clib'),
- ('build_temp', 'build_temp'),
- 'compiler', 'debug', 'force')
-
- self.libraries = self.distribution.libraries
- if self.libraries:
- self.check_library_list(self.libraries)
-
- if self.include_dirs is None:
- self.include_dirs = self.distribution.include_dirs or []
- if isinstance(self.include_dirs, str):
- self.include_dirs = self.include_dirs.split(os.pathsep)
-
- # XXX same as for build_ext -- what about 'self.define' and
- # 'self.undef' ?
-
- def run(self):
- if not self.libraries:
- return
-
- # Yech -- this is cut 'n pasted from build_ext.py!
- self.compiler = new_compiler(compiler=self.compiler,
- dry_run=self.dry_run,
- force=self.force)
- customize_compiler(self.compiler)
-
- if self.include_dirs is not None:
- self.compiler.set_include_dirs(self.include_dirs)
- if self.define is not None:
- # 'define' option is a list of (name,value) tuples
- for name, value in self.define:
- self.compiler.define_macro(name, value)
- if self.undef is not None:
- for macro in self.undef:
- self.compiler.undefine_macro(macro)
-
- self.build_libraries(self.libraries)
-
-
- def check_library_list(self, libraries):
- """Ensure that the list of libraries is valid.
-
- `library` is presumably provided as a command option 'libraries'.
- This method checks that it is a list of 2-tuples, where the tuples
- are (library_name, build_info_dict).
-
- Raise PackagingSetupError if the structure is invalid anywhere;
- just returns otherwise.
- """
- if not isinstance(libraries, list):
- raise PackagingSetupError("'libraries' option must be a list of tuples")
-
- for lib in libraries:
- if not isinstance(lib, tuple) and len(lib) != 2:
- raise PackagingSetupError("each element of 'libraries' must a 2-tuple")
-
- name, build_info = lib
-
- if not isinstance(name, str):
- raise PackagingSetupError("first element of each tuple in 'libraries' " + \
- "must be a string (the library name)")
- if '/' in name or (os.sep != '/' and os.sep in name):
- raise PackagingSetupError(("bad library name '%s': " +
- "may not contain directory separators") % \
- lib[0])
-
- if not isinstance(build_info, dict):
- raise PackagingSetupError("second element of each tuple in 'libraries' " + \
- "must be a dictionary (build info)")
-
- def get_library_names(self):
- # Assume the library list is valid -- 'check_library_list()' is
- # called from 'finalize_options()', so it should be!
- if not self.libraries:
- return None
-
- lib_names = []
- for lib_name, build_info in self.libraries:
- lib_names.append(lib_name)
- return lib_names
-
-
- def get_source_files(self):
- self.check_library_list(self.libraries)
- filenames = []
- for lib_name, build_info in self.libraries:
- sources = build_info.get('sources')
- if sources is None or not isinstance(sources, (list, tuple)):
- raise PackagingSetupError(("in 'libraries' option (library '%s'), "
- "'sources' must be present and must be "
- "a list of source filenames") % lib_name)
-
- filenames.extend(sources)
- return filenames
-
- def build_libraries(self, libraries):
- for lib_name, build_info in libraries:
- sources = build_info.get('sources')
- if sources is None or not isinstance(sources, (list, tuple)):
- raise PackagingSetupError(("in 'libraries' option (library '%s'), " +
- "'sources' must be present and must be " +
- "a list of source filenames") % lib_name)
- sources = list(sources)
-
- logger.info("building '%s' library", lib_name)
-
- # First, compile the source code to object files in the library
- # directory. (This should probably change to putting object
- # files in a temporary build directory.)
- macros = build_info.get('macros')
- include_dirs = build_info.get('include_dirs')
- objects = self.compiler.compile(sources,
- output_dir=self.build_temp,
- macros=macros,
- include_dirs=include_dirs,
- debug=self.debug)
-
- # Now "link" the object files together into a static library.
- # (On Unix at least, this isn't really linking -- it just
- # builds an archive. Whatever.)
- self.compiler.create_static_lib(objects, lib_name,
- output_dir=self.build_clib,
- debug=self.debug)
diff --git a/Lib/packaging/command/build_ext.py b/Lib/packaging/command/build_ext.py
deleted file mode 100644
index 7aa0b3a741..0000000000
--- a/Lib/packaging/command/build_ext.py
+++ /dev/null
@@ -1,644 +0,0 @@
-"""Build extension modules."""
-
-import os
-import re
-import sys
-import site
-import sysconfig
-
-from packaging.util import get_platform
-from packaging.command.cmd import Command
-from packaging.errors import (CCompilerError, CompileError, PackagingError,
- PackagingPlatformError, PackagingSetupError)
-from packaging.compiler import customize_compiler, show_compilers
-from packaging.util import newer_group
-from packaging.compiler.extension import Extension
-from packaging import logger
-
-if os.name == 'nt':
- from packaging.compiler.msvccompiler import get_build_version
- MSVC_VERSION = int(get_build_version())
-
-# An extension name is just a dot-separated list of Python NAMEs (ie.
-# the same as a fully-qualified module name).
-extension_name_re = re.compile \
- (r'^[a-zA-Z_][a-zA-Z_0-9]*(\.[a-zA-Z_][a-zA-Z_0-9]*)*$')
-
-
-class build_ext(Command):
-
- description = "build C/C++ extension modules (compile/link to build directory)"
-
- # XXX thoughts on how to deal with complex command-line options like
- # these, i.e. how to make it so fancy_getopt can suck them off the
- # command line and turn them into the appropriate
- # lists of tuples of what-have-you.
- # - each command needs a callback to process its command-line options
- # - Command.__init__() needs access to its share of the whole
- # command line (must ultimately come from
- # Distribution.parse_command_line())
- # - it then calls the current command class' option-parsing
- # callback to deal with weird options like -D, which have to
- # parse the option text and churn out some custom data
- # structure
- # - that data structure (in this case, a list of 2-tuples)
- # will then be present in the command object by the time
- # we get to finalize_options() (i.e. the constructor
- # takes care of both command-line and client options
- # in between initialize_options() and finalize_options())
-
- sep_by = " (separated by '%s')" % os.pathsep
- user_options = [
- ('build-lib=', 'b',
- "directory for compiled extension modules"),
- ('build-temp=', 't',
- "directory for temporary files (build by-products)"),
- ('plat-name=', 'p',
- "platform name to cross-compile for, if supported "
- "(default: %s)" % get_platform()),
- ('inplace', 'i',
- "ignore build-lib and put compiled extensions into the source " +
- "directory alongside your pure Python modules"),
- ('user', None,
- "add user include, library and rpath"),
- ('include-dirs=', 'I',
- "list of directories to search for header files" + sep_by),
- ('define=', 'D',
- "C preprocessor macros to define"),
- ('undef=', 'U',
- "C preprocessor macros to undefine"),
- ('libraries=', 'l',
- "external C libraries to link with"),
- ('library-dirs=', 'L',
- "directories to search for external C libraries" + sep_by),
- ('rpath=', 'R',
- "directories to search for shared C libraries at runtime"),
- ('link-objects=', 'O',
- "extra explicit link objects to include in the link"),
- ('debug', 'g',
- "compile/link with debugging information"),
- ('force', 'f',
- "forcibly build everything (ignore file timestamps)"),
- ('compiler=', 'c',
- "specify the compiler type"),
- ('swig-opts=', None,
- "list of SWIG command-line options"),
- ('swig=', None,
- "path to the SWIG executable"),
- ]
-
- boolean_options = ['inplace', 'debug', 'force', 'user']
-
-
- help_options = [
- ('help-compiler', None,
- "list available compilers", show_compilers),
- ]
-
- def initialize_options(self):
- self.extensions = None
- self.build_lib = None
- self.plat_name = None
- self.build_temp = None
- self.inplace = False
- self.package = None
-
- self.include_dirs = None
- self.define = None
- self.undef = None
- self.libraries = None
- self.library_dirs = None
- self.rpath = None
- self.link_objects = None
- self.debug = None
- self.force = None
- self.compiler = None
- self.swig = None
- self.swig_opts = None
- self.user = None
-
- def finalize_options(self):
- self.set_undefined_options('build',
- 'build_lib', 'build_temp', 'compiler',
- 'debug', 'force', 'plat_name')
-
- if self.package is None:
- self.package = self.distribution.ext_package
-
- # Ensure that the list of extensions is valid, i.e. it is a list of
- # Extension objects.
- self.extensions = self.distribution.ext_modules
- if self.extensions:
- if not isinstance(self.extensions, (list, tuple)):
- type_name = (self.extensions is None and 'None'
- or type(self.extensions).__name__)
- raise PackagingSetupError(
- "'ext_modules' must be a sequence of Extension instances,"
- " not %s" % (type_name,))
- for i, ext in enumerate(self.extensions):
- if isinstance(ext, Extension):
- continue # OK! (assume type-checking done
- # by Extension constructor)
- type_name = (ext is None and 'None' or type(ext).__name__)
- raise PackagingSetupError(
- "'ext_modules' item %d must be an Extension instance,"
- " not %s" % (i, type_name))
-
- # Make sure Python's include directories (for Python.h, pyconfig.h,
- # etc.) are in the include search path.
- py_include = sysconfig.get_path('include')
- plat_py_include = sysconfig.get_path('platinclude')
- if self.include_dirs is None:
- self.include_dirs = self.distribution.include_dirs or []
- if isinstance(self.include_dirs, str):
- self.include_dirs = self.include_dirs.split(os.pathsep)
-
- # Put the Python "system" include dir at the end, so that
- # any local include dirs take precedence.
- self.include_dirs.append(py_include)
- if plat_py_include != py_include:
- self.include_dirs.append(plat_py_include)
-
- self.ensure_string_list('libraries')
-
- # Life is easier if we're not forever checking for None, so
- # simplify these options to empty lists if unset
- if self.libraries is None:
- self.libraries = []
- if self.library_dirs is None:
- self.library_dirs = []
- elif isinstance(self.library_dirs, str):
- self.library_dirs = self.library_dirs.split(os.pathsep)
-
- if self.rpath is None:
- self.rpath = []
- elif isinstance(self.rpath, str):
- self.rpath = self.rpath.split(os.pathsep)
-
- # for extensions under windows use different directories
- # for Release and Debug builds.
- # also Python's library directory must be appended to library_dirs
- if os.name == 'nt':
- # the 'libs' directory is for binary installs - we assume that
- # must be the *native* platform. But we don't really support
- # cross-compiling via a binary install anyway, so we let it go.
- # Note that we must use sys.base_exec_prefix here rather than
- # exec_prefix, since the Python libs are not copied to a virtual
- # environment.
- self.library_dirs.append(os.path.join(sys.base_exec_prefix, 'libs'))
- if self.debug:
- self.build_temp = os.path.join(self.build_temp, "Debug")
- else:
- self.build_temp = os.path.join(self.build_temp, "Release")
-
- # Append the source distribution include and library directories,
- # this allows distutils on windows to work in the source tree
- self.include_dirs.append(os.path.join(sys.exec_prefix, 'PC'))
- if MSVC_VERSION >= 9:
- # Use the .lib files for the correct architecture
- if self.plat_name == 'win32':
- suffix = ''
- else:
- # win-amd64 or win-ia64
- suffix = self.plat_name[4:]
- new_lib = os.path.join(sys.exec_prefix, 'PCbuild')
- if suffix:
- new_lib = os.path.join(new_lib, suffix)
- self.library_dirs.append(new_lib)
-
- elif MSVC_VERSION == 8:
- self.library_dirs.append(os.path.join(sys.exec_prefix,
- 'PC', 'VS8.0'))
- elif MSVC_VERSION == 7:
- self.library_dirs.append(os.path.join(sys.exec_prefix,
- 'PC', 'VS7.1'))
- else:
- self.library_dirs.append(os.path.join(sys.exec_prefix,
- 'PC', 'VC6'))
-
- # OS/2 (EMX) doesn't support Debug vs Release builds, but has the
- # import libraries in its "Config" subdirectory
- if os.name == 'os2':
- self.library_dirs.append(os.path.join(sys.exec_prefix, 'Config'))
-
- # for extensions under Cygwin and AtheOS Python's library directory must be
- # appended to library_dirs
- if sys.platform[:6] == 'cygwin' or sys.platform[:6] == 'atheos':
- if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")):
- # building third party extensions
- self.library_dirs.append(os.path.join(sys.prefix, "lib",
- "python" + sysconfig.get_python_version(),
- "config"))
- else:
- # building python standard extensions
- self.library_dirs.append(os.curdir)
-
- # for extensions under Linux or Solaris with a shared Python library,
- # Python's library directory must be appended to library_dirs
- sysconfig.get_config_var('Py_ENABLE_SHARED')
- if (sys.platform.startswith(('linux', 'gnu', 'sunos'))
- and sysconfig.get_config_var('Py_ENABLE_SHARED')):
- if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")):
- # building third party extensions
- self.library_dirs.append(sysconfig.get_config_var('LIBDIR'))
- else:
- # building python standard extensions
- self.library_dirs.append(os.curdir)
-
- # The argument parsing will result in self.define being a string, but
- # it has to be a list of 2-tuples. All the preprocessor symbols
- # specified by the 'define' option will be set to '1'. Multiple
- # symbols can be separated with commas.
-
- if self.define:
- defines = self.define.split(',')
- self.define = [(symbol, '1') for symbol in defines]
-
- # The option for macros to undefine is also a string from the
- # option parsing, but has to be a list. Multiple symbols can also
- # be separated with commas here.
- if self.undef:
- self.undef = self.undef.split(',')
-
- if self.swig_opts is None:
- self.swig_opts = []
- else:
- self.swig_opts = self.swig_opts.split(' ')
-
- # Finally add the user include and library directories if requested
- if self.user:
- user_include = os.path.join(site.USER_BASE, "include")
- user_lib = os.path.join(site.USER_BASE, "lib")
- if os.path.isdir(user_include):
- self.include_dirs.append(user_include)
- if os.path.isdir(user_lib):
- self.library_dirs.append(user_lib)
- self.rpath.append(user_lib)
-
- def run(self):
- from packaging.compiler import new_compiler
-
- if not self.extensions:
- return
-
- # If we were asked to build any C/C++ libraries, make sure that the
- # directory where we put them is in the library search path for
- # linking extensions.
- if self.distribution.has_c_libraries():
- build_clib = self.get_finalized_command('build_clib')
- self.libraries.extend(build_clib.get_library_names() or [])
- self.library_dirs.append(build_clib.build_clib)
-
- # Setup the CCompiler object that we'll use to do all the
- # compiling and linking
- self.compiler_obj = new_compiler(compiler=self.compiler,
- dry_run=self.dry_run,
- force=self.force)
-
- customize_compiler(self.compiler_obj)
- # If we are cross-compiling, init the compiler now (if we are not
- # cross-compiling, init would not hurt, but people may rely on
- # late initialization of compiler even if they shouldn't...)
- if os.name == 'nt' and self.plat_name != get_platform():
- self.compiler_obj.initialize(self.plat_name)
-
- # And make sure that any compile/link-related options (which might
- # come from the command line or from the setup script) are set in
- # that CCompiler object -- that way, they automatically apply to
- # all compiling and linking done here.
- if self.include_dirs is not None:
- self.compiler_obj.set_include_dirs(self.include_dirs)
- if self.define is not None:
- # 'define' option is a list of (name,value) tuples
- for name, value in self.define:
- self.compiler_obj.define_macro(name, value)
- if self.undef is not None:
- for macro in self.undef:
- self.compiler_obj.undefine_macro(macro)
- if self.libraries is not None:
- self.compiler_obj.set_libraries(self.libraries)
- if self.library_dirs is not None:
- self.compiler_obj.set_library_dirs(self.library_dirs)
- if self.rpath is not None:
- self.compiler_obj.set_runtime_library_dirs(self.rpath)
- if self.link_objects is not None:
- self.compiler_obj.set_link_objects(self.link_objects)
-
- # Now actually compile and link everything.
- self.build_extensions()
-
- def get_source_files(self):
- filenames = []
-
- # Wouldn't it be neat if we knew the names of header files too...
- for ext in self.extensions:
- filenames.extend(ext.sources)
-
- return filenames
-
- def get_outputs(self):
- # And build the list of output (built) filenames. Note that this
- # ignores the 'inplace' flag, and assumes everything goes in the
- # "build" tree.
- outputs = []
- for ext in self.extensions:
- outputs.append(self.get_ext_fullpath(ext.name))
- return outputs
-
- def build_extensions(self):
- for ext in self.extensions:
- try:
- self.build_extension(ext)
- except (CCompilerError, PackagingError, CompileError) as e:
- if not ext.optional:
- raise
- logger.warning('%s: building extension %r failed: %s',
- self.get_command_name(), ext.name, e)
-
- def build_extension(self, ext):
- sources = ext.sources
- if sources is None or not isinstance(sources, (list, tuple)):
- raise PackagingSetupError(("in 'ext_modules' option (extension '%s'), " +
- "'sources' must be present and must be " +
- "a list of source filenames") % ext.name)
- sources = list(sources)
-
- ext_path = self.get_ext_fullpath(ext.name)
- depends = sources + ext.depends
- if not (self.force or newer_group(depends, ext_path, 'newer')):
- logger.debug("skipping '%s' extension (up-to-date)", ext.name)
- return
- else:
- logger.info("building '%s' extension", ext.name)
-
- # First, scan the sources for SWIG definition files (.i), run
- # SWIG on 'em to create .c files, and modify the sources list
- # accordingly.
- sources = self.swig_sources(sources, ext)
-
- # Next, compile the source code to object files.
-
- # XXX not honouring 'define_macros' or 'undef_macros' -- the
- # CCompiler API needs to change to accommodate this, and I
- # want to do one thing at a time!
-
- # Two possible sources for extra compiler arguments:
- # - 'extra_compile_args' in Extension object
- # - CFLAGS environment variable (not particularly
- # elegant, but people seem to expect it and I
- # guess it's useful)
- # The environment variable should take precedence, and
- # any sensible compiler will give precedence to later
- # command-line args. Hence we combine them in order:
- extra_args = ext.extra_compile_args or []
-
- macros = ext.define_macros[:]
- for undef in ext.undef_macros:
- macros.append((undef,))
-
- objects = self.compiler_obj.compile(sources,
- output_dir=self.build_temp,
- macros=macros,
- include_dirs=ext.include_dirs,
- debug=self.debug,
- extra_postargs=extra_args,
- depends=ext.depends)
-
- # XXX -- this is a Vile HACK!
- #
- # The setup.py script for Python on Unix needs to be able to
- # get this list so it can perform all the clean up needed to
- # avoid keeping object files around when cleaning out a failed
- # build of an extension module. Since Packaging does not
- # track dependencies, we have to get rid of intermediates to
- # ensure all the intermediates will be properly re-built.
- #
- self._built_objects = objects[:]
-
- # Now link the object files together into a "shared object" --
- # of course, first we have to figure out all the other things
- # that go into the mix.
- if ext.extra_objects:
- objects.extend(ext.extra_objects)
- extra_args = ext.extra_link_args or []
-
- # Detect target language, if not provided
- language = ext.language or self.compiler_obj.detect_language(sources)
-
- self.compiler_obj.link_shared_object(
- objects, ext_path,
- libraries=self.get_libraries(ext),
- library_dirs=ext.library_dirs,
- runtime_library_dirs=ext.runtime_library_dirs,
- extra_postargs=extra_args,
- export_symbols=self.get_export_symbols(ext),
- debug=self.debug,
- build_temp=self.build_temp,
- target_lang=language)
-
-
- def swig_sources(self, sources, extension):
- """Walk the list of source files in 'sources', looking for SWIG
- interface (.i) files. Run SWIG on all that are found, and
- return a modified 'sources' list with SWIG source files replaced
- by the generated C (or C++) files.
- """
- new_sources = []
- swig_sources = []
- swig_targets = {}
-
- # XXX this drops generated C/C++ files into the source tree, which
- # is fine for developers who want to distribute the generated
- # source -- but there should be an option to put SWIG output in
- # the temp dir.
-
- if ('-c++' in self.swig_opts or '-c++' in extension.swig_opts):
- target_ext = '.cpp'
- else:
- target_ext = '.c'
-
- for source in sources:
- base, ext = os.path.splitext(source)
- if ext == ".i": # SWIG interface file
- new_sources.append(base + '_wrap' + target_ext)
- swig_sources.append(source)
- swig_targets[source] = new_sources[-1]
- else:
- new_sources.append(source)
-
- if not swig_sources:
- return new_sources
-
- swig = self.swig or self.find_swig()
- swig_cmd = [swig, "-python"]
- swig_cmd.extend(self.swig_opts)
-
- # Do not override commandline arguments
- if not self.swig_opts:
- for o in extension.swig_opts:
- swig_cmd.append(o)
-
- for source in swig_sources:
- target = swig_targets[source]
- logger.info("swigging %s to %s", source, target)
- self.spawn(swig_cmd + ["-o", target, source])
-
- return new_sources
-
- def find_swig(self):
- """Return the name of the SWIG executable. On Unix, this is
- just "swig" -- it should be in the PATH. Tries a bit harder on
- Windows.
- """
-
- if os.name == "posix":
- return "swig"
- elif os.name == "nt":
-
- # Look for SWIG in its standard installation directory on
- # Windows (or so I presume!). If we find it there, great;
- # if not, act like Unix and assume it's in the PATH.
- for vers in ("1.3", "1.2", "1.1"):
- fn = os.path.join("c:\\swig%s" % vers, "swig.exe")
- if os.path.isfile(fn):
- return fn
- else:
- return "swig.exe"
-
- elif os.name == "os2":
- # assume swig available in the PATH.
- return "swig.exe"
-
- else:
- raise PackagingPlatformError(("I don't know how to find (much less run) SWIG "
- "on platform '%s'") % os.name)
-
- # -- Name generators -----------------------------------------------
- # (extension names, filenames, whatever)
- def get_ext_fullpath(self, ext_name):
- """Returns the path of the filename for a given extension.
-
- The file is located in `build_lib` or directly in the package
- (inplace option).
- """
- fullname = self.get_ext_fullname(ext_name)
- modpath = fullname.split('.')
- filename = self.get_ext_filename(modpath[-1])
-
- if not self.inplace:
- # no further work needed
- # returning :
- # build_dir/package/path/filename
- filename = os.path.join(*modpath[:-1]+[filename])
- return os.path.join(self.build_lib, filename)
-
- # the inplace option requires to find the package directory
- # using the build_py command for that
- package = '.'.join(modpath[0:-1])
- build_py = self.get_finalized_command('build_py')
- package_dir = os.path.abspath(build_py.get_package_dir(package))
-
- # returning
- # package_dir/filename
- return os.path.join(package_dir, filename)
-
- def get_ext_fullname(self, ext_name):
- """Returns the fullname of a given extension name.
-
- Adds the `package.` prefix"""
- if self.package is None:
- return ext_name
- else:
- return self.package + '.' + ext_name
-
- def get_ext_filename(self, ext_name):
- r"""Convert the name of an extension (eg. "foo.bar") into the name
- of the file from which it will be loaded (eg. "foo/bar.so", or
- "foo\bar.pyd").
- """
- ext_path = ext_name.split('.')
- # OS/2 has an 8 character module (extension) limit :-(
- if os.name == "os2":
- ext_path[len(ext_path) - 1] = ext_path[len(ext_path) - 1][:8]
- # extensions in debug_mode are named 'module_d.pyd' under windows
- so_ext = sysconfig.get_config_var('SO')
- if os.name == 'nt' and self.debug:
- return os.path.join(*ext_path) + '_d' + so_ext
- return os.path.join(*ext_path) + so_ext
-
- def get_export_symbols(self, ext):
- """Return the list of symbols that a shared extension has to
- export. This either uses 'ext.export_symbols' or, if it's not
- provided, "init" + module_name. Only relevant on Windows, where
- the .pyd file (DLL) must export the module "init" function.
- """
- initfunc_name = "PyInit_" + ext.name.split('.')[-1]
- if initfunc_name not in ext.export_symbols:
- ext.export_symbols.append(initfunc_name)
- return ext.export_symbols
-
- def get_libraries(self, ext):
- """Return the list of libraries to link against when building a
- shared extension. On most platforms, this is just 'ext.libraries';
- on Windows and OS/2, we add the Python library (eg. python20.dll).
- """
- # The python library is always needed on Windows. For MSVC, this
- # is redundant, since the library is mentioned in a pragma in
- # pyconfig.h that MSVC groks. The other Windows compilers all seem
- # to need it mentioned explicitly, though, so that's what we do.
- # Append '_d' to the python import library on debug builds.
- if sys.platform == "win32":
- from packaging.compiler.msvccompiler import MSVCCompiler
- if not isinstance(self.compiler_obj, MSVCCompiler):
- template = "python%d%d"
- if self.debug:
- template = template + '_d'
- pythonlib = template % sys.version_info[:2]
- # don't extend ext.libraries, it may be shared with other
- # extensions, it is a reference to the original list
- return ext.libraries + [pythonlib]
- else:
- return ext.libraries
- elif sys.platform == "os2emx":
- # EMX/GCC requires the python library explicitly, and I
- # believe VACPP does as well (though not confirmed) - AIM Apr01
- template = "python%d%d"
- # debug versions of the main DLL aren't supported, at least
- # not at this time - AIM Apr01
- #if self.debug:
- # template = template + '_d'
- pythonlib = template % sys.version_info[:2]
- # don't extend ext.libraries, it may be shared with other
- # extensions, it is a reference to the original list
- return ext.libraries + [pythonlib]
- elif sys.platform[:6] == "cygwin":
- template = "python%d.%d"
- pythonlib = template % sys.version_info[:2]
- # don't extend ext.libraries, it may be shared with other
- # extensions, it is a reference to the original list
- return ext.libraries + [pythonlib]
- elif sys.platform[:6] == "atheos":
- template = "python%d.%d"
- pythonlib = template % sys.version_info[:2]
- # Get SHLIBS from Makefile
- extra = []
- for lib in sysconfig.get_config_var('SHLIBS').split():
- if lib.startswith('-l'):
- extra.append(lib[2:])
- else:
- extra.append(lib)
- # don't extend ext.libraries, it may be shared with other
- # extensions, it is a reference to the original list
- return ext.libraries + [pythonlib, "m"] + extra
-
- elif sys.platform == 'darwin':
- # Don't use the default code below
- return ext.libraries
-
- else:
- if sysconfig.get_config_var('Py_ENABLE_SHARED'):
- template = 'python%d.%d' + sys.abiflags
- pythonlib = template % sys.version_info[:2]
- return ext.libraries + [pythonlib]
- else:
- return ext.libraries
diff --git a/Lib/packaging/command/build_py.py b/Lib/packaging/command/build_py.py
deleted file mode 100644
index 00621400da..0000000000
--- a/Lib/packaging/command/build_py.py
+++ /dev/null
@@ -1,392 +0,0 @@
-"""Build pure Python modules (just copy to build directory)."""
-
-import os
-import imp
-from glob import glob
-
-from packaging import logger
-from packaging.command.cmd import Command
-from packaging.errors import PackagingOptionError, PackagingFileError
-from packaging.util import convert_path
-from packaging.compat import Mixin2to3
-
-# marking public APIs
-__all__ = ['build_py']
-
-
-class build_py(Command, Mixin2to3):
-
- description = "build pure Python modules (copy to build directory)"
-
- # The options for controlling byte compilation are two independent sets;
- # more info in install_lib or the reST docs
-
- user_options = [
- ('build-lib=', 'd', "directory to build (copy) to"),
- ('compile', 'c', "compile .py to .pyc"),
- ('no-compile', None, "don't compile .py files [default]"),
- ('optimize=', 'O',
- "also compile with optimization: -O1 for \"python -O\", "
- "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"),
- ('force', 'f', "forcibly build everything (ignore file timestamps)"),
- ('use-2to3', None,
- "use 2to3 to make source python 3.x compatible"),
- ('convert-2to3-doctests', None,
- "use 2to3 to convert doctests in separate text files"),
- ('use-2to3-fixers', None,
- "list additional fixers opted for during 2to3 conversion"),
- ]
-
- boolean_options = ['compile', 'force']
-
- negative_opt = {'no-compile': 'compile'}
-
- def initialize_options(self):
- self.build_lib = None
- self.py_modules = None
- self.package = None
- self.package_data = None
- self.package_dir = None
- self.compile = False
- self.optimize = 0
- self.force = None
- self._updated_files = []
- self._doctests_2to3 = []
- self.use_2to3 = False
- self.convert_2to3_doctests = None
- self.use_2to3_fixers = None
-
- def finalize_options(self):
- self.set_undefined_options('build',
- 'use_2to3', 'use_2to3_fixers',
- 'convert_2to3_doctests', 'build_lib',
- 'force')
-
- # Get the distribution options that are aliases for build_py
- # options -- list of packages and list of modules.
- self.packages = self.distribution.packages
- self.py_modules = self.distribution.py_modules
- self.package_data = self.distribution.package_data
- self.package_dir = None
- if self.distribution.package_dir is not None:
- self.package_dir = convert_path(self.distribution.package_dir)
- self.data_files = self.get_data_files()
-
- # Ick, copied straight from install_lib.py (fancy_getopt needs a
- # type system! Hell, *everything* needs a type system!!!)
- if not isinstance(self.optimize, int):
- try:
- self.optimize = int(self.optimize)
- assert 0 <= self.optimize <= 2
- except (ValueError, AssertionError):
- raise PackagingOptionError("optimize must be 0, 1, or 2")
-
- def run(self):
- # XXX copy_file by default preserves atime and mtime. IMHO this is
- # the right thing to do, but perhaps it should be an option -- in
- # particular, a site administrator might want installed files to
- # reflect the time of installation rather than the last
- # modification time before the installed release.
-
- # XXX copy_file by default preserves mode, which appears to be the
- # wrong thing to do: if a file is read-only in the working
- # directory, we want it to be installed read/write so that the next
- # installation of the same module distribution can overwrite it
- # without problems. (This might be a Unix-specific issue.) Thus
- # we turn off 'preserve_mode' when copying to the build directory,
- # since the build directory is supposed to be exactly what the
- # installation will look like (ie. we preserve mode when
- # installing).
-
- # Two options control which modules will be installed: 'packages'
- # and 'py_modules'. The former lets us work with whole packages, not
- # specifying individual modules at all; the latter is for
- # specifying modules one-at-a-time.
-
- if self.py_modules:
- self.build_modules()
- if self.packages:
- self.build_packages()
- self.build_package_data()
-
- if self.use_2to3 and self._updated_files:
- self.run_2to3(self._updated_files, self._doctests_2to3,
- self.use_2to3_fixers)
-
- self.byte_compile(self.get_outputs(include_bytecode=False),
- prefix=self.build_lib)
-
- # -- Top-level worker functions ------------------------------------
-
- def get_data_files(self):
- """Generate list of '(package,src_dir,build_dir,filenames)' tuples.
-
- Helper function for finalize_options.
- """
- data = []
- if not self.packages:
- return data
- for package in self.packages:
- # Locate package source directory
- src_dir = self.get_package_dir(package)
-
- # Compute package build directory
- build_dir = os.path.join(*([self.build_lib] + package.split('.')))
-
- # Length of path to strip from found files
- plen = 0
- if src_dir:
- plen = len(src_dir) + 1
-
- # Strip directory from globbed filenames
- filenames = [
- file[plen:] for file in self.find_data_files(package, src_dir)
- ]
- data.append((package, src_dir, build_dir, filenames))
- return data
-
- def find_data_files(self, package, src_dir):
- """Return filenames for package's data files in 'src_dir'.
-
- Helper function for get_data_files.
- """
- globs = (self.package_data.get('', [])
- + self.package_data.get(package, []))
- files = []
- for pattern in globs:
- # Each pattern has to be converted to a platform-specific path
- filelist = glob(os.path.join(src_dir, convert_path(pattern)))
- # Files that match more than one pattern are only added once
- files.extend(fn for fn in filelist if fn not in files)
- return files
-
- def build_package_data(self):
- """Copy data files into build directory.
-
- Helper function for run.
- """
- # FIXME add tests for this method
- for package, src_dir, build_dir, filenames in self.data_files:
- for filename in filenames:
- target = os.path.join(build_dir, filename)
- srcfile = os.path.join(src_dir, filename)
- self.mkpath(os.path.dirname(target))
- outf, copied = self.copy_file(srcfile,
- target, preserve_mode=False)
- doctests = self.distribution.convert_2to3_doctests
- if copied and srcfile in doctests:
- self._doctests_2to3.append(outf)
-
- # XXX - this should be moved to the Distribution class as it is not
- # only needed for build_py. It also has no dependencies on this class.
- def get_package_dir(self, package):
- """Return the directory, relative to the top of the source
- distribution, where package 'package' should be found
- (at least according to the 'package_dir' option, if any).
- """
- path = package.split('.')
- if self.package_dir is not None:
- path.insert(0, self.package_dir)
-
- if len(path) > 0:
- return os.path.join(*path)
-
- return ''
-
- def check_package(self, package, package_dir):
- """Helper function for find_package_modules and find_modules."""
- # Empty dir name means current directory, which we can probably
- # assume exists. Also, os.path.exists and isdir don't know about
- # my "empty string means current dir" convention, so we have to
- # circumvent them.
- if package_dir != "":
- if not os.path.exists(package_dir):
- raise PackagingFileError(
- "package directory '%s' does not exist" % package_dir)
- if not os.path.isdir(package_dir):
- raise PackagingFileError(
- "supposed package directory '%s' exists, "
- "but is not a directory" % package_dir)
-
- # Require __init__.py for all but the "root package"
- if package:
- init_py = os.path.join(package_dir, "__init__.py")
- if os.path.isfile(init_py):
- return init_py
- else:
- logger.warning("package init file %r not found "
- "(or not a regular file)", init_py)
-
- # Either not in a package at all (__init__.py not expected), or
- # __init__.py doesn't exist -- so don't return the filename.
- return None
-
- def check_module(self, module, module_file):
- if not os.path.isfile(module_file):
- logger.warning("file %r (for module %r) not found",
- module_file, module)
- return False
- else:
- return True
-
- def find_package_modules(self, package, package_dir):
- self.check_package(package, package_dir)
- module_files = glob(os.path.join(package_dir, "*.py"))
- modules = []
- if self.distribution.script_name is not None:
- setup_script = os.path.abspath(self.distribution.script_name)
- else:
- setup_script = None
-
- for f in module_files:
- abs_f = os.path.abspath(f)
- if abs_f != setup_script:
- module = os.path.splitext(os.path.basename(f))[0]
- modules.append((package, module, f))
- else:
- logger.debug("excluding %r", setup_script)
- return modules
-
- def find_modules(self):
- """Finds individually-specified Python modules, ie. those listed by
- module name in 'self.py_modules'. Returns a list of tuples (package,
- module_base, filename): 'package' is a tuple of the path through
- package-space to the module; 'module_base' is the bare (no
- packages, no dots) module name, and 'filename' is the path to the
- ".py" file (relative to the distribution root) that implements the
- module.
- """
- # Map package names to tuples of useful info about the package:
- # (package_dir, checked)
- # package_dir - the directory where we'll find source files for
- # this package
- # checked - true if we have checked that the package directory
- # is valid (exists, contains __init__.py, ... ?)
- packages = {}
-
- # List of (package, module, filename) tuples to return
- modules = []
-
- # We treat modules-in-packages almost the same as toplevel modules,
- # just the "package" for a toplevel is empty (either an empty
- # string or empty list, depending on context). Differences:
- # - don't check for __init__.py in directory for empty package
- for module in self.py_modules:
- path = module.split('.')
- package = '.'.join(path[0:-1])
- module_base = path[-1]
-
- try:
- package_dir, checked = packages[package]
- except KeyError:
- package_dir = self.get_package_dir(package)
- checked = False
-
- if not checked:
- init_py = self.check_package(package, package_dir)
- packages[package] = (package_dir, 1)
- if init_py:
- modules.append((package, "__init__", init_py))
-
- # XXX perhaps we should also check for just .pyc files
- # (so greedy closed-source bastards can distribute Python
- # modules too)
- module_file = os.path.join(package_dir, module_base + ".py")
- if not self.check_module(module, module_file):
- continue
-
- modules.append((package, module_base, module_file))
-
- return modules
-
- def find_all_modules(self):
- """Compute the list of all modules that will be built, whether
- they are specified one-module-at-a-time ('self.py_modules') or
- by whole packages ('self.packages'). Return a list of tuples
- (package, module, module_file), just like 'find_modules()' and
- 'find_package_modules()' do."""
- modules = []
- if self.py_modules:
- modules.extend(self.find_modules())
- if self.packages:
- for package in self.packages:
- package_dir = self.get_package_dir(package)
- m = self.find_package_modules(package, package_dir)
- modules.extend(m)
- return modules
-
- def get_source_files(self):
- sources = [module[-1] for module in self.find_all_modules()]
- sources += [
- os.path.join(src_dir, filename)
- for package, src_dir, build_dir, filenames in self.data_files
- for filename in filenames]
- return sources
-
- def get_module_outfile(self, build_dir, package, module):
- outfile_path = [build_dir] + list(package) + [module + ".py"]
- return os.path.join(*outfile_path)
-
- def get_outputs(self, include_bytecode=True):
- modules = self.find_all_modules()
- outputs = []
- for package, module, module_file in modules:
- package = package.split('.')
- filename = self.get_module_outfile(self.build_lib, package, module)
- outputs.append(filename)
- if include_bytecode:
- if self.compile:
- outputs.append(imp.cache_from_source(filename, True))
- if self.optimize:
- outputs.append(imp.cache_from_source(filename, False))
-
- outputs += [
- os.path.join(build_dir, filename)
- for package, src_dir, build_dir, filenames in self.data_files
- for filename in filenames]
-
- return outputs
-
- def build_module(self, module, module_file, package):
- if isinstance(package, str):
- package = package.split('.')
- elif not isinstance(package, (list, tuple)):
- raise TypeError(
- "'package' must be a string (dot-separated), list, or tuple")
-
- # Now put the module source file into the "build" area -- this is
- # easy, we just copy it somewhere under self.build_lib (the build
- # directory for Python source).
- outfile = self.get_module_outfile(self.build_lib, package, module)
- dir = os.path.dirname(outfile)
- self.mkpath(dir)
- return self.copy_file(module_file, outfile, preserve_mode=False)
-
- def build_modules(self):
- modules = self.find_modules()
- for package, module, module_file in modules:
- # Now "build" the module -- ie. copy the source file to
- # self.build_lib (the build directory for Python source).
- # (Actually, it gets copied to the directory for this package
- # under self.build_lib.)
- self.build_module(module, module_file, package)
-
- def build_packages(self):
- for package in self.packages:
- # Get list of (package, module, module_file) tuples based on
- # scanning the package directory. 'package' is only included
- # in the tuple so that 'find_modules()' and
- # 'find_package_tuples()' have a consistent interface; it's
- # ignored here (apart from a sanity check). Also, 'module' is
- # the *unqualified* module name (ie. no dots, no package -- we
- # already know its package!), and 'module_file' is the path to
- # the .py file, relative to the current directory
- # (ie. including 'package_dir').
- package_dir = self.get_package_dir(package)
- modules = self.find_package_modules(package, package_dir)
-
- # Now loop over the modules we found, "building" each one (just
- # copy it to self.build_lib).
- for package_, module, module_file in modules:
- assert package == package_
- self.build_module(module, module_file, package)
diff --git a/Lib/packaging/command/build_scripts.py b/Lib/packaging/command/build_scripts.py
deleted file mode 100644
index d651ae01c6..0000000000
--- a/Lib/packaging/command/build_scripts.py
+++ /dev/null
@@ -1,154 +0,0 @@
-"""Build scripts (copy to build dir and fix up shebang line)."""
-
-import os
-import re
-import sysconfig
-from tokenize import detect_encoding
-
-from packaging.command.cmd import Command
-from packaging.util import convert_path, newer
-from packaging import logger
-from packaging.compat import Mixin2to3
-
-
-# check if Python is called on the first line with this expression
-first_line_re = re.compile(b'^#!.*python[0-9.]*([ \t].*)?$')
-
-class build_scripts(Command, Mixin2to3):
-
- description = "build scripts (copy and fix up shebang line)"
-
- user_options = [
- ('build-dir=', 'd', "directory to build (copy) to"),
- ('force', 'f', "forcibly build everything (ignore file timestamps"),
- ('executable=', 'e', "specify final destination interpreter path"),
- ]
-
- boolean_options = ['force']
-
-
- def initialize_options(self):
- self.build_dir = None
- self.scripts = None
- self.force = None
- self.executable = None
- self.outfiles = None
- self.use_2to3 = False
- self.convert_2to3_doctests = None
- self.use_2to3_fixers = None
-
- def finalize_options(self):
- self.set_undefined_options('build',
- ('build_scripts', 'build_dir'),
- 'use_2to3', 'use_2to3_fixers',
- 'convert_2to3_doctests', 'force',
- 'executable')
- self.scripts = self.distribution.scripts
-
- def get_source_files(self):
- return self.scripts
-
- def run(self):
- if not self.scripts:
- return
- copied_files = self.copy_scripts()
- if self.use_2to3 and copied_files:
- self._run_2to3(copied_files, fixers=self.use_2to3_fixers)
-
- def copy_scripts(self):
- """Copy each script listed in 'self.scripts'; if it's marked as a
- Python script in the Unix way (first line matches 'first_line_re',
- ie. starts with "\#!" and contains "python"), then adjust the first
- line to refer to the current Python interpreter as we copy.
- """
- self.mkpath(self.build_dir)
- outfiles = []
- for script in self.scripts:
- adjust = False
- script = convert_path(script)
- outfile = os.path.join(self.build_dir, os.path.basename(script))
- outfiles.append(outfile)
-
- if not self.force and not newer(script, outfile):
- logger.debug("not copying %s (up-to-date)", script)
- continue
-
- # Always open the file, but ignore failures in dry-run mode --
- # that way, we'll get accurate feedback if we can read the
- # script.
- try:
- f = open(script, "rb")
- except IOError:
- if not self.dry_run:
- raise
- f = None
- else:
- encoding, lines = detect_encoding(f.readline)
- f.seek(0)
- first_line = f.readline()
- if not first_line:
- logger.warning('%s: %s is an empty file (skipping)',
- self.get_command_name(), script)
- continue
-
- match = first_line_re.match(first_line)
- if match:
- adjust = True
- post_interp = match.group(1) or b''
-
- if adjust:
- logger.info("copying and adjusting %s -> %s", script,
- self.build_dir)
- if not self.dry_run:
- if not sysconfig.is_python_build():
- executable = self.executable
- else:
- executable = os.path.join(
- sysconfig.get_config_var("BINDIR"),
- "python%s%s" % (sysconfig.get_config_var("VERSION"),
- sysconfig.get_config_var("EXE")))
- executable = os.fsencode(executable)
- shebang = b"#!" + executable + post_interp + b"\n"
- # Python parser starts to read a script using UTF-8 until
- # it gets a #coding:xxx cookie. The shebang has to be the
- # first line of a file, the #coding:xxx cookie cannot be
- # written before. So the shebang has to be decodable from
- # UTF-8.
- try:
- shebang.decode('utf-8')
- except UnicodeDecodeError:
- raise ValueError(
- "The shebang ({!r}) is not decodable "
- "from utf-8".format(shebang))
- # If the script is encoded to a custom encoding (use a
- # #coding:xxx cookie), the shebang has to be decodable from
- # the script encoding too.
- try:
- shebang.decode(encoding)
- except UnicodeDecodeError:
- raise ValueError(
- "The shebang ({!r}) is not decodable "
- "from the script encoding ({})"
- .format(shebang, encoding))
- with open(outfile, "wb") as outf:
- outf.write(shebang)
- outf.writelines(f.readlines())
- if f:
- f.close()
- else:
- if f:
- f.close()
- self.copy_file(script, outfile)
-
- if os.name == 'posix':
- for file in outfiles:
- if self.dry_run:
- logger.info("changing mode of %s", file)
- else:
- oldmode = os.stat(file).st_mode & 0o7777
- newmode = (oldmode | 0o555) & 0o7777
- if newmode != oldmode:
- logger.info("changing mode of %s from %o to %o",
- file, oldmode, newmode)
- os.chmod(file, newmode)
- return outfiles
diff --git a/Lib/packaging/command/check.py b/Lib/packaging/command/check.py
deleted file mode 100644
index 6715db90b3..0000000000
--- a/Lib/packaging/command/check.py
+++ /dev/null
@@ -1,88 +0,0 @@
-"""Check PEP compliance of metadata."""
-
-from packaging import logger
-from packaging.command.cmd import Command
-from packaging.errors import PackagingSetupError
-from packaging.util import resolve_name
-
-class check(Command):
-
- description = "check PEP compliance of metadata"
-
- user_options = [('metadata', 'm', 'Verify metadata'),
- ('all', 'a',
- ('runs extended set of checks')),
- ('strict', 's',
- 'Will exit with an error if a check fails')]
-
- boolean_options = ['metadata', 'all', 'strict']
-
- def initialize_options(self):
- """Sets default values for options."""
- self.all = False
- self.metadata = True
- self.strict = False
- self._warnings = []
-
- def finalize_options(self):
- pass
-
- def warn(self, msg, *args):
- """Wrapper around logging that also remembers messages."""
- # XXX we could use a special handler for this, but would need to test
- # if it works even if the logger has a too high level
- self._warnings.append((msg, args))
- return logger.warning('%s: %s' % (self.get_command_name(), msg), *args)
-
- def run(self):
- """Runs the command."""
- # perform the various tests
- if self.metadata:
- self.check_metadata()
- if self.all:
- self.check_restructuredtext()
- self.check_hooks_resolvable()
-
- # let's raise an error in strict mode, if we have at least
- # one warning
- if self.strict and len(self._warnings) > 0:
- msg = '\n'.join(msg % args for msg, args in self._warnings)
- raise PackagingSetupError(msg)
-
- def check_metadata(self):
- """Ensures that all required elements of metadata are supplied.
-
- name, version, URL, author
-
- Warns if any are missing.
- """
- missing, warnings = self.distribution.metadata.check(strict=True)
- if missing != []:
- self.warn('missing required metadata: %s', ', '.join(missing))
- for warning in warnings:
- self.warn(warning)
-
- def check_restructuredtext(self):
- """Checks if the long string fields are reST-compliant."""
- missing, warnings = self.distribution.metadata.check(restructuredtext=True)
- if self.distribution.metadata.docutils_support:
- for warning in warnings:
- line = warning[-1].get('line')
- if line is None:
- warning = warning[1]
- else:
- warning = '%s (line %s)' % (warning[1], line)
- self.warn(warning)
- elif self.strict:
- raise PackagingSetupError('The docutils package is needed.')
-
- def check_hooks_resolvable(self):
- for options in self.distribution.command_options.values():
- for hook_kind in ("pre_hook", "post_hook"):
- if hook_kind not in options:
- break
- for hook_name in options[hook_kind][1].values():
- try:
- resolve_name(hook_name)
- except ImportError:
- self.warn('name %r cannot be resolved', hook_name)
diff --git a/Lib/packaging/command/clean.py b/Lib/packaging/command/clean.py
deleted file mode 100644
index 4f60f4ea93..0000000000
--- a/Lib/packaging/command/clean.py
+++ /dev/null
@@ -1,76 +0,0 @@
-"""Clean up temporary files created by the build command."""
-
-# Contributed by Bastian Kleineidam
-
-import os
-from shutil import rmtree
-from packaging.command.cmd import Command
-from packaging import logger
-
-class clean(Command):
-
- description = "clean up temporary files from 'build' command"
- user_options = [
- ('build-base=', 'b',
- "base build directory (default: 'build.build-base')"),
- ('build-lib=', None,
- "build directory for all modules (default: 'build.build-lib')"),
- ('build-temp=', 't',
- "temporary build directory (default: 'build.build-temp')"),
- ('build-scripts=', None,
- "build directory for scripts (default: 'build.build-scripts')"),
- ('bdist-base=', None,
- "temporary directory for built distributions"),
- ('all', 'a',
- "remove all build output, not just temporary by-products")
- ]
-
- boolean_options = ['all']
-
- def initialize_options(self):
- self.build_base = None
- self.build_lib = None
- self.build_temp = None
- self.build_scripts = None
- self.bdist_base = None
- self.all = None
-
- def finalize_options(self):
- self.set_undefined_options('build', 'build_base', 'build_lib',
- 'build_scripts', 'build_temp')
- self.set_undefined_options('bdist', 'bdist_base')
-
- def run(self):
- # remove the build/temp. directory (unless it's already
- # gone)
- if os.path.exists(self.build_temp):
- if self.dry_run:
- logger.info('removing %s', self.build_temp)
- else:
- rmtree(self.build_temp)
- else:
- logger.debug("'%s' does not exist -- can't clean it",
- self.build_temp)
-
- if self.all:
- # remove build directories
- for directory in (self.build_lib,
- self.bdist_base,
- self.build_scripts):
- if os.path.exists(directory):
- if self.dry_run:
- logger.info('removing %s', directory)
- else:
- rmtree(directory)
- else:
- logger.warning("'%s' does not exist -- can't clean it",
- directory)
-
- # just for the heck of it, try to remove the base build directory:
- # we might have emptied it right now, but if not we don't care
- if not self.dry_run:
- try:
- os.rmdir(self.build_base)
- logger.info("removing '%s'", self.build_base)
- except OSError:
- pass
diff --git a/Lib/packaging/command/cmd.py b/Lib/packaging/command/cmd.py
deleted file mode 100644
index 25e6a72f2c..0000000000
--- a/Lib/packaging/command/cmd.py
+++ /dev/null
@@ -1,461 +0,0 @@
-"""Base class for commands."""
-
-import os
-import re
-from shutil import copyfile, move, make_archive
-from packaging import util
-from packaging import logger
-from packaging.errors import PackagingOptionError
-
-
-class Command:
- """Abstract base class for defining command classes, the "worker bees"
- of Packaging. A useful analogy for command classes is to think of
- them as subroutines with local variables called "options". The options
- are "declared" in 'initialize_options()' and "defined" (given their
- final values, aka "finalized") in 'finalize_options()', both of which
- must be defined by every command class. The distinction between the
- two is necessary because option values might come from the outside
- world (command line, config file, ...), and any options dependent on
- other options must be computed *after* these outside influences have
- been processed -- hence 'finalize_options()'. The "body" of the
- subroutine, where it does all its work based on the values of its
- options, is the 'run()' method, which must also be implemented by every
- command class.
- """
-
- # 'sub_commands' formalizes the notion of a "family" of commands,
- # eg. "install_dist" as the parent with sub-commands "install_lib",
- # "install_headers", etc. The parent of a family of commands
- # defines 'sub_commands' as a class attribute; it's a list of
- # (command_name : string, predicate : unbound_method | string | None)
- # tuples, where 'predicate' is a method of the parent command that
- # determines whether the corresponding command is applicable in the
- # current situation. (Eg. we "install_headers" is only applicable if
- # we have any C header files to install.) If 'predicate' is None,
- # that command is always applicable.
- #
- # 'sub_commands' is usually defined at the *end* of a class, because
- # predicates can be unbound methods, so they must already have been
- # defined. The canonical example is the "install_dist" command.
- sub_commands = []
-
- # Pre and post command hooks are run just before or just after the command
- # itself. They are simple functions that receive the command instance. They
- # are specified as callable objects or dotted strings (for lazy loading).
- pre_hook = None
- post_hook = None
-
- # -- Creation/initialization methods -------------------------------
-
- def __init__(self, dist):
- """Create and initialize a new Command object. Most importantly,
- invokes the 'initialize_options()' method, which is the real
- initializer and depends on the actual command being instantiated.
- """
- # late import because of mutual dependence between these classes
- from packaging.dist import Distribution
-
- if not isinstance(dist, Distribution):
- raise TypeError("dist must be an instance of Distribution, not %r"
- % type(dist))
- if self.__class__ is Command:
- raise RuntimeError("Command is an abstract class")
-
- self.distribution = dist
- self.initialize_options()
-
- # Per-command versions of the global flags, so that the user can
- # customize Packaging' behaviour command-by-command and let some
- # commands fall back on the Distribution's behaviour. None means
- # "not defined, check self.distribution's copy", while 0 or 1 mean
- # false and true (duh). Note that this means figuring out the real
- # value of each flag is a touch complicated -- hence "self._dry_run"
- # will be handled by a property, below.
- # XXX This needs to be fixed. [I changed it to a property--does that
- # "fix" it?]
- self._dry_run = None
-
- # Some commands define a 'self.force' option to ignore file
- # timestamps, but methods defined *here* assume that
- # 'self.force' exists for all commands. So define it here
- # just to be safe.
- self.force = None
-
- # The 'help' flag is just used for command line parsing, so
- # none of that complicated bureaucracy is needed.
- self.help = False
-
- # 'finalized' records whether or not 'finalize_options()' has been
- # called. 'finalize_options()' itself should not pay attention to
- # this flag: it is the business of 'ensure_finalized()', which
- # always calls 'finalize_options()', to respect/update it.
- self.finalized = False
-
- # XXX A more explicit way to customize dry_run would be better.
- @property
- def dry_run(self):
- if self._dry_run is None:
- return getattr(self.distribution, 'dry_run')
- else:
- return self._dry_run
-
- def ensure_finalized(self):
- if not self.finalized:
- self.finalize_options()
- self.finalized = True
-
- # Subclasses must define:
- # initialize_options()
- # provide default values for all options; may be customized by
- # setup script, by options from config file(s), or by command-line
- # options
- # finalize_options()
- # decide on the final values for all options; this is called
- # after all possible intervention from the outside world
- # (command line, option file, etc.) has been processed
- # run()
- # run the command: do whatever it is we're here to do,
- # controlled by the command's various option values
-
- def initialize_options(self):
- """Set default values for all the options that this command
- supports. Note that these defaults may be overridden by other
- commands, by the setup script, by config files, or by the
- command line. Thus, this is not the place to code dependencies
- between options; generally, 'initialize_options()' implementations
- are just a bunch of "self.foo = None" assignments.
-
- This method must be implemented by all command classes.
- """
- raise RuntimeError(
- "abstract method -- subclass %s must override" % self.__class__)
-
- def finalize_options(self):
- """Set final values for all the options that this command supports.
- This is always called as late as possible, ie. after any option
- assignments from the command line or from other commands have been
- done. Thus, this is the place to code option dependencies: if
- 'foo' depends on 'bar', then it is safe to set 'foo' from 'bar' as
- long as 'foo' still has the same value it was assigned in
- 'initialize_options()'.
-
- This method must be implemented by all command classes.
- """
- raise RuntimeError(
- "abstract method -- subclass %s must override" % self.__class__)
-
- def dump_options(self, header=None, indent=""):
- if header is None:
- header = "command options for '%s':" % self.get_command_name()
- logger.info(indent + header)
- indent = indent + " "
- negative_opt = getattr(self, 'negative_opt', ())
- for option, _, _ in self.user_options:
- if option in negative_opt:
- continue
- option = option.replace('-', '_')
- if option[-1] == "=":
- option = option[:-1]
- value = getattr(self, option)
- logger.info(indent + "%s = %s", option, value)
-
- def run(self):
- """A command's raison d'etre: carry out the action it exists to
- perform, controlled by the options initialized in
- 'initialize_options()', customized by other commands, the setup
- script, the command line and config files, and finalized in
- 'finalize_options()'. All terminal output and filesystem
- interaction should be done by 'run()'.
-
- This method must be implemented by all command classes.
- """
- raise RuntimeError(
- "abstract method -- subclass %s must override" % self.__class__)
-
- # -- External interface --------------------------------------------
- # (called by outsiders)
-
- def get_source_files(self):
- """Return the list of files that are used as inputs to this command,
- i.e. the files used to generate the output files. The result is used
- by the `sdist` command in determining the set of default files.
-
- Command classes should implement this method if they operate on files
- from the source tree.
- """
- return []
-
- def get_outputs(self):
- """Return the list of files that would be produced if this command
- were actually run. Not affected by the "dry-run" flag or whether
- any other commands have been run.
-
- Command classes should implement this method if they produce any
- output files that get consumed by another command. e.g., `build_ext`
- returns the list of built extension modules, but not any temporary
- files used in the compilation process.
- """
- return []
-
- # -- Option validation methods -------------------------------------
- # (these are very handy in writing the 'finalize_options()' method)
- #
- # NB. the general philosophy here is to ensure that a particular option
- # value meets certain type and value constraints. If not, we try to
- # force it into conformance (eg. if we expect a list but have a string,
- # split the string on comma and/or whitespace). If we can't force the
- # option into conformance, raise PackagingOptionError. Thus, command
- # classes need do nothing more than (eg.)
- # self.ensure_string_list('foo')
- # and they can be guaranteed that thereafter, self.foo will be
- # a list of strings.
-
- def _ensure_stringlike(self, option, what, default=None):
- val = getattr(self, option)
- if val is None:
- setattr(self, option, default)
- return default
- elif not isinstance(val, str):
- raise PackagingOptionError("'%s' must be a %s (got `%s`)" %
- (option, what, val))
- return val
-
- def ensure_string(self, option, default=None):
- """Ensure that 'option' is a string; if not defined, set it to
- 'default'.
- """
- self._ensure_stringlike(option, "string", default)
-
- def ensure_string_list(self, option):
- r"""Ensure that 'option' is a list of strings. If 'option' is
- currently a string, we split it either on /,\s*/ or /\s+/, so
- "foo bar baz", "foo,bar,baz", and "foo, bar baz" all become
- ["foo", "bar", "baz"].
- """
- val = getattr(self, option)
- if val is None:
- return
- elif isinstance(val, str):
- setattr(self, option, re.split(r',\s*|\s+', val))
- else:
- if isinstance(val, list):
- # checks if all elements are str
- ok = True
- for element in val:
- if not isinstance(element, str):
- ok = False
- break
- else:
- ok = False
-
- if not ok:
- raise PackagingOptionError(
- "'%s' must be a list of strings (got %r)" % (option, val))
-
- def _ensure_tested_string(self, option, tester,
- what, error_fmt, default=None):
- val = self._ensure_stringlike(option, what, default)
- if val is not None and not tester(val):
- raise PackagingOptionError(
- ("error in '%s' option: " + error_fmt) % (option, val))
-
- def ensure_filename(self, option):
- """Ensure that 'option' is the name of an existing file."""
- self._ensure_tested_string(option, os.path.isfile,
- "filename",
- "'%s' does not exist or is not a file")
-
- def ensure_dirname(self, option):
- self._ensure_tested_string(option, os.path.isdir,
- "directory name",
- "'%s' does not exist or is not a directory")
-
- # -- Convenience methods for commands ------------------------------
-
- @classmethod
- def get_command_name(cls):
- if hasattr(cls, 'command_name'):
- return cls.command_name
- else:
- return cls.__name__
-
- def set_undefined_options(self, src_cmd, *options):
- """Set values of undefined options from another command.
-
- Undefined options are options set to None, which is the convention
- used to indicate that an option has not been changed between
- 'initialize_options()' and 'finalize_options()'. This method is
- usually called from 'finalize_options()' for options that depend on
- some other command rather than another option of the same command,
- typically subcommands.
-
- The 'src_cmd' argument is the other command from which option values
- will be taken (a command object will be created for it if necessary);
- the remaining positional arguments are strings that give the name of
- the option to set. If the name is different on the source and target
- command, you can pass a tuple with '(name_on_source, name_on_dest)' so
- that 'self.name_on_dest' will be set from 'src_cmd.name_on_source'.
- """
- src_cmd_obj = self.distribution.get_command_obj(src_cmd)
- src_cmd_obj.ensure_finalized()
- for obj in options:
- if isinstance(obj, tuple):
- src_option, dst_option = obj
- else:
- src_option, dst_option = obj, obj
- if getattr(self, dst_option) is None:
- setattr(self, dst_option,
- getattr(src_cmd_obj, src_option))
-
- def get_finalized_command(self, command, create=True):
- """Wrapper around Distribution's 'get_command_obj()' method: find
- (create if necessary and 'create' is true) the command object for
- 'command', call its 'ensure_finalized()' method, and return the
- finalized command object.
- """
- cmd_obj = self.distribution.get_command_obj(command, create)
- cmd_obj.ensure_finalized()
- return cmd_obj
-
- def reinitialize_command(self, command, reinit_subcommands=False):
- return self.distribution.reinitialize_command(
- command, reinit_subcommands)
-
- def run_command(self, command):
- """Run some other command: uses the 'run_command()' method of
- Distribution, which creates and finalizes the command object if
- necessary and then invokes its 'run()' method.
- """
- self.distribution.run_command(command)
-
- def get_sub_commands(self):
- """Determine the sub-commands that are relevant in the current
- distribution (ie., that need to be run). This is based on the
- 'sub_commands' class attribute: each tuple in that list may include
- a method that we call to determine if the subcommand needs to be
- run for the current distribution. Return a list of command names.
- """
- commands = []
- for sub_command in self.sub_commands:
- if len(sub_command) == 2:
- cmd_name, method = sub_command
- if method is None or method(self):
- commands.append(cmd_name)
- else:
- commands.append(sub_command)
- return commands
-
- # -- External world manipulation -----------------------------------
-
- def execute(self, func, args, msg=None, level=1):
- util.execute(func, args, msg, dry_run=self.dry_run)
-
- def mkpath(self, name, mode=0o777, dry_run=None):
- if dry_run is None:
- dry_run = self.dry_run
- name = os.path.normpath(name)
- if os.path.isdir(name) or name == '':
- return
- if dry_run:
- head = ''
- for part in name.split(os.sep):
- logger.info("created directory %s%s", head, part)
- head += part + os.sep
- return
- os.makedirs(name, mode)
-
- def copy_file(self, infile, outfile,
- preserve_mode=True, preserve_times=True, link=None, level=1):
- """Copy a file respecting dry-run and force flags.
-
- (dry-run defaults to whatever is in the Distribution object, and
- force to false for commands that don't define it.)
- """
- if self.dry_run:
- # XXX add a comment
- return
- if os.path.isdir(outfile):
- outfile = os.path.join(outfile, os.path.split(infile)[-1])
- copyfile(infile, outfile)
- return outfile, None # XXX
-
- def copy_tree(self, infile, outfile, preserve_mode=True,
- preserve_times=True, preserve_symlinks=False, level=1):
- """Copy an entire directory tree respecting dry-run
- and force flags.
- """
- if self.dry_run:
- # XXX should not return but let copy_tree log and decide to execute
- # or not based on its dry_run argument
- return
-
- return util.copy_tree(infile, outfile, preserve_mode, preserve_times,
- preserve_symlinks, not self.force, dry_run=self.dry_run)
-
- def move_file(self, src, dst, level=1):
- """Move a file respecting the dry-run flag."""
- if self.dry_run:
- return # XXX same thing
- return move(src, dst)
-
- def spawn(self, cmd, search_path=True, level=1):
- """Spawn an external command respecting dry-run flag."""
- from packaging.util import spawn
- spawn(cmd, search_path, dry_run=self.dry_run)
-
- def make_archive(self, base_name, format, root_dir=None, base_dir=None,
- owner=None, group=None):
- return make_archive(base_name, format, root_dir,
- base_dir, dry_run=self.dry_run,
- owner=owner, group=group)
-
- def make_file(self, infiles, outfile, func, args,
- exec_msg=None, skip_msg=None, level=1):
- """Special case of 'execute()' for operations that process one or
- more input files and generate one output file. Works just like
- 'execute()', except the operation is skipped and a different
- message printed if 'outfile' already exists and is newer than all
- files listed in 'infiles'. If the command defined 'self.force',
- and it is true, then the command is unconditionally run -- does no
- timestamp checks.
- """
- if skip_msg is None:
- skip_msg = "skipping %s (inputs unchanged)" % outfile
-
- # Allow 'infiles' to be a single string
- if isinstance(infiles, str):
- infiles = (infiles,)
- elif not isinstance(infiles, (list, tuple)):
- raise TypeError(
- "'infiles' must be a string, or a list or tuple of strings")
-
- if exec_msg is None:
- exec_msg = "generating %s from %s" % (outfile, ', '.join(infiles))
-
- # If 'outfile' must be regenerated (either because it doesn't
- # exist, is out-of-date, or the 'force' flag is true) then
- # perform the action that presumably regenerates it
- if self.force or util.newer_group(infiles, outfile):
- self.execute(func, args, exec_msg, level)
-
- # Otherwise, print the "skip" message
- else:
- logger.debug(skip_msg)
-
- def byte_compile(self, files, prefix=None):
- """Byte-compile files to pyc and/or pyo files.
-
- This method requires that the calling class define compile and
- optimize options, like build_py and install_lib. It also
- automatically respects the force and dry-run options.
-
- prefix, if given, is a string that will be stripped off the
- filenames encoded in bytecode files.
- """
- if self.compile:
- util.byte_compile(files, optimize=False, prefix=prefix,
- force=self.force, dry_run=self.dry_run)
- if self.optimize:
- util.byte_compile(files, optimize=self.optimize, prefix=prefix,
- force=self.force, dry_run=self.dry_run)
diff --git a/Lib/packaging/command/command_template b/Lib/packaging/command/command_template
deleted file mode 100644
index a12d32bfb3..0000000000
--- a/Lib/packaging/command/command_template
+++ /dev/null
@@ -1,35 +0,0 @@
-"""Do X and Y."""
-
-from packaging import logger
-from packaging.command.cmd import Command
-
-
-class x(Command):
-
- # Brief (40-50 characters) description of the command
- description = ""
-
- # List of option tuples: long name, short name (None if no short
- # name), and help string.
- user_options = [
- ('', '', # long option, short option (one letter) or None
- ""), # help text
- ]
-
- def initialize_options(self):
- self. = None
- self. = None
- self. = None
-
- def finalize_options(self):
- if self.x is None:
- self.x = ...
-
- def run(self):
- ...
- logger.info(...)
-
- if not self.dry_run:
- ...
-
- self.execute(..., dry_run=self.dry_run)
diff --git a/Lib/packaging/command/config.py b/Lib/packaging/command/config.py
deleted file mode 100644
index 264c1396b2..0000000000
--- a/Lib/packaging/command/config.py
+++ /dev/null
@@ -1,349 +0,0 @@
-"""Prepare the build.
-
-This module provides config, a (mostly) empty command class
-that exists mainly to be sub-classed by specific module distributions and
-applications. The idea is that while every "config" command is different,
-at least they're all named the same, and users always see "config" in the
-list of standard commands. Also, this is a good place to put common
-configure-like tasks: "try to compile this C code", or "figure out where
-this header file lives".
-"""
-
-import os
-import re
-
-from packaging.command.cmd import Command
-from packaging.errors import PackagingExecError
-from packaging.compiler import customize_compiler
-from packaging import logger
-
-LANG_EXT = {'c': '.c', 'c++': '.cxx'}
-
-class config(Command):
-
- description = "prepare the build"
-
- user_options = [
- ('compiler=', None,
- "specify the compiler type"),
- ('cc=', None,
- "specify the compiler executable"),
- ('include-dirs=', 'I',
- "list of directories to search for header files"),
- ('define=', 'D',
- "C preprocessor macros to define"),
- ('undef=', 'U',
- "C preprocessor macros to undefine"),
- ('libraries=', 'l',
- "external C libraries to link with"),
- ('library-dirs=', 'L',
- "directories to search for external C libraries"),
-
- ('noisy', None,
- "show every action (compile, link, run, ...) taken"),
- ('dump-source', None,
- "dump generated source files before attempting to compile them"),
- ]
-
-
- # The three standard command methods: since the "config" command
- # does nothing by default, these are empty.
-
- def initialize_options(self):
- self.compiler = None
- self.cc = None
- self.include_dirs = None
- self.libraries = None
- self.library_dirs = None
-
- # maximal output for now
- self.noisy = True
- self.dump_source = True
-
- # list of temporary files generated along-the-way that we have
- # to clean at some point
- self.temp_files = []
-
- def finalize_options(self):
- if self.include_dirs is None:
- self.include_dirs = self.distribution.include_dirs or []
- elif isinstance(self.include_dirs, str):
- self.include_dirs = self.include_dirs.split(os.pathsep)
-
- if self.libraries is None:
- self.libraries = []
- elif isinstance(self.libraries, str):
- self.libraries = [self.libraries]
-
- if self.library_dirs is None:
- self.library_dirs = []
- elif isinstance(self.library_dirs, str):
- self.library_dirs = self.library_dirs.split(os.pathsep)
-
- def run(self):
- pass
-
-
- # Utility methods for actual "config" commands. The interfaces are
- # loosely based on Autoconf macros of similar names. Sub-classes
- # may use these freely.
-
- def _check_compiler(self):
- """Check that 'self.compiler' really is a CCompiler object;
- if not, make it one.
- """
- # We do this late, and only on-demand, because this is an expensive
- # import.
- from packaging.compiler.ccompiler import CCompiler
- from packaging.compiler import new_compiler
- if not isinstance(self.compiler, CCompiler):
- self.compiler = new_compiler(compiler=self.compiler,
- dry_run=self.dry_run, force=True)
- customize_compiler(self.compiler)
- if self.include_dirs:
- self.compiler.set_include_dirs(self.include_dirs)
- if self.libraries:
- self.compiler.set_libraries(self.libraries)
- if self.library_dirs:
- self.compiler.set_library_dirs(self.library_dirs)
-
-
- def _gen_temp_sourcefile(self, body, headers, lang):
- filename = "_configtest" + LANG_EXT[lang]
- with open(filename, "w") as file:
- if headers:
- for header in headers:
- file.write("#include <%s>\n" % header)
- file.write("\n")
- file.write(body)
- if body[-1] != "\n":
- file.write("\n")
- return filename
-
- def _preprocess(self, body, headers, include_dirs, lang):
- src = self._gen_temp_sourcefile(body, headers, lang)
- out = "_configtest.i"
- self.temp_files.extend((src, out))
- self.compiler.preprocess(src, out, include_dirs=include_dirs)
- return src, out
-
- def _compile(self, body, headers, include_dirs, lang):
- src = self._gen_temp_sourcefile(body, headers, lang)
- if self.dump_source:
- dump_file(src, "compiling '%s':" % src)
- obj = self.compiler.object_filenames([src])[0]
- self.temp_files.extend((src, obj))
- self.compiler.compile([src], include_dirs=include_dirs)
- return src, obj
-
- def _link(self, body, headers, include_dirs, libraries, library_dirs,
- lang):
- src, obj = self._compile(body, headers, include_dirs, lang)
- prog = os.path.splitext(os.path.basename(src))[0]
- self.compiler.link_executable([obj], prog,
- libraries=libraries,
- library_dirs=library_dirs,
- target_lang=lang)
-
- if self.compiler.exe_extension is not None:
- prog = prog + self.compiler.exe_extension
- self.temp_files.append(prog)
-
- return src, obj, prog
-
- def _clean(self, *filenames):
- if not filenames:
- filenames = self.temp_files
- self.temp_files = []
- logger.info("removing: %s", ' '.join(filenames))
- for filename in filenames:
- try:
- os.remove(filename)
- except OSError:
- pass
-
-
- # XXX these ignore the dry-run flag: what to do, what to do? even if
- # you want a dry-run build, you still need some sort of configuration
- # info. My inclination is to make it up to the real config command to
- # consult 'dry_run', and assume a default (minimal) configuration if
- # true. The problem with trying to do it here is that you'd have to
- # return either true or false from all the 'try' methods, neither of
- # which is correct.
-
- # XXX need access to the header search path and maybe default macros.
-
- def try_cpp(self, body=None, headers=None, include_dirs=None, lang="c"):
- """Construct a source file from 'body' (a string containing lines
- of C/C++ code) and 'headers' (a list of header files to include)
- and run it through the preprocessor. Return true if the
- preprocessor succeeded, false if there were any errors.
- ('body' probably isn't of much use, but what the heck.)
- """
- from packaging.compiler.ccompiler import CompileError
- self._check_compiler()
- ok = True
- try:
- self._preprocess(body, headers, include_dirs, lang)
- except CompileError:
- ok = False
-
- self._clean()
- return ok
-
- def search_cpp(self, pattern, body=None, headers=None, include_dirs=None,
- lang="c"):
- """Construct a source file (just like 'try_cpp()'), run it through
- the preprocessor, and return true if any line of the output matches
- 'pattern'. 'pattern' should either be a compiled regex object or a
- string containing a regex. If both 'body' and 'headers' are None,
- preprocesses an empty file -- which can be useful to determine the
- symbols the preprocessor and compiler set by default.
- """
- self._check_compiler()
- src, out = self._preprocess(body, headers, include_dirs, lang)
-
- if isinstance(pattern, str):
- pattern = re.compile(pattern)
-
- with open(out) as file:
- match = False
- while True:
- line = file.readline()
- if line == '':
- break
- if pattern.search(line):
- match = True
- break
-
- self._clean()
- return match
-
- def try_compile(self, body, headers=None, include_dirs=None, lang="c"):
- """Try to compile a source file built from 'body' and 'headers'.
- Return true on success, false otherwise.
- """
- from packaging.compiler.ccompiler import CompileError
- self._check_compiler()
- try:
- self._compile(body, headers, include_dirs, lang)
- ok = True
- except CompileError:
- ok = False
-
- logger.info(ok and "success!" or "failure.")
- self._clean()
- return ok
-
- def try_link(self, body, headers=None, include_dirs=None, libraries=None,
- library_dirs=None, lang="c"):
- """Try to compile and link a source file, built from 'body' and
- 'headers', to executable form. Return true on success, false
- otherwise.
- """
- from packaging.compiler.ccompiler import CompileError, LinkError
- self._check_compiler()
- try:
- self._link(body, headers, include_dirs,
- libraries, library_dirs, lang)
- ok = True
- except (CompileError, LinkError):
- ok = False
-
- logger.info(ok and "success!" or "failure.")
- self._clean()
- return ok
-
- def try_run(self, body, headers=None, include_dirs=None, libraries=None,
- library_dirs=None, lang="c"):
- """Try to compile, link to an executable, and run a program
- built from 'body' and 'headers'. Return true on success, false
- otherwise.
- """
- from packaging.compiler.ccompiler import CompileError, LinkError
- self._check_compiler()
- try:
- src, obj, exe = self._link(body, headers, include_dirs,
- libraries, library_dirs, lang)
- self.spawn([exe])
- ok = True
- except (CompileError, LinkError, PackagingExecError):
- ok = False
-
- logger.info(ok and "success!" or "failure.")
- self._clean()
- return ok
-
-
- # -- High-level methods --------------------------------------------
- # (these are the ones that are actually likely to be useful
- # when implementing a real-world config command!)
-
- def check_func(self, func, headers=None, include_dirs=None,
- libraries=None, library_dirs=None, decl=False, call=False):
-
- """Determine if function 'func' is available by constructing a
- source file that refers to 'func', and compiles and links it.
- If everything succeeds, returns true; otherwise returns false.
-
- The constructed source file starts out by including the header
- files listed in 'headers'. If 'decl' is true, it then declares
- 'func' (as "int func()"); you probably shouldn't supply 'headers'
- and set 'decl' true in the same call, or you might get errors about
- a conflicting declarations for 'func'. Finally, the constructed
- 'main()' function either references 'func' or (if 'call' is true)
- calls it. 'libraries' and 'library_dirs' are used when
- linking.
- """
-
- self._check_compiler()
- body = []
- if decl:
- body.append("int %s ();" % func)
- body.append("int main () {")
- if call:
- body.append(" %s();" % func)
- else:
- body.append(" %s;" % func)
- body.append("}")
- body = "\n".join(body) + "\n"
-
- return self.try_link(body, headers, include_dirs,
- libraries, library_dirs)
-
- def check_lib(self, library, library_dirs=None, headers=None,
- include_dirs=None, other_libraries=[]):
- """Determine if 'library' is available to be linked against,
- without actually checking that any particular symbols are provided
- by it. 'headers' will be used in constructing the source file to
- be compiled, but the only effect of this is to check if all the
- header files listed are available. Any libraries listed in
- 'other_libraries' will be included in the link, in case 'library'
- has symbols that depend on other libraries.
- """
- self._check_compiler()
- return self.try_link("int main (void) { }",
- headers, include_dirs,
- [library]+other_libraries, library_dirs)
-
- def check_header(self, header, include_dirs=None, library_dirs=None,
- lang="c"):
- """Determine if the system header file named by 'header_file'
- exists and can be found by the preprocessor; return true if so,
- false otherwise.
- """
- return self.try_cpp(body="/* No body */", headers=[header],
- include_dirs=include_dirs)
-
-
-def dump_file(filename, head=None):
- """Dumps a file content into log.info.
-
- If head is not None, will be dumped before the file content.
- """
- if head is None:
- logger.info(filename)
- else:
- logger.info(head)
- with open(filename) as file:
- logger.info(file.read())
diff --git a/Lib/packaging/command/install_data.py b/Lib/packaging/command/install_data.py
deleted file mode 100644
index 9ca6279533..0000000000
--- a/Lib/packaging/command/install_data.py
+++ /dev/null
@@ -1,79 +0,0 @@
-"""Install platform-independent data files."""
-
-# Contributed by Bastian Kleineidam
-
-import os
-from shutil import Error
-from sysconfig import get_paths, format_value
-from packaging import logger
-from packaging.util import convert_path
-from packaging.command.cmd import Command
-
-
-class install_data(Command):
-
- description = "install platform-independent data files"
-
- user_options = [
- ('install-dir=', 'd',
- "base directory for installing data files "
- "(default: installation base dir)"),
- ('root=', None,
- "install everything relative to this alternate root directory"),
- ('force', 'f', "force installation (overwrite existing files)"),
- ]
-
- boolean_options = ['force']
-
- def initialize_options(self):
- self.install_dir = None
- self.outfiles = []
- self.data_files_out = []
- self.root = None
- self.force = False
- self.data_files = self.distribution.data_files
- self.warn_dir = True
-
- def finalize_options(self):
- self.set_undefined_options('install_dist',
- ('install_data', 'install_dir'),
- 'root', 'force')
-
- def run(self):
- self.mkpath(self.install_dir)
- for _file in self.data_files.items():
- destination = convert_path(self.expand_categories(_file[1]))
- dir_dest = os.path.abspath(os.path.dirname(destination))
-
- self.mkpath(dir_dest)
- try:
- out = self.copy_file(_file[0], dir_dest)[0]
- except Error as e:
- logger.warning('%s: %s', self.get_command_name(), e)
- out = destination
-
- self.outfiles.append(out)
- self.data_files_out.append((_file[0], destination))
-
- def expand_categories(self, path_with_categories):
- local_vars = get_paths()
- local_vars['distribution.name'] = self.distribution.metadata['Name']
- expanded_path = format_value(path_with_categories, local_vars)
- expanded_path = format_value(expanded_path, local_vars)
- if '{' in expanded_path and '}' in expanded_path:
- logger.warning(
- '%s: unable to expand %s, some categories may be missing',
- self.get_command_name(), path_with_categories)
- return expanded_path
-
- def get_source_files(self):
- return list(self.data_files)
-
- def get_inputs(self):
- return list(self.data_files)
-
- def get_outputs(self):
- return self.outfiles
-
- def get_resources_out(self):
- return self.data_files_out
diff --git a/Lib/packaging/command/install_dist.py b/Lib/packaging/command/install_dist.py
deleted file mode 100644
index 8388dc9fe0..0000000000
--- a/Lib/packaging/command/install_dist.py
+++ /dev/null
@@ -1,605 +0,0 @@
-"""Main install command, which calls the other install_* commands."""
-
-import sys
-import os
-
-import sysconfig
-from sysconfig import get_config_vars, get_paths, get_path, get_config_var
-
-from packaging import logger
-from packaging.command.cmd import Command
-from packaging.errors import PackagingPlatformError
-from packaging.util import write_file
-from packaging.util import convert_path, change_root, get_platform
-from packaging.errors import PackagingOptionError
-
-
-class install_dist(Command):
-
- description = "install everything from build directory"
-
- user_options = [
- # Select installation scheme and set base director(y|ies)
- ('prefix=', None,
- "installation prefix"),
- ('exec-prefix=', None,
- "(Unix only) prefix for platform-specific files"),
- ('user', None,
- "install in user site-packages directory [%s]" %
- get_path('purelib', '%s_user' % os.name)),
- ('home=', None,
- "(Unix only) home directory to install under"),
-
- # Or just set the base director(y|ies)
- ('install-base=', None,
- "base installation directory (instead of --prefix or --home)"),
- ('install-platbase=', None,
- "base installation directory for platform-specific files " +
- "(instead of --exec-prefix or --home)"),
- ('root=', None,
- "install everything relative to this alternate root directory"),
-
- # Or explicitly set the installation scheme
- ('install-purelib=', None,
- "installation directory for pure Python module distributions"),
- ('install-platlib=', None,
- "installation directory for non-pure module distributions"),
- ('install-lib=', None,
- "installation directory for all module distributions " +
- "(overrides --install-purelib and --install-platlib)"),
-
- ('install-headers=', None,
- "installation directory for C/C++ headers"),
- ('install-scripts=', None,
- "installation directory for Python scripts"),
- ('install-data=', None,
- "installation directory for data files"),
-
- # Byte-compilation options -- see install_lib for details
- ('compile', 'c', "compile .py to .pyc [default]"),
- ('no-compile', None, "don't compile .py files"),
- ('optimize=', 'O',
- 'also compile with optimization: -O1 for "python -O", '
- '-O2 for "python -OO", and -O0 to disable [default: -O0]'),
-
- # Miscellaneous control options
- ('force', 'f',
- "force installation (overwrite any existing files)"),
- ('skip-build', None,
- "skip rebuilding everything (for testing/debugging)"),
-
- # Where to install documentation (eventually!)
- #('doc-format=', None, "format of documentation to generate"),
- #('install-man=', None, "directory for Unix man pages"),
- #('install-html=', None, "directory for HTML documentation"),
- #('install-info=', None, "directory for GNU info files"),
-
- # XXX use a name that makes clear this is the old format
- ('record=', None,
- "filename in which to record a list of installed files "
- "(not PEP 376-compliant)"),
- ('resources=', None,
- "data files mapping"),
-
- # .dist-info related arguments, read by install_dist_info
- ('no-distinfo', None,
- "do not create a .dist-info directory"),
- ('installer=', None,
- "the name of the installer"),
- ('requested', None,
- "generate a REQUESTED file (i.e."),
- ('no-requested', None,
- "do not generate a REQUESTED file"),
- ('no-record', None,
- "do not generate a RECORD file"),
- ]
-
- boolean_options = ['compile', 'force', 'skip-build', 'no-distinfo',
- 'requested', 'no-record', 'user']
-
- negative_opt = {'no-compile': 'compile', 'no-requested': 'requested'}
-
- def initialize_options(self):
- # High-level options: these select both an installation base
- # and scheme.
- self.prefix = None
- self.exec_prefix = None
- self.home = None
- self.user = False
-
- # These select only the installation base; it's up to the user to
- # specify the installation scheme (currently, that means supplying
- # the --install-{platlib,purelib,scripts,data} options).
- self.install_base = None
- self.install_platbase = None
- self.root = None
-
- # These options are the actual installation directories; if not
- # supplied by the user, they are filled in using the installation
- # scheme implied by prefix/exec-prefix/home and the contents of
- # that installation scheme.
- self.install_purelib = None # for pure module distributions
- self.install_platlib = None # non-pure (dists w/ extensions)
- self.install_headers = None # for C/C++ headers
- self.install_lib = None # set to either purelib or platlib
- self.install_scripts = None
- self.install_data = None
- self.install_userbase = get_config_var('userbase')
- self.install_usersite = get_path('purelib', '%s_user' % os.name)
-
- self.compile = None
- self.optimize = None
-
- # These two are for putting non-packagized distributions into their
- # own directory and creating a .pth file if it makes sense.
- # 'extra_path' comes from the setup file; 'install_path_file' can
- # be turned off if it makes no sense to install a .pth file. (But
- # better to install it uselessly than to guess wrong and not
- # install it when it's necessary and would be used!) Currently,
- # 'install_path_file' is always true unless some outsider meddles
- # with it.
- self.extra_path = None
- self.install_path_file = True
-
- # 'force' forces installation, even if target files are not
- # out-of-date. 'skip_build' skips running the "build" command,
- # handy if you know it's not necessary. 'warn_dir' (which is *not*
- # a user option, it's just there so the bdist_* commands can turn
- # it off) determines whether we warn about installing to a
- # directory not in sys.path.
- self.force = False
- self.skip_build = False
- self.warn_dir = True
-
- # These are only here as a conduit from the 'build' command to the
- # 'install_*' commands that do the real work. ('build_base' isn't
- # actually used anywhere, but it might be useful in future.) They
- # are not user options, because if the user told the install
- # command where the build directory is, that wouldn't affect the
- # build command.
- self.build_base = None
- self.build_lib = None
-
- # Not defined yet because we don't know anything about
- # documentation yet.
- #self.install_man = None
- #self.install_html = None
- #self.install_info = None
-
- self.record = None
- self.resources = None
-
- # .dist-info related options
- self.no_distinfo = None
- self.installer = None
- self.requested = None
- self.no_record = None
-
- # -- Option finalizing methods -------------------------------------
- # (This is rather more involved than for most commands,
- # because this is where the policy for installing third-
- # party Python modules on various platforms given a wide
- # array of user input is decided. Yes, it's quite complex!)
-
- def finalize_options(self):
- # This method (and its pliant slaves, like 'finalize_unix()',
- # 'finalize_other()', and 'select_scheme()') is where the default
- # installation directories for modules, extension modules, and
- # anything else we care to install from a Python module
- # distribution. Thus, this code makes a pretty important policy
- # statement about how third-party stuff is added to a Python
- # installation! Note that the actual work of installation is done
- # by the relatively simple 'install_*' commands; they just take
- # their orders from the installation directory options determined
- # here.
-
- # Check for errors/inconsistencies in the options; first, stuff
- # that's wrong on any platform.
-
- if ((self.prefix or self.exec_prefix or self.home) and
- (self.install_base or self.install_platbase)):
- raise PackagingOptionError(
- "must supply either prefix/exec-prefix/home or "
- "install-base/install-platbase -- not both")
-
- if self.home and (self.prefix or self.exec_prefix):
- raise PackagingOptionError(
- "must supply either home or prefix/exec-prefix -- not both")
-
- if self.user and (self.prefix or self.exec_prefix or self.home or
- self.install_base or self.install_platbase):
- raise PackagingOptionError(
- "can't combine user with prefix/exec_prefix/home or "
- "install_base/install_platbase")
-
- # Next, stuff that's wrong (or dubious) only on certain platforms.
- if os.name != "posix":
- if self.exec_prefix:
- logger.warning(
- '%s: exec-prefix option ignored on this platform',
- self.get_command_name())
- self.exec_prefix = None
-
- # Now the interesting logic -- so interesting that we farm it out
- # to other methods. The goal of these methods is to set the final
- # values for the install_{lib,scripts,data,...} options, using as
- # input a heady brew of prefix, exec_prefix, home, install_base,
- # install_platbase, user-supplied versions of
- # install_{purelib,platlib,lib,scripts,data,...}, and the
- # INSTALL_SCHEME dictionary above. Phew!
-
- self.dump_dirs("pre-finalize_{unix,other}")
-
- if os.name == 'posix':
- self.finalize_unix()
- else:
- self.finalize_other()
-
- self.dump_dirs("post-finalize_{unix,other}()")
-
- # Expand configuration variables, tilde, etc. in self.install_base
- # and self.install_platbase -- that way, we can use $base or
- # $platbase in the other installation directories and not worry
- # about needing recursive variable expansion (shudder).
-
- py_version = '%s.%s' % sys.version_info[:2]
- prefix, exec_prefix, srcdir, projectbase = get_config_vars(
- 'prefix', 'exec_prefix', 'srcdir', 'projectbase')
-
- metadata = self.distribution.metadata
- self.config_vars = {
- 'dist_name': metadata['Name'],
- 'dist_version': metadata['Version'],
- 'dist_fullname': metadata.get_fullname(),
- 'py_version': py_version,
- 'py_version_short': py_version[:3],
- 'py_version_nodot': py_version[:3:2],
- 'sys_prefix': prefix,
- 'prefix': prefix,
- 'sys_exec_prefix': exec_prefix,
- 'exec_prefix': exec_prefix,
- 'srcdir': srcdir,
- 'projectbase': projectbase,
- 'userbase': self.install_userbase,
- 'usersite': self.install_usersite,
- }
-
- self.expand_basedirs()
-
- self.dump_dirs("post-expand_basedirs()")
-
- # Now define config vars for the base directories so we can expand
- # everything else.
- self.config_vars['base'] = self.install_base
- self.config_vars['platbase'] = self.install_platbase
-
- # Expand "~" and configuration variables in the installation
- # directories.
- self.expand_dirs()
-
- self.dump_dirs("post-expand_dirs()")
-
- # Create directories under USERBASE
- if self.user:
- self.create_user_dirs()
-
- # Pick the actual directory to install all modules to: either
- # install_purelib or install_platlib, depending on whether this
- # module distribution is pure or not. Of course, if the user
- # already specified install_lib, use their selection.
- if self.install_lib is None:
- if self.distribution.ext_modules: # has extensions: non-pure
- self.install_lib = self.install_platlib
- else:
- self.install_lib = self.install_purelib
-
- # Convert directories from Unix /-separated syntax to the local
- # convention.
- self.convert_paths('lib', 'purelib', 'platlib', 'scripts',
- 'data', 'headers', 'userbase', 'usersite')
-
- # Well, we're not actually fully completely finalized yet: we still
- # have to deal with 'extra_path', which is the hack for allowing
- # non-packagized module distributions (hello, Numerical Python!) to
- # get their own directories.
- self.handle_extra_path()
- self.install_libbase = self.install_lib # needed for .pth file
- self.install_lib = os.path.join(self.install_lib, self.extra_dirs)
-
- # If a new root directory was supplied, make all the installation
- # dirs relative to it.
- if self.root is not None:
- self.change_roots('libbase', 'lib', 'purelib', 'platlib',
- 'scripts', 'data', 'headers')
-
- self.dump_dirs("after prepending root")
-
- # Find out the build directories, ie. where to install from.
- self.set_undefined_options('build', 'build_base', 'build_lib')
-
- # Punt on doc directories for now -- after all, we're punting on
- # documentation completely!
-
- if self.no_distinfo is None:
- self.no_distinfo = False
-
- def finalize_unix(self):
- """Finalize options for posix platforms."""
- if self.install_base is not None or self.install_platbase is not None:
- if ((self.install_lib is None and
- self.install_purelib is None and
- self.install_platlib is None) or
- self.install_headers is None or
- self.install_scripts is None or
- self.install_data is None):
- raise PackagingOptionError(
- "install-base or install-platbase supplied, but "
- "installation scheme is incomplete")
- return
-
- if self.user:
- if self.install_userbase is None:
- raise PackagingPlatformError(
- "user base directory is not specified")
- self.install_base = self.install_platbase = self.install_userbase
- self.select_scheme("posix_user")
- elif self.home is not None:
- self.install_base = self.install_platbase = self.home
- self.select_scheme("posix_home")
- else:
- if self.prefix is None:
- if self.exec_prefix is not None:
- raise PackagingOptionError(
- "must not supply exec-prefix without prefix")
-
- self.prefix = os.path.normpath(sys.prefix)
- self.exec_prefix = os.path.normpath(sys.exec_prefix)
-
- else:
- if self.exec_prefix is None:
- self.exec_prefix = self.prefix
-
- self.install_base = self.prefix
- self.install_platbase = self.exec_prefix
- self.select_scheme("posix_prefix")
-
- def finalize_other(self):
- """Finalize options for non-posix platforms"""
- if self.user:
- if self.install_userbase is None:
- raise PackagingPlatformError(
- "user base directory is not specified")
- self.install_base = self.install_platbase = self.install_userbase
- self.select_scheme(os.name + "_user")
- elif self.home is not None:
- self.install_base = self.install_platbase = self.home
- self.select_scheme("posix_home")
- else:
- if self.prefix is None:
- self.prefix = os.path.normpath(sys.prefix)
-
- self.install_base = self.install_platbase = self.prefix
- try:
- self.select_scheme(os.name)
- except KeyError:
- raise PackagingPlatformError(
- "no support for installation on '%s'" % os.name)
-
- def dump_dirs(self, msg):
- """Dump the list of user options."""
- logger.debug(msg + ":")
- for opt in self.user_options:
- opt_name = opt[0]
- if opt_name[-1] == "=":
- opt_name = opt_name[0:-1]
- if opt_name in self.negative_opt:
- opt_name = self.negative_opt[opt_name]
- opt_name = opt_name.replace('-', '_')
- val = not getattr(self, opt_name)
- else:
- opt_name = opt_name.replace('-', '_')
- val = getattr(self, opt_name)
- logger.debug(" %s: %s", opt_name, val)
-
- def select_scheme(self, name):
- """Set the install directories by applying the install schemes."""
- # it's the caller's problem if they supply a bad name!
- scheme = get_paths(name, expand=False)
- for key, value in scheme.items():
- if key == 'platinclude':
- key = 'headers'
- value = os.path.join(value, self.distribution.metadata['Name'])
- attrname = 'install_' + key
- if hasattr(self, attrname):
- if getattr(self, attrname) is None:
- setattr(self, attrname, value)
-
- def _expand_attrs(self, attrs):
- for attr in attrs:
- val = getattr(self, attr)
- if val is not None:
- if os.name == 'posix' or os.name == 'nt':
- val = os.path.expanduser(val)
- # see if we want to push this work in sysconfig XXX
- val = sysconfig._subst_vars(val, self.config_vars)
- setattr(self, attr, val)
-
- def expand_basedirs(self):
- """Call `os.path.expanduser` on install_{base,platbase} and root."""
- self._expand_attrs(['install_base', 'install_platbase', 'root'])
-
- def expand_dirs(self):
- """Call `os.path.expanduser` on install dirs."""
- self._expand_attrs(['install_purelib', 'install_platlib',
- 'install_lib', 'install_headers',
- 'install_scripts', 'install_data'])
-
- def convert_paths(self, *names):
- """Call `convert_path` over `names`."""
- for name in names:
- attr = "install_" + name
- setattr(self, attr, convert_path(getattr(self, attr)))
-
- def handle_extra_path(self):
- """Set `path_file` and `extra_dirs` using `extra_path`."""
- if self.extra_path is None:
- self.extra_path = self.distribution.extra_path
-
- if self.extra_path is not None:
- if isinstance(self.extra_path, str):
- self.extra_path = self.extra_path.split(',')
-
- if len(self.extra_path) == 1:
- path_file = extra_dirs = self.extra_path[0]
- elif len(self.extra_path) == 2:
- path_file, extra_dirs = self.extra_path
- else:
- raise PackagingOptionError(
- "'extra_path' option must be a list, tuple, or "
- "comma-separated string with 1 or 2 elements")
-
- # convert to local form in case Unix notation used (as it
- # should be in setup scripts)
- extra_dirs = convert_path(extra_dirs)
- else:
- path_file = None
- extra_dirs = ''
-
- # XXX should we warn if path_file and not extra_dirs? (in which
- # case the path file would be harmless but pointless)
- self.path_file = path_file
- self.extra_dirs = extra_dirs
-
- def change_roots(self, *names):
- """Change the install direcories pointed by name using root."""
- for name in names:
- attr = "install_" + name
- setattr(self, attr, change_root(self.root, getattr(self, attr)))
-
- def create_user_dirs(self):
- """Create directories under USERBASE as needed."""
- home = convert_path(os.path.expanduser("~"))
- for name, path in self.config_vars.items():
- if path.startswith(home) and not os.path.isdir(path):
- os.makedirs(path, 0o700)
-
- # -- Command execution methods -------------------------------------
-
- def run(self):
- """Runs the command."""
- # Obviously have to build before we can install
- if not self.skip_build:
- self.run_command('build')
- # If we built for any other platform, we can't install.
- build_plat = self.distribution.get_command_obj('build').plat_name
- # check warn_dir - it is a clue that the 'install_dist' is happening
- # internally, and not to sys.path, so we don't check the platform
- # matches what we are running.
- if self.warn_dir and build_plat != get_platform():
- raise PackagingPlatformError("Can't install when "
- "cross-compiling")
-
- # Run all sub-commands (at least those that need to be run)
- for cmd_name in self.get_sub_commands():
- self.run_command(cmd_name)
-
- if self.path_file:
- self.create_path_file()
-
- # write list of installed files, if requested.
- if self.record:
- outputs = self.get_outputs()
- if self.root: # strip any package prefix
- root_len = len(self.root)
- for counter in range(len(outputs)):
- outputs[counter] = outputs[counter][root_len:]
- self.execute(write_file,
- (self.record, outputs),
- "writing list of installed files to '%s'" %
- self.record)
-
- normpath, normcase = os.path.normpath, os.path.normcase
- sys_path = [normcase(normpath(p)) for p in sys.path]
- install_lib = normcase(normpath(self.install_lib))
- if (self.warn_dir and
- not (self.path_file and self.install_path_file) and
- install_lib not in sys_path):
- logger.debug(("modules installed to '%s', which is not in "
- "Python's module search path (sys.path) -- "
- "you'll have to change the search path yourself"),
- self.install_lib)
-
- def create_path_file(self):
- """Creates the .pth file"""
- filename = os.path.join(self.install_libbase,
- self.path_file + ".pth")
- if self.install_path_file:
- self.execute(write_file,
- (filename, [self.extra_dirs]),
- "creating %s" % filename)
- else:
- logger.warning('%s: path file %r not created',
- self.get_command_name(), filename)
-
- # -- Reporting methods ---------------------------------------------
-
- def get_outputs(self):
- """Assembles the outputs of all the sub-commands."""
- outputs = []
- for cmd_name in self.get_sub_commands():
- cmd = self.get_finalized_command(cmd_name)
- # Add the contents of cmd.get_outputs(), ensuring
- # that outputs doesn't contain duplicate entries
- for filename in cmd.get_outputs():
- if filename not in outputs:
- outputs.append(filename)
-
- if self.path_file and self.install_path_file:
- outputs.append(os.path.join(self.install_libbase,
- self.path_file + ".pth"))
-
- return outputs
-
- def get_inputs(self):
- """Returns the inputs of all the sub-commands"""
- # XXX gee, this looks familiar ;-(
- inputs = []
- for cmd_name in self.get_sub_commands():
- cmd = self.get_finalized_command(cmd_name)
- inputs.extend(cmd.get_inputs())
-
- return inputs
-
- # -- Predicates for sub-command list -------------------------------
-
- def has_lib(self):
- """Returns true if the current distribution has any Python
- modules to install."""
- return (self.distribution.has_pure_modules() or
- self.distribution.has_ext_modules())
-
- def has_headers(self):
- """Returns true if the current distribution has any headers to
- install."""
- return self.distribution.has_headers()
-
- def has_scripts(self):
- """Returns true if the current distribution has any scripts to.
- install."""
- return self.distribution.has_scripts()
-
- def has_data(self):
- """Returns true if the current distribution has any data to.
- install."""
- return self.distribution.has_data_files()
-
- # 'sub_commands': a list of commands this command might have to run to
- # get its work done. See cmd.py for more info.
- sub_commands = [('install_lib', has_lib),
- ('install_headers', has_headers),
- ('install_scripts', has_scripts),
- ('install_data', has_data),
- # keep install_distinfo last, as it needs the record
- # with files to be completely generated
- ('install_distinfo', lambda self: not self.no_distinfo),
- ]
diff --git a/Lib/packaging/command/install_distinfo.py b/Lib/packaging/command/install_distinfo.py
deleted file mode 100644
index b49729f5af..0000000000
--- a/Lib/packaging/command/install_distinfo.py
+++ /dev/null
@@ -1,143 +0,0 @@
-"""Create the PEP 376-compliant .dist-info directory."""
-
-# Forked from the former install_egg_info command by Josip Djolonga
-
-import os
-import csv
-import hashlib
-from shutil import rmtree
-
-from packaging import logger
-from packaging.command.cmd import Command
-
-
-class install_distinfo(Command):
-
- description = 'create a .dist-info directory for the distribution'
-
- user_options = [
- ('install-dir=', None,
- "directory where the the .dist-info directory will be created"),
- ('installer=', None,
- "the name of the installer"),
- ('requested', None,
- "generate a REQUESTED file"),
- ('no-requested', None,
- "do not generate a REQUESTED file"),
- ('no-record', None,
- "do not generate a RECORD file"),
- ('no-resources', None,
- "do not generate a RESOURCES file"),
- ]
-
- boolean_options = ['requested', 'no-record', 'no-resources']
-
- negative_opt = {'no-requested': 'requested'}
-
- def initialize_options(self):
- self.install_dir = None
- self.installer = None
- self.requested = None
- self.no_record = None
- self.no_resources = None
- self.outfiles = []
-
- def finalize_options(self):
- self.set_undefined_options('install_dist',
- 'installer', 'requested', 'no_record')
-
- self.set_undefined_options('install_lib', 'install_dir')
-
- if self.installer is None:
- # FIXME distutils or packaging?
- # + document default in the option help text above and in install
- self.installer = 'distutils'
- if self.requested is None:
- self.requested = True
- if self.no_record is None:
- self.no_record = False
- if self.no_resources is None:
- self.no_resources = False
-
- metadata = self.distribution.metadata
-
- basename = metadata.get_fullname(filesafe=True) + ".dist-info"
-
- self.install_dir = os.path.join(self.install_dir, basename)
-
- def run(self):
- target = self.install_dir
-
- if os.path.isdir(target) and not os.path.islink(target):
- if not self.dry_run:
- rmtree(target)
- elif os.path.exists(target):
- self.execute(os.unlink, (self.install_dir,),
- "removing " + target)
-
- self.execute(os.makedirs, (target,), "creating " + target)
-
- metadata_path = os.path.join(self.install_dir, 'METADATA')
- self.execute(self.distribution.metadata.write, (metadata_path,),
- "creating " + metadata_path)
- self.outfiles.append(metadata_path)
-
- installer_path = os.path.join(self.install_dir, 'INSTALLER')
- logger.info('creating %s', installer_path)
- if not self.dry_run:
- with open(installer_path, 'w') as f:
- f.write(self.installer)
- self.outfiles.append(installer_path)
-
- if self.requested:
- requested_path = os.path.join(self.install_dir, 'REQUESTED')
- logger.info('creating %s', requested_path)
- if not self.dry_run:
- open(requested_path, 'wb').close()
- self.outfiles.append(requested_path)
-
- if not self.no_resources:
- install_data = self.get_finalized_command('install_data')
- if install_data.get_resources_out() != []:
- resources_path = os.path.join(self.install_dir,
- 'RESOURCES')
- logger.info('creating %s', resources_path)
- if not self.dry_run:
- with open(resources_path, 'w') as f:
- writer = csv.writer(f, delimiter=',',
- lineterminator='\n',
- quotechar='"')
- for row in install_data.get_resources_out():
- writer.writerow(row)
-
- self.outfiles.append(resources_path)
-
- if not self.no_record:
- record_path = os.path.join(self.install_dir, 'RECORD')
- logger.info('creating %s', record_path)
- if not self.dry_run:
- with open(record_path, 'w', encoding='utf-8') as f:
- writer = csv.writer(f, delimiter=',',
- lineterminator='\n',
- quotechar='"')
-
- install = self.get_finalized_command('install_dist')
-
- for fpath in install.get_outputs():
- if fpath.endswith('.pyc') or fpath.endswith('.pyo'):
- # do not put size and md5 hash, as in PEP-376
- writer.writerow((fpath, '', ''))
- else:
- size = os.path.getsize(fpath)
- with open(fpath, 'rb') as fp:
- hash = hashlib.md5()
- hash.update(fp.read())
- md5sum = hash.hexdigest()
- writer.writerow((fpath, md5sum, size))
-
- # add the RECORD file itself
- writer.writerow((record_path, '', ''))
- self.outfiles.append(record_path)
-
- def get_outputs(self):
- return self.outfiles
diff --git a/Lib/packaging/command/install_headers.py b/Lib/packaging/command/install_headers.py
deleted file mode 100644
index e043d6b8ed..0000000000
--- a/Lib/packaging/command/install_headers.py
+++ /dev/null
@@ -1,43 +0,0 @@
-"""Install C/C++ header files to the Python include directory."""
-
-from packaging.command.cmd import Command
-
-
-# XXX force is never used
-class install_headers(Command):
-
- description = "install C/C++ header files"
-
- user_options = [('install-dir=', 'd',
- "directory to install header files to"),
- ('force', 'f',
- "force installation (overwrite existing files)"),
- ]
-
- boolean_options = ['force']
-
- def initialize_options(self):
- self.install_dir = None
- self.force = False
- self.outfiles = []
-
- def finalize_options(self):
- self.set_undefined_options('install_dist',
- ('install_headers', 'install_dir'),
- 'force')
-
- def run(self):
- headers = self.distribution.headers
- if not headers:
- return
-
- self.mkpath(self.install_dir)
- for header in headers:
- out = self.copy_file(header, self.install_dir)[0]
- self.outfiles.append(out)
-
- def get_inputs(self):
- return self.distribution.headers or []
-
- def get_outputs(self):
- return self.outfiles
diff --git a/Lib/packaging/command/install_lib.py b/Lib/packaging/command/install_lib.py
deleted file mode 100644
index ffc5d457e7..0000000000
--- a/Lib/packaging/command/install_lib.py
+++ /dev/null
@@ -1,188 +0,0 @@
-"""Install all modules (extensions and pure Python)."""
-
-import os
-import imp
-
-from packaging import logger
-from packaging.command.cmd import Command
-from packaging.errors import PackagingOptionError
-
-
-# Extension for Python source files.
-# XXX dead code? most of the codebase checks for literal '.py'
-if hasattr(os, 'extsep'):
- PYTHON_SOURCE_EXTENSION = os.extsep + "py"
-else:
- PYTHON_SOURCE_EXTENSION = ".py"
-
-
-class install_lib(Command):
-
- description = "install all modules (extensions and pure Python)"
-
- # The options for controlling byte compilation are two independent sets:
- # 'compile' is strictly boolean, and only decides whether to
- # generate .pyc files. 'optimize' is three-way (0, 1, or 2), and
- # decides both whether to generate .pyo files and what level of
- # optimization to use.
-
- user_options = [
- ('install-dir=', 'd', "directory to install to"),
- ('build-dir=', 'b', "build directory (where to install from)"),
- ('force', 'f', "force installation (overwrite existing files)"),
- ('compile', 'c', "compile .py to .pyc [default]"),
- ('no-compile', None, "don't compile .py files"),
- ('optimize=', 'O',
- "also compile with optimization: -O1 for \"python -O\", "
- "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"),
- ('skip-build', None, "skip the build steps"),
- ]
-
- boolean_options = ['force', 'compile', 'skip-build']
-
- negative_opt = {'no-compile': 'compile'}
-
- def initialize_options(self):
- # let the 'install_dist' command dictate our installation directory
- self.install_dir = None
- self.build_dir = None
- self.force = False
- self.compile = None
- self.optimize = None
- self.skip_build = None
-
- def finalize_options(self):
- # Get all the information we need to install pure Python modules
- # from the umbrella 'install_dist' command -- build (source) directory,
- # install (target) directory, and whether to compile .py files.
- self.set_undefined_options('install_dist',
- ('build_lib', 'build_dir'),
- ('install_lib', 'install_dir'),
- 'force', 'compile', 'optimize',
- 'skip_build')
-
- if self.compile is None:
- self.compile = True
- if self.optimize is None:
- self.optimize = 0
-
- if not isinstance(self.optimize, int):
- try:
- self.optimize = int(self.optimize)
- if self.optimize not in (0, 1, 2):
- raise AssertionError
- except (ValueError, AssertionError):
- raise PackagingOptionError("optimize must be 0, 1, or 2")
-
- def run(self):
- # Make sure we have built everything we need first
- self.build()
-
- # Install everything: simply dump the entire contents of the build
- # directory to the installation directory (that's the beauty of
- # having a build directory!)
- outfiles = self.install()
-
- # (Optionally) compile .py to .pyc and/or .pyo
- if outfiles is not None and self.distribution.has_pure_modules():
- # XXX comment from distutils: "This [prefix stripping] is far from
- # complete, but it should at least generate usable bytecode in RPM
- # distributions." -> need to find exact requirements for
- # byte-compiled files and fix it
- install_root = self.get_finalized_command('install_dist').root
- self.byte_compile(outfiles, prefix=install_root)
-
- # -- Top-level worker functions ------------------------------------
- # (called from 'run()')
-
- def build(self):
- if not self.skip_build:
- if self.distribution.has_pure_modules():
- self.run_command('build_py')
- if self.distribution.has_ext_modules():
- self.run_command('build_ext')
-
- def install(self):
- if os.path.isdir(self.build_dir):
- outfiles = self.copy_tree(self.build_dir, self.install_dir)
- else:
- logger.warning(
- '%s: %r does not exist -- no Python modules to install',
- self.get_command_name(), self.build_dir)
- return
- return outfiles
-
- # -- Utility methods -----------------------------------------------
-
- def _mutate_outputs(self, has_any, build_cmd, cmd_option, output_dir):
- if not has_any:
- return []
-
- build_cmd = self.get_finalized_command(build_cmd)
- build_files = build_cmd.get_outputs()
- build_dir = getattr(build_cmd, cmd_option)
-
- prefix_len = len(build_dir) + len(os.sep)
- outputs = []
- for file in build_files:
- outputs.append(os.path.join(output_dir, file[prefix_len:]))
-
- return outputs
-
- def _bytecode_filenames(self, py_filenames):
- bytecode_files = []
- for py_file in py_filenames:
- # Since build_py handles package data installation, the
- # list of outputs can contain more than just .py files.
- # Make sure we only report bytecode for the .py files.
- ext = os.path.splitext(os.path.normcase(py_file))[1]
- if ext != PYTHON_SOURCE_EXTENSION:
- continue
- if self.compile:
- bytecode_files.append(imp.cache_from_source(py_file, True))
- if self.optimize:
- bytecode_files.append(imp.cache_from_source(py_file, False))
-
- return bytecode_files
-
- # -- External interface --------------------------------------------
- # (called by outsiders)
-
- def get_outputs(self):
- """Return the list of files that would be installed if this command
- were actually run. Not affected by the "dry-run" flag or whether
- modules have actually been built yet.
- """
- pure_outputs = \
- self._mutate_outputs(self.distribution.has_pure_modules(),
- 'build_py', 'build_lib',
- self.install_dir)
- if self.compile:
- bytecode_outputs = self._bytecode_filenames(pure_outputs)
- else:
- bytecode_outputs = []
-
- ext_outputs = \
- self._mutate_outputs(self.distribution.has_ext_modules(),
- 'build_ext', 'build_lib',
- self.install_dir)
-
- return pure_outputs + bytecode_outputs + ext_outputs
-
- def get_inputs(self):
- """Get the list of files that are input to this command, ie. the
- files that get installed as they are named in the build tree.
- The files in this list correspond one-to-one to the output
- filenames returned by 'get_outputs()'.
- """
- inputs = []
-
- if self.distribution.has_pure_modules():
- build_py = self.get_finalized_command('build_py')
- inputs.extend(build_py.get_outputs())
-
- if self.distribution.has_ext_modules():
- build_ext = self.get_finalized_command('build_ext')
- inputs.extend(build_ext.get_outputs())
-
- return inputs
diff --git a/Lib/packaging/command/install_scripts.py b/Lib/packaging/command/install_scripts.py
deleted file mode 100644
index cfacbe25fb..0000000000
--- a/Lib/packaging/command/install_scripts.py
+++ /dev/null
@@ -1,59 +0,0 @@
-"""Install scripts."""
-
-# Contributed by Bastian Kleineidam
-
-import os
-from packaging.command.cmd import Command
-from packaging import logger
-
-class install_scripts(Command):
-
- description = "install scripts (Python or otherwise)"
-
- user_options = [
- ('install-dir=', 'd', "directory to install scripts to"),
- ('build-dir=','b', "build directory (where to install from)"),
- ('force', 'f', "force installation (overwrite existing files)"),
- ('skip-build', None, "skip the build steps"),
- ]
-
- boolean_options = ['force', 'skip-build']
-
-
- def initialize_options(self):
- self.install_dir = None
- self.force = False
- self.build_dir = None
- self.skip_build = None
-
- def finalize_options(self):
- self.set_undefined_options('build', ('build_scripts', 'build_dir'))
- self.set_undefined_options('install_dist',
- ('install_scripts', 'install_dir'),
- 'force', 'skip_build')
-
- def run(self):
- if not self.skip_build:
- self.run_command('build_scripts')
-
- if not os.path.exists(self.build_dir):
- self.outfiles = []
- return
-
- self.outfiles = self.copy_tree(self.build_dir, self.install_dir)
- if os.name == 'posix':
- # Set the executable bits (owner, group, and world) on
- # all the scripts we just installed.
- for file in self.get_outputs():
- if self.dry_run:
- logger.info("changing mode of %s", file)
- else:
- mode = (os.stat(file).st_mode | 0o555) & 0o7777
- logger.info("changing mode of %s to %o", file, mode)
- os.chmod(file, mode)
-
- def get_inputs(self):
- return self.distribution.scripts or []
-
- def get_outputs(self):
- return self.outfiles or []
diff --git a/Lib/packaging/command/register.py b/Lib/packaging/command/register.py
deleted file mode 100644
index 59805f7d47..0000000000
--- a/Lib/packaging/command/register.py
+++ /dev/null
@@ -1,263 +0,0 @@
-"""Register a release with a project index."""
-
-# Contributed by Richard Jones
-
-import getpass
-import urllib.error
-import urllib.parse
-import urllib.request
-
-from packaging import logger
-from packaging.util import (read_pypirc, generate_pypirc, DEFAULT_REPOSITORY,
- DEFAULT_REALM, get_pypirc_path, encode_multipart)
-from packaging.command.cmd import Command
-
-class register(Command):
-
- description = "register a release with PyPI"
- user_options = [
- ('repository=', 'r',
- "repository URL [default: %s]" % DEFAULT_REPOSITORY),
- ('show-response', None,
- "display full response text from server"),
- ('list-classifiers', None,
- "list valid Trove classifiers"),
- ('strict', None ,
- "stop the registration if the metadata is not fully compliant")
- ]
-
- boolean_options = ['show-response', 'list-classifiers', 'strict']
-
- def initialize_options(self):
- self.repository = None
- self.realm = None
- self.show_response = False
- self.list_classifiers = False
- self.strict = False
-
- def finalize_options(self):
- if self.repository is None:
- self.repository = DEFAULT_REPOSITORY
- if self.realm is None:
- self.realm = DEFAULT_REALM
-
- def run(self):
- self._set_config()
-
- # Check the package metadata
- check = self.distribution.get_command_obj('check')
- if check.strict != self.strict and not check.all:
- # If check was already run but with different options,
- # re-run it
- check.strict = self.strict
- check.all = True
- self.distribution.have_run.pop('check', None)
- self.run_command('check')
-
- if self.dry_run:
- self.verify_metadata()
- elif self.list_classifiers:
- self.classifiers()
- else:
- self.send_metadata()
-
- def _set_config(self):
- ''' Reads the configuration file and set attributes.
- '''
- config = read_pypirc(self.repository, self.realm)
- if config != {}:
- self.username = config['username']
- self.password = config['password']
- self.repository = config['repository']
- self.realm = config['realm']
- self.has_config = True
- else:
- if self.repository not in ('pypi', DEFAULT_REPOSITORY):
- raise ValueError('%s not found in .pypirc' % self.repository)
- if self.repository == 'pypi':
- self.repository = DEFAULT_REPOSITORY
- self.has_config = False
-
- def classifiers(self):
- ''' Fetch the list of classifiers from the server.
- '''
- response = urllib.request.urlopen(self.repository+'?:action=list_classifiers')
- logger.info(response.read())
-
- def verify_metadata(self):
- ''' Send the metadata to the package index server to be checked.
- '''
- # send the info to the server and report the result
- code, result = self.post_to_server(self.build_post_data('verify'))
- logger.info('server response (%s): %s', code, result)
-
-
- def send_metadata(self):
- ''' Send the metadata to the package index server.
-
- Well, do the following:
- 1. figure who the user is, and then
- 2. send the data as a Basic auth'ed POST.
-
- First we try to read the username/password from $HOME/.pypirc,
- which is a ConfigParser-formatted file with a section
- [distutils] containing username and password entries (both
- in clear text). Eg:
-
- [distutils]
- index-servers =
- pypi
-
- [pypi]
- username: fred
- password: sekrit
-
- Otherwise, to figure who the user is, we offer the user three
- choices:
-
- 1. use existing login,
- 2. register as a new user, or
- 3. set the password to a random string and email the user.
-
- '''
- # TODO factor registration out into another method
- # TODO use print to print, not logging
-
- # see if we can short-cut and get the username/password from the
- # config
- if self.has_config:
- choice = '1'
- username = self.username
- password = self.password
- else:
- choice = 'x'
- username = password = ''
-
- # get the user's login info
- choices = '1 2 3 4'.split()
- while choice not in choices:
- logger.info('''\
-We need to know who you are, so please choose either:
- 1. use your existing login,
- 2. register as a new user,
- 3. have the server generate a new password for you (and email it to you), or
- 4. quit
-Your selection [default 1]: ''')
-
- choice = input()
- if not choice:
- choice = '1'
- elif choice not in choices:
- print('Please choose one of the four options!')
-
- if choice == '1':
- # get the username and password
- while not username:
- username = input('Username: ')
- while not password:
- password = getpass.getpass('Password: ')
-
- # set up the authentication
- auth = urllib.request.HTTPPasswordMgr()
- host = urllib.parse.urlparse(self.repository)[1]
- auth.add_password(self.realm, host, username, password)
- # send the info to the server and report the result
- code, result = self.post_to_server(self.build_post_data('submit'),
- auth)
- logger.info('Server response (%s): %s', code, result)
-
- # possibly save the login
- if code == 200:
- if self.has_config:
- # sharing the password in the distribution instance
- # so the upload command can reuse it
- self.distribution.password = password
- else:
- logger.info(
- 'I can store your PyPI login so future submissions '
- 'will be faster.\n(the login will be stored in %s)',
- get_pypirc_path())
- choice = 'X'
- while choice.lower() not in ('y', 'n'):
- choice = input('Save your login (y/N)?')
- if not choice:
- choice = 'n'
- if choice.lower() == 'y':
- generate_pypirc(username, password)
-
- elif choice == '2':
- data = {':action': 'user'}
- data['name'] = data['password'] = data['email'] = ''
- data['confirm'] = None
- while not data['name']:
- data['name'] = input('Username: ')
- while data['password'] != data['confirm']:
- while not data['password']:
- data['password'] = getpass.getpass('Password: ')
- while not data['confirm']:
- data['confirm'] = getpass.getpass(' Confirm: ')
- if data['password'] != data['confirm']:
- data['password'] = ''
- data['confirm'] = None
- print("Password and confirm don't match!")
- while not data['email']:
- data['email'] = input(' EMail: ')
- code, result = self.post_to_server(data)
- if code != 200:
- logger.info('server response (%s): %s', code, result)
- else:
- logger.info('you will receive an email shortly; follow the '
- 'instructions in it to complete registration.')
- elif choice == '3':
- data = {':action': 'password_reset'}
- data['email'] = ''
- while not data['email']:
- data['email'] = input('Your email address: ')
- code, result = self.post_to_server(data)
- logger.info('server response (%s): %s', code, result)
-
- def build_post_data(self, action):
- # figure the data to send - the metadata plus some additional
- # information used by the package server
- data = self.distribution.metadata.todict()
- data[':action'] = action
- return data
-
- # XXX to be refactored with upload.upload_file
- def post_to_server(self, data, auth=None):
- ''' Post a query to the server, and return a string response.
- '''
- if 'name' in data:
- logger.info('Registering %s to %s', data['name'], self.repository)
- # Build up the MIME payload for the urllib2 POST data
- content_type, body = encode_multipart(data.items(), [])
-
- # build the Request
- headers = {
- 'Content-type': content_type,
- 'Content-length': str(len(body))
- }
- req = urllib.request.Request(self.repository, body, headers)
-
- # handle HTTP and include the Basic Auth handler
- opener = urllib.request.build_opener(
- urllib.request.HTTPBasicAuthHandler(password_mgr=auth)
- )
- data = ''
- try:
- result = opener.open(req)
- except urllib.error.HTTPError as e:
- if self.show_response:
- data = e.fp.read()
- result = e.code, e.msg
- except urllib.error.URLError as e:
- result = 500, str(e)
- else:
- if self.show_response:
- data = result.read()
- result = 200, 'OK'
- if self.show_response:
- dashes = '-' * 75
- logger.info('%s%s%s', dashes, data, dashes)
-
- return result
diff --git a/Lib/packaging/command/sdist.py b/Lib/packaging/command/sdist.py
deleted file mode 100644
index d39998119f..0000000000
--- a/Lib/packaging/command/sdist.py
+++ /dev/null
@@ -1,347 +0,0 @@
-"""Create a source distribution."""
-
-import os
-import re
-import sys
-from io import StringIO
-from shutil import get_archive_formats, rmtree
-
-from packaging import logger
-from packaging.util import resolve_name
-from packaging.errors import (PackagingPlatformError, PackagingOptionError,
- PackagingModuleError, PackagingFileError)
-from packaging.command import get_command_names
-from packaging.command.cmd import Command
-from packaging.manifest import Manifest
-
-
-def show_formats():
- """Print all possible values for the 'formats' option (used by
- the "--help-formats" command-line option).
- """
- from packaging.fancy_getopt import FancyGetopt
- formats = sorted(('formats=' + name, None, desc)
- for name, desc in get_archive_formats())
- FancyGetopt(formats).print_help(
- "List of available source distribution formats:")
-
-# a \ followed by some spaces + EOL
-_COLLAPSE_PATTERN = re.compile('\\\w\n', re.M)
-_COMMENTED_LINE = re.compile('^#.*\n$|^\w*\n$', re.M)
-
-
-class sdist(Command):
-
- description = "create a source distribution (tarball, zip file, etc.)"
-
- user_options = [
- ('manifest=', 'm',
- "name of manifest file [default: MANIFEST]"),
- ('use-defaults', None,
- "include the default file set in the manifest "
- "[default; disable with --no-defaults]"),
- ('no-defaults', None,
- "don't include the default file set"),
- ('prune', None,
- "specifically exclude files/directories that should not be "
- "distributed (build tree, RCS/CVS dirs, etc.) "
- "[default; disable with --no-prune]"),
- ('no-prune', None,
- "don't automatically exclude anything"),
- ('manifest-only', 'o',
- "just regenerate the manifest and then stop "),
- ('formats=', None,
- "formats for source distribution (comma-separated list)"),
- ('keep-temp', 'k',
- "keep the distribution tree around after creating " +
- "archive file(s)"),
- ('dist-dir=', 'd',
- "directory to put the source distribution archive(s) in "
- "[default: dist]"),
- ('check-metadata', None,
- "Ensure that all required elements of metadata "
- "are supplied. Warn if any missing. [default]"),
- ('owner=', 'u',
- "Owner name used when creating a tar file [default: current user]"),
- ('group=', 'g',
- "Group name used when creating a tar file [default: current group]"),
- ('manifest-builders=', None,
- "manifest builders (comma-separated list)"),
- ]
-
- boolean_options = ['use-defaults', 'prune',
- 'manifest-only', 'keep-temp', 'check-metadata']
-
- help_options = [
- ('help-formats', None,
- "list available distribution formats", show_formats),
- ]
-
- negative_opt = {'no-defaults': 'use-defaults',
- 'no-prune': 'prune'}
-
- default_format = {'posix': 'gztar',
- 'nt': 'zip'}
-
- def initialize_options(self):
- self.manifest = None
- # 'use_defaults': if true, we will include the default file set
- # in the manifest
- self.use_defaults = True
- self.prune = True
- self.manifest_only = False
- self.formats = None
- self.keep_temp = False
- self.dist_dir = None
-
- self.archive_files = None
- self.metadata_check = True
- self.owner = None
- self.group = None
- self.filelist = None
- self.manifest_builders = None
-
- def _check_archive_formats(self, formats):
- supported_formats = [name for name, desc in get_archive_formats()]
- for format in formats:
- if format not in supported_formats:
- return format
- return None
-
- def finalize_options(self):
- if self.manifest is None:
- self.manifest = "MANIFEST"
-
- self.ensure_string_list('formats')
- if self.formats is None:
- try:
- self.formats = [self.default_format[os.name]]
- except KeyError:
- raise PackagingPlatformError("don't know how to create source "
- "distributions on platform %s" % os.name)
-
- bad_format = self._check_archive_formats(self.formats)
- if bad_format:
- raise PackagingOptionError("unknown archive format '%s'" \
- % bad_format)
-
- if self.dist_dir is None:
- self.dist_dir = "dist"
-
- if self.filelist is None:
- self.filelist = Manifest()
-
- if self.manifest_builders is None:
- self.manifest_builders = []
- else:
- if isinstance(self.manifest_builders, str):
- self.manifest_builders = self.manifest_builders.split(',')
- builders = []
- for builder in self.manifest_builders:
- builder = builder.strip()
- if builder == '':
- continue
- try:
- builder = resolve_name(builder)
- except ImportError as e:
- raise PackagingModuleError(e)
-
- builders.append(builder)
-
- self.manifest_builders = builders
-
- def run(self):
- # 'filelist' contains the list of files that will make up the
- # manifest
- self.filelist.clear()
-
- # Check the package metadata
- if self.metadata_check:
- self.run_command('check')
-
- # Do whatever it takes to get the list of files to process
- # (process the manifest template, read an existing manifest,
- # whatever). File list is accumulated in 'self.filelist'.
- self.get_file_list()
-
- # If user just wanted us to regenerate the manifest, stop now.
- if self.manifest_only:
- return
-
- # Otherwise, go ahead and create the source distribution tarball,
- # or zipfile, or whatever.
- self.make_distribution()
-
- def get_file_list(self):
- """Figure out the list of files to include in the source
- distribution, and put it in 'self.filelist'. This might involve
- reading the manifest template (and writing the manifest), or just
- reading the manifest, or just using the default file set -- it all
- depends on the user's options.
- """
- template_exists = len(self.distribution.extra_files) > 0
- if not template_exists:
- logger.warning('%s: using default file list',
- self.get_command_name())
- self.filelist.findall()
-
- if self.use_defaults:
- self.add_defaults()
- if template_exists:
- template = '\n'.join(self.distribution.extra_files)
- self.filelist.read_template(StringIO(template))
-
- # call manifest builders, if any.
- for builder in self.manifest_builders:
- builder(self.distribution, self.filelist)
-
- if self.prune:
- self.prune_file_list()
-
- self.filelist.write(self.manifest)
-
- def add_defaults(self):
- """Add all default files to self.filelist.
-
- In addition to the setup.cfg file, this will include all files returned
- by the get_source_files of every registered command. This will find
- Python modules and packages, data files listed in package_data_,
- data_files and extra_files, scripts, C sources of extension modules or
- C libraries (headers are missing).
- """
- if os.path.exists('setup.cfg'):
- self.filelist.append('setup.cfg')
- else:
- logger.warning("%s: standard 'setup.cfg' file not found",
- self.get_command_name())
-
- for cmd_name in get_command_names():
- try:
- cmd_obj = self.get_finalized_command(cmd_name)
- except PackagingOptionError:
- pass
- else:
- self.filelist.extend(cmd_obj.get_source_files())
-
- def prune_file_list(self):
- """Prune off branches that might slip into the file list as created
- by 'read_template()', but really don't belong there:
- * the build tree (typically "build")
- * the release tree itself (only an issue if we ran "sdist"
- previously with --keep-temp, or it aborted)
- * any RCS, CVS, .svn, .hg, .git, .bzr, _darcs directories
- """
- build = self.get_finalized_command('build')
- base_dir = self.distribution.get_fullname()
-
- self.filelist.exclude_pattern(None, prefix=build.build_base)
- self.filelist.exclude_pattern(None, prefix=base_dir)
-
- # pruning out vcs directories
- # both separators are used under win32
- if sys.platform == 'win32':
- seps = r'/|\\'
- else:
- seps = '/'
-
- vcs_dirs = ['RCS', 'CVS', r'\.svn', r'\.hg', r'\.git', r'\.bzr',
- '_darcs']
- vcs_ptrn = r'(^|%s)(%s)(%s).*' % (seps, '|'.join(vcs_dirs), seps)
- self.filelist.exclude_pattern(vcs_ptrn, is_regex=True)
-
- def make_release_tree(self, base_dir, files):
- """Create the directory tree that will become the source
- distribution archive. All directories implied by the filenames in
- 'files' are created under 'base_dir', and then we hard link or copy
- (if hard linking is unavailable) those files into place.
- Essentially, this duplicates the developer's source tree, but in a
- directory named after the distribution, containing only the files
- to be distributed.
- """
- # Create all the directories under 'base_dir' necessary to
- # put 'files' there; the 'mkpath()' is just so we don't die
- # if the manifest happens to be empty.
- self.mkpath(base_dir)
- self.create_tree(base_dir, files, dry_run=self.dry_run)
-
- # And walk over the list of files, either making a hard link (if
- # os.link exists) to each one that doesn't already exist in its
- # corresponding location under 'base_dir', or copying each file
- # that's out-of-date in 'base_dir'. (Usually, all files will be
- # out-of-date, because by default we blow away 'base_dir' when
- # we're done making the distribution archives.)
-
- if hasattr(os, 'link'): # can make hard links on this system
- link = 'hard'
- msg = "making hard links in %s..." % base_dir
- else: # nope, have to copy
- link = None
- msg = "copying files to %s..." % base_dir
-
- if not files:
- logger.warning("no files to distribute -- empty manifest?")
- else:
- logger.info(msg)
-
- for file in self.distribution.metadata.requires_files:
- if file not in files:
- msg = "'%s' must be included explicitly in 'extra_files'" \
- % file
- raise PackagingFileError(msg)
-
- for file in files:
- if not os.path.isfile(file):
- logger.warning("'%s' not a regular file -- skipping", file)
- else:
- dest = os.path.join(base_dir, file)
- self.copy_file(file, dest, link=link)
-
- self.distribution.metadata.write(os.path.join(base_dir, 'PKG-INFO'))
-
- def make_distribution(self):
- """Create the source distribution(s). First, we create the release
- tree with 'make_release_tree()'; then, we create all required
- archive files (according to 'self.formats') from the release tree.
- Finally, we clean up by blowing away the release tree (unless
- 'self.keep_temp' is true). The list of archive files created is
- stored so it can be retrieved later by 'get_archive_files()'.
- """
- # Don't warn about missing metadata here -- should be (and is!)
- # done elsewhere.
- base_dir = self.distribution.get_fullname()
- base_name = os.path.join(self.dist_dir, base_dir)
-
- self.make_release_tree(base_dir, self.filelist.files)
- archive_files = [] # remember names of files we create
- # tar archive must be created last to avoid overwrite and remove
- if 'tar' in self.formats:
- self.formats.append(self.formats.pop(self.formats.index('tar')))
-
- for fmt in self.formats:
- file = self.make_archive(base_name, fmt, base_dir=base_dir,
- owner=self.owner, group=self.group)
- archive_files.append(file)
- self.distribution.dist_files.append(('sdist', '', file))
-
- self.archive_files = archive_files
-
- if not self.keep_temp:
- if self.dry_run:
- logger.info('removing %s', base_dir)
- else:
- rmtree(base_dir)
-
- def get_archive_files(self):
- """Return the list of archive files created when the command
- was run, or None if the command hasn't run yet.
- """
- return self.archive_files
-
- def create_tree(self, base_dir, files, mode=0o777, dry_run=False):
- need_dir = set()
- for file in files:
- need_dir.add(os.path.join(base_dir, os.path.dirname(file)))
-
- # Now create them
- for dir in sorted(need_dir):
- self.mkpath(dir, mode, dry_run=dry_run)
diff --git a/Lib/packaging/command/test.py b/Lib/packaging/command/test.py
deleted file mode 100644
index 4d5348f0c1..0000000000
--- a/Lib/packaging/command/test.py
+++ /dev/null
@@ -1,80 +0,0 @@
-"""Run the project's test suite."""
-
-import os
-import sys
-import logging
-import unittest
-
-from packaging import logger
-from packaging.command.cmd import Command
-from packaging.database import get_distribution
-from packaging.errors import PackagingOptionError
-from packaging.util import resolve_name
-
-
-class test(Command):
-
- description = "run the project's test suite"
-
- user_options = [
- ('suite=', 's',
- "test suite to run (for example: 'some_module.test_suite')"),
- ('runner=', None,
- "test runner to be called."),
- ('tests-require=', None,
- "list of distributions required to run the test suite."),
- ]
-
- def initialize_options(self):
- self.suite = None
- self.runner = None
- self.tests_require = []
-
- def finalize_options(self):
- self.build_lib = self.get_finalized_command("build").build_lib
- for requirement in self.tests_require:
- if get_distribution(requirement) is None:
- logger.warning("test dependency %s is not installed, "
- "tests may fail", requirement)
- if (not self.suite and not self.runner and
- self.get_ut_with_discovery() is None):
- raise PackagingOptionError(
- "no test discovery available, please give a 'suite' or "
- "'runner' option or install unittest2")
-
- def get_ut_with_discovery(self):
- if hasattr(unittest.TestLoader, "discover"):
- return unittest
- else:
- try:
- import unittest2
- return unittest2
- except ImportError:
- return None
-
- def run(self):
- prev_syspath = sys.path[:]
- try:
- # build release
- build = self.reinitialize_command('build')
- self.run_command('build')
- sys.path.insert(0, build.build_lib)
-
- # XXX maybe we could pass the verbose argument of pysetup here
- logger = logging.getLogger('packaging')
- verbose = logger.getEffectiveLevel() >= logging.DEBUG
- verbosity = verbose + 1
-
- # run the tests
- if self.runner:
- resolve_name(self.runner)()
- elif self.suite:
- runner = unittest.TextTestRunner(verbosity=verbosity)
- runner.run(resolve_name(self.suite)())
- elif self.get_ut_with_discovery():
- ut = self.get_ut_with_discovery()
- test_suite = ut.TestLoader().discover(os.curdir)
- runner = ut.TextTestRunner(verbosity=verbosity)
- runner.run(test_suite)
- finally:
- sys.path[:] = prev_syspath
diff --git a/Lib/packaging/command/upload.py b/Lib/packaging/command/upload.py
deleted file mode 100644
index f56d2c69fe..0000000000
--- a/Lib/packaging/command/upload.py
+++ /dev/null
@@ -1,168 +0,0 @@
-"""Upload a distribution to a project index."""
-
-import os
-import socket
-import logging
-import platform
-import urllib.parse
-from base64 import standard_b64encode
-from hashlib import md5
-from urllib.error import HTTPError
-from urllib.request import urlopen, Request
-
-from packaging import logger
-from packaging.errors import PackagingOptionError
-from packaging.util import (spawn, read_pypirc, DEFAULT_REPOSITORY,
- DEFAULT_REALM, encode_multipart)
-from packaging.command.cmd import Command
-
-
-class upload(Command):
-
- description = "upload distribution to PyPI"
-
- user_options = [
- ('repository=', 'r',
- "repository URL [default: %s]" % DEFAULT_REPOSITORY),
- ('show-response', None,
- "display full response text from server"),
- ('sign', 's',
- "sign files to upload using gpg"),
- ('identity=', 'i',
- "GPG identity used to sign files"),
- ('upload-docs', None,
- "upload documentation too"),
- ]
-
- boolean_options = ['show-response', 'sign']
-
- def initialize_options(self):
- self.repository = None
- self.realm = None
- self.show_response = False
- self.username = ''
- self.password = ''
- self.show_response = False
- self.sign = False
- self.identity = None
- self.upload_docs = False
-
- def finalize_options(self):
- if self.repository is None:
- self.repository = DEFAULT_REPOSITORY
- if self.realm is None:
- self.realm = DEFAULT_REALM
- if self.identity and not self.sign:
- raise PackagingOptionError(
- "Must use --sign for --identity to have meaning")
- config = read_pypirc(self.repository, self.realm)
- if config != {}:
- self.username = config['username']
- self.password = config['password']
- self.repository = config['repository']
- self.realm = config['realm']
-
- # getting the password from the distribution
- # if previously set by the register command
- if not self.password and self.distribution.password:
- self.password = self.distribution.password
-
- def run(self):
- if not self.distribution.dist_files:
- raise PackagingOptionError(
- "No dist file created in earlier command")
- for command, pyversion, filename in self.distribution.dist_files:
- self.upload_file(command, pyversion, filename)
- if self.upload_docs:
- upload_docs = self.get_finalized_command("upload_docs")
- upload_docs.repository = self.repository
- upload_docs.username = self.username
- upload_docs.password = self.password
- upload_docs.run()
-
- # XXX to be refactored with register.post_to_server
- def upload_file(self, command, pyversion, filename):
- # Makes sure the repository URL is compliant
- scheme, netloc, url, params, query, fragments = \
- urllib.parse.urlparse(self.repository)
- if params or query or fragments:
- raise AssertionError("Incompatible url %s" % self.repository)
-
- if scheme not in ('http', 'https'):
- raise AssertionError("unsupported scheme " + scheme)
-
- # Sign if requested
- if self.sign:
- gpg_args = ["gpg", "--detach-sign", "-a", filename]
- if self.identity:
- gpg_args[2:2] = ["--local-user", self.identity]
- spawn(gpg_args,
- dry_run=self.dry_run)
-
- # Fill in the data - send all the metadata in case we need to
- # register a new release
- with open(filename, 'rb') as f:
- content = f.read()
-
- data = self.distribution.metadata.todict()
-
- # extra upload infos
- data[':action'] = 'file_upload'
- data['protcol_version'] = '1'
- data['content'] = (os.path.basename(filename), content)
- data['filetype'] = command
- data['pyversion'] = pyversion
- data['md5_digest'] = md5(content).hexdigest()
-
- if command == 'bdist_dumb':
- data['comment'] = 'built for %s' % platform.platform(terse=True)
-
- if self.sign:
- with open(filename + '.asc') as fp:
- sig = fp.read()
- data['gpg_signature'] = [
- (os.path.basename(filename) + ".asc", sig)]
-
- # set up the authentication
- # The exact encoding of the authentication string is debated.
- # Anyway PyPI only accepts ascii for both username or password.
- user_pass = (self.username + ":" + self.password).encode('ascii')
- auth = b"Basic " + standard_b64encode(user_pass)
-
- # Build up the MIME payload for the POST data
- files = []
- for key in ('content', 'gpg_signature'):
- if key in data:
- filename_, value = data.pop(key)
- files.append((key, filename_, value))
-
- content_type, body = encode_multipart(data.items(), files)
-
- logger.info("Submitting %s to %s", filename, self.repository)
-
- # build the Request
- headers = {'Content-type': content_type,
- 'Content-length': str(len(body)),
- 'Authorization': auth}
-
- request = Request(self.repository, body, headers)
- # send the data
- try:
- result = urlopen(request)
- status = result.code
- reason = result.msg
- except socket.error as e:
- logger.error(e)
- return
- except HTTPError as e:
- status = e.code
- reason = e.msg
-
- if status == 200:
- logger.info('Server response (%s): %s', status, reason)
- else:
- logger.error('Upload failed (%s): %s', status, reason)
-
- if self.show_response and logger.isEnabledFor(logging.INFO):
- sep = '-' * 75
- logger.info('%s\n%s\n%s', sep, result.read().decode(), sep)
diff --git a/Lib/packaging/command/upload_docs.py b/Lib/packaging/command/upload_docs.py
deleted file mode 100644
index 30e37b52c9..0000000000
--- a/Lib/packaging/command/upload_docs.py
+++ /dev/null
@@ -1,131 +0,0 @@
-"""Upload HTML documentation to a project index."""
-
-import os
-import base64
-import socket
-import zipfile
-import logging
-import http.client
-import urllib.parse
-from io import BytesIO
-
-from packaging import logger
-from packaging.util import (read_pypirc, DEFAULT_REPOSITORY, DEFAULT_REALM,
- encode_multipart)
-from packaging.errors import PackagingFileError
-from packaging.command.cmd import Command
-
-
-def zip_dir(directory):
- """Compresses recursively contents of directory into a BytesIO object"""
- destination = BytesIO()
- with zipfile.ZipFile(destination, "w") as zip_file:
- for root, dirs, files in os.walk(directory):
- for name in files:
- full = os.path.join(root, name)
- relative = root[len(directory):].lstrip(os.path.sep)
- dest = os.path.join(relative, name)
- zip_file.write(full, dest)
- return destination
-
-
-class upload_docs(Command):
-
- description = "upload HTML documentation to PyPI"
-
- user_options = [
- ('repository=', 'r',
- "repository URL [default: %s]" % DEFAULT_REPOSITORY),
- ('show-response', None,
- "display full response text from server"),
- ('upload-dir=', None,
- "directory to upload"),
- ]
-
- def initialize_options(self):
- self.repository = None
- self.realm = None
- self.show_response = False
- self.upload_dir = None
- self.username = ''
- self.password = ''
-
- def finalize_options(self):
- if self.repository is None:
- self.repository = DEFAULT_REPOSITORY
- if self.realm is None:
- self.realm = DEFAULT_REALM
- if self.upload_dir is None:
- build = self.get_finalized_command('build')
- self.upload_dir = os.path.join(build.build_base, "docs")
- if not os.path.isdir(self.upload_dir):
- self.upload_dir = os.path.join(build.build_base, "doc")
- logger.info('Using upload directory %s', self.upload_dir)
- self.verify_upload_dir(self.upload_dir)
- config = read_pypirc(self.repository, self.realm)
- if config != {}:
- self.username = config['username']
- self.password = config['password']
- self.repository = config['repository']
- self.realm = config['realm']
-
- def verify_upload_dir(self, upload_dir):
- self.ensure_dirname('upload_dir')
- index_location = os.path.join(upload_dir, "index.html")
- if not os.path.exists(index_location):
- mesg = "No 'index.html found in docs directory (%s)"
- raise PackagingFileError(mesg % upload_dir)
-
- def run(self):
- name = self.distribution.metadata['Name']
- version = self.distribution.metadata['Version']
- zip_file = zip_dir(self.upload_dir)
-
- fields = [(':action', 'doc_upload'),
- ('name', name), ('version', version)]
- files = [('content', name, zip_file.getvalue())]
- content_type, body = encode_multipart(fields, files)
-
- credentials = self.username + ':' + self.password
- # FIXME should use explicit encoding
- auth = b"Basic " + base64.encodebytes(credentials.encode()).strip()
-
- logger.info("Submitting documentation to %s", self.repository)
-
- scheme, netloc, url, params, query, fragments = urllib.parse.urlparse(
- self.repository)
- if scheme == "http":
- conn = http.client.HTTPConnection(netloc)
- elif scheme == "https":
- conn = http.client.HTTPSConnection(netloc)
- else:
- raise AssertionError("unsupported scheme %r" % scheme)
-
- try:
- conn.connect()
- conn.putrequest("POST", url)
- conn.putheader('Content-type', content_type)
- conn.putheader('Content-length', str(len(body)))
- conn.putheader('Authorization', auth)
- conn.endheaders()
- conn.send(body)
-
- except socket.error as e:
- logger.error(e)
- return
-
- r = conn.getresponse()
-
- if r.status == 200:
- logger.info('Server response (%s): %s', r.status, r.reason)
- elif r.status == 301:
- location = r.getheader('Location')
- if location is None:
- location = 'http://packages.python.org/%s/' % name
- logger.info('Upload successful. Visit %s', location)
- else:
- logger.error('Upload failed (%s): %s', r.status, r.reason)
-
- if self.show_response and logger.isEnabledFor(logging.INFO):
- sep = '-' * 75
- logger.info('%s\n%s\n%s', sep, r.read().decode('utf-8'), sep)
diff --git a/Lib/packaging/command/wininst-10.0-amd64.exe b/Lib/packaging/command/wininst-10.0-amd64.exe
deleted file mode 100644
index 11f98cd2adf1075b7ff7be7f02ebc8e743bb6b9e..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 222208
zcmeFadw5e-zWALs4GqwmB1Ed91gVM^wOSmD1&smAn`IHwx-pF
zZIn6VT+W%BGyZ10jH8}8Ggufe4Mo~=zlflCDWc;JL9M7zP~7k5yLQqRbv$#P^Lzhz
zpXcSF`?Buqdtcx6-7D4KU*>Q+9F9ExEX(0&<}UyI>iXYYavY9hhOa!v@z?$vMl|Py
zH;kA%@1{k*1q*MxapASM_-e1c_14=WzUyxAEsWmkyXjV6VDc2-Ew^2N!`X#}14=SY
z|1N*@bMMccuqXR>`=~eeyvzI2qST(Gy1%*SBkuc7PVV_Y-Cx=Bp1N<@vzPn(b0_Wz
za9>(v?wP0VJ5~PDqIcB&ikoWZN!$NyCN)8asORkw?eA;ZDb+
z^3dXRbPeYIsME3RL`gXMU&{@-j$ub9efQg(T!-KF&x@QLx#7+T+2J6gmI2A!g(&*`
z^En)I&R%%^wUKKbj#*pCpiReC?w4}!^Uv>a_|LYBIT~h>;Rhzg+=mIJ_5SlS%d;2Q
z1=SpxtD4l9ZQXOTB<6Tw2(i9mzr;u>uvr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