.coverage
.eggs
.tox
+.venv
*.egg
*.py[cod]
*.swp
--- /dev/null
+python:
+ version: 3
+ requirements_file: docs/requirements.txt
+ pip_install: false
+v40.3.0
+-------
+
+* #1402: Fixed a bug with namespace packages under Python 3.6 when one package in
+ current directory hides another which is installed.
+* #1427: Set timestamp of ``.egg-info`` directory whenever ``egg_info`` command is run.
+* #1474: ``build_meta.get_requires_for_build_sdist`` now does not include the ``wheel`` package anymore.
+* #1486: Suppress warnings in pkg_resources.handle_ns.
+* #1479: Remove internal use of six.binary_type.
+
+
v40.2.0
-------
* #1466: Fix handling of Unicode arguments in PEP 517 backend
-vv40.1.1
+v40.1.1
--------
* #1465: Fix regression with `egg_info` command when tagging is used.
gracefully under Google App Engine (with an ``ImportError`` loading the
C-based module, instead of getting a ``NameError``).
+ * Fixed ``win32.exe`` support for .pth files, so unnecessary directory nesting
+ is flattened out in the resulting egg. (There was a case-sensitivity
+ problem that affected some distributions, notably ``pywin32``.)
+
+ * Prevent ``--help-commands`` and other junk from showing under Python 2.5
+ when running ``easy_install --help``.
+
+ * Fixed GUI scripts sometimes not executing on Windows
+
+ * Fixed not picking up dependency links from recursive dependencies.
+
+ * Only make ``.py``, ``.dll`` and ``.so`` files executable when unpacking eggs
+
+ * Changes for Jython compatibility
+
+ * Improved error message when a requirement is also a directory name, but the
+ specified directory is not a source package.
+
+ * Fixed ``--allow-hosts`` option blocking ``file:`` URLs
+
+ * Fixed HTTP SVN detection failing when the page title included a project
+ name (e.g. on SourceForge-hosted SVN)
+
+ * Fix Jython script installation to handle ``#!`` lines better when
+ ``sys.executable`` is a script.
+
+ * Removed use of deprecated ``md5`` module if ``hashlib`` is available
+
+ * Keep site directories (e.g. ``site-packages``) from being included in
+ ``.pth`` files.
+
0.6c7
-----
``--root`` or ``--single-version-externally-managed``, due to the
parent package not having the child package as an attribute.
+ * ``ftp:`` download URLs now work correctly.
+
+ * The default ``--index-url`` is now ``https://pypi.python.org/simple``, to use
+ the Python Package Index's new simpler (and faster!) REST API.
+
0.6c6
-----
* Fix ``find_packages()`` treating ``ez_setup`` and directories with ``.`` in
their names as packages.
+ * EasyInstall no longer aborts the installation process if a URL it wants to
+ retrieve can't be downloaded, unless the URL is an actual package download.
+ Instead, it issues a warning and tries to keep going.
+
+ * Fixed distutils-style scripts originally built on Windows having their line
+ endings doubled when installed on any platform.
+
+ * Added ``--local-snapshots-ok`` flag, to allow building eggs from projects
+ installed using ``setup.py develop``.
+
+ * Fixed not HTML-decoding URLs scraped from web pages
+
0.6c5
-----
* Fix uploaded ``bdist_wininst`` packages being described as suitable for
"any" version by Python 2.5, even if a ``--target-version`` was specified.
+ * Fixed ``.dll`` files on Cygwin not having executable permissions when an egg
+ is installed unzipped.
+
0.6c4
-----
listed a namespace package ``foo.bar`` without explicitly listing ``foo``
as a namespace package.
+ * Added support for HTTP "Basic" authentication using ``http://user:pass@host``
+ URLs. If a password-protected page contains links to the same host (and
+ protocol), those links will inherit the credentials used to access the
+ original page.
+
+ * Removed all special support for Sourceforge mirrors, as Sourceforge's
+ mirror system now works well for non-browser downloads.
+
+ * Fixed not recognizing ``win32.exe`` installers that included a custom
+ bitmap.
+
+ * Fixed not allowing ``os.open()`` of paths outside the sandbox, even if they
+ are opened read-only (e.g. reading ``/dev/urandom`` for random numbers, as
+ is done by ``os.urandom()`` on some platforms).
+
+ * Fixed a problem with ``.pth`` testing on Windows when ``sys.executable``
+ has a space in it (e.g., the user installed Python to a ``Program Files``
+ directory).
+
0.6c3
-----
* Fixed breakages caused by Subversion 1.4's new "working copy" format
+ * You can once again use "python -m easy_install" with Python 2.4 and above.
+
+ * Python 2.5 compatibility fixes added.
+
0.6c2
-----
* Running ``setup.py develop`` on a setuptools-using project will now install
setuptools if needed, instead of only downloading the egg.
+ * Windows script wrappers now support quoted arguments and arguments
+ containing spaces. (Patch contributed by Jim Fulton.)
+
+ * The ``ez_setup.py`` script now actually works when you put a setuptools
+ ``.egg`` alongside it for bootstrapping an offline machine.
+
+ * A writable installation directory on ``sys.path`` is no longer required to
+ download and extract a source distribution using ``--editable``.
+
+ * Generated scripts now use ``-x`` on the ``#!`` line when ``sys.executable``
+ contains non-ASCII characters, to prevent deprecation warnings about an
+ unspecified encoding when the script is run.
+
0.6c1
-----
the version was overridden on the command line that built the source
distribution.)
+ * EasyInstall now includes setuptools version information in the
+ ``User-Agent`` string sent to websites it visits.
+
0.6b4
-----
* Fixed redundant warnings about missing ``README`` file(s); it should now
appear only if you are actually a source distribution.
+ * Fix creating Python wrappers for non-Python scripts
+
+ * Fix ``ftp://`` directory listing URLs from causing a crash when used in the
+ "Home page" or "Download URL" slots on PyPI.
+
+ * Fix ``sys.path_importer_cache`` not being updated when an existing zipfile
+ or directory is deleted/overwritten.
+
+ * Fix not recognizing HTML 404 pages from package indexes.
+
+ * Allow ``file://`` URLs to be used as a package index. URLs that refer to
+ directories will use an internally-generated directory listing if there is
+ no ``index.html`` file in the directory.
+
+ * Allow external links in a package index to be specified using
+ ``rel="homepage"`` or ``rel="download"``, without needing the old
+ PyPI-specific visible markup.
+
+ * Suppressed warning message about possibly-misspelled project name, if an egg
+ or link for that project name has already been seen.
+
0.6b3
-----
``include_package_data`` and ``package_data`` are used to refer to the same
files.
+ * Fix local ``--find-links`` eggs not being copied except with
+ ``--always-copy``.
+
+ * Fix sometimes not detecting local packages installed outside of "site"
+ directories.
+
+ * Fix mysterious errors during initial ``setuptools`` install, caused by
+ ``ez_setup`` trying to run ``easy_install`` twice, due to a code fallthru
+ after deleting the egg from which it's running.
+
+0.6b2
+-----
+
+ * Don't install or update a ``site.py`` patch when installing to a
+ ``PYTHONPATH`` directory with ``--multi-version``, unless an
+ ``easy-install.pth`` file is already in use there.
+
+ * Construct ``.pth`` file paths in such a way that installing an egg whose
+ name begins with ``import`` doesn't cause a syntax error.
+
+ * Fixed a bogus warning message that wasn't updated since the 0.5 versions.
+
0.6b1
-----
the name of a ``.py`` loader/wrapper. (Python's import machinery ignores
this suffix when searching for an extension module.)
+ * Better ambiguity management: accept ``#egg`` name/version even if processing
+ what appears to be a correctly-named distutils file, and ignore ``.egg``
+ files with no ``-``, since valid Python ``.egg`` files always have a version
+ number (but Scheme eggs often don't).
+
+ * Support ``file://`` links to directories in ``--find-links``, so that
+ easy_install can build packages from local source checkouts.
+
+ * Added automatic retry for Sourceforge mirrors. The new download process is
+ to first just try dl.sourceforge.net, then randomly select mirror IPs and
+ remove ones that fail, until something works. The removed IPs stay removed
+ for the remainder of the run.
+
+ * Ignore bdist_dumb distributions when looking at download URLs.
+
0.6a11
------
it. Previously, the file could be left open and the actual error would be
masked by problems trying to remove the open file on Windows systems.
+ * Process ``dependency_links.txt`` if found in a distribution, by adding the
+ URLs to the list for scanning.
+
+ * Use relative paths in ``.pth`` files when eggs are being installed to the
+ same directory as the ``.pth`` file. This maximizes portability of the
+ target directory when building applications that contain eggs.
+
+ * Added ``easy_install-N.N`` script(s) for convenience when using multiple
+ Python versions.
+
+ * Added automatic handling of installation conflicts. Eggs are now shifted to
+ the front of sys.path, in an order consistent with where they came from,
+ making EasyInstall seamlessly co-operate with system package managers.
+
+ The ``--delete-conflicting`` and ``--ignore-conflicts-at-my-risk`` options
+ are now no longer necessary, and will generate warnings at the end of a
+ run if you use them.
+
+ * Don't recursively traverse subdirectories given to ``--find-links``.
+
0.6a10
------
* Fixed the ``develop`` command ignoring ``--find-links``.
+ * Added exhaustive testing of the install directory, including a spawn test
+ for ``.pth`` file support, and directory writability/existence checks. This
+ should virtually eliminate the need to set or configure ``--site-dirs``.
+
+ * Added ``--prefix`` option for more do-what-I-mean-ishness in the absence of
+ RTFM-ing. :)
+
+ * Enhanced ``PYTHONPATH`` support so that you don't have to put any eggs on it
+ manually to make it work. ``--multi-version`` is no longer a silent
+ default; you must explicitly use it if installing to a non-PYTHONPATH,
+ non-"site" directory.
+
+ * Expand ``$variables`` used in the ``--site-dirs``, ``--build-directory``,
+ ``--install-dir``, and ``--script-dir`` options, whether on the command line
+ or in configuration files.
+
+ * Improved SourceForge mirror processing to work faster and be less affected
+ by transient HTML changes made by SourceForge.
+
+ * PyPI searches now use the exact spelling of requirements specified on the
+ command line or in a project's ``install_requires``. Previously, a
+ normalized form of the name was used, which could lead to unnecessary
+ full-index searches when a project's name had an underscore (``_``) in it.
+
+ * EasyInstall can now download bare ``.py`` files and wrap them in an egg,
+ as long as you include an ``#egg=name-version`` suffix on the URL, or if
+ the ``.py`` file is listed as the "Download URL" on the project's PyPI page.
+ This allows third parties to "package" trivial Python modules just by
+ linking to them (e.g. from within their own PyPI page or download links
+ page).
+
+ * The ``--always-copy`` option now skips "system" and "development" eggs since
+ they can't be reliably copied. Note that this may cause EasyInstall to
+ choose an older version of a package than what you expected, or it may cause
+ downloading and installation of a fresh version of what's already installed.
+
+ * The ``--find-links`` option previously scanned all supplied URLs and
+ directories as early as possible, but now only directories and direct
+ archive links are scanned immediately. URLs are not retrieved unless a
+ package search was already going to go online due to a package not being
+ available locally, or due to the use of the ``--update`` or ``-U`` option.
+
+ * Fixed the annoying ``--help-commands`` wart.
+
0.6a9
-----
and entry-point wrapper scripts), and ``easy_install`` can turn the .exe
back into an ``.egg`` file or directory and install it as such.
+ * Fixed ``.pth`` file processing picking up nested eggs (i.e. ones inside
+ "baskets") when they weren't explicitly listed in the ``.pth`` file.
+
+ * If more than one URL appears to describe the exact same distribution, prefer
+ the shortest one. This helps to avoid "table of contents" CGI URLs like the
+ ones on effbot.org.
+
+ * Quote arguments to python.exe (including python's path) to avoid problems
+ when Python (or a script) is installed in a directory whose name contains
+ spaces on Windows.
+
+ * Support full roundtrip translation of eggs to and from ``bdist_wininst``
+ format. Running ``bdist_wininst`` on a setuptools-based package wraps the
+ egg in an .exe that will safely install it as an egg (i.e., with metadata
+ and entry-point wrapper scripts), and ``easy_install`` can turn the .exe
+ back into an ``.egg`` file or directory and install it as such.
0.6a8
-----
metadata cache to pretend that the egg has valid version information, until
it has a chance to make it actually be so (via the ``egg_info`` command).
+ * Update for changed SourceForge mirror format
+
+ * Fixed not installing dependencies for some packages fetched via Subversion
+
+ * Fixed dependency installation with ``--always-copy`` not using the same
+ dependency resolution procedure as other operations.
+
+ * Fixed not fully removing temporary directories on Windows, if a Subversion
+ checkout left read-only files behind
+
+ * Fixed some problems building extensions when Pyrex was installed, especially
+ with Python 2.4 and/or packages using SWIG.
+
+0.6a7
+-----
+
+ * Fixed not being able to install Windows script wrappers using Python 2.3
+
+0.6a6
+-----
+
+ * Added support for "traditional" PYTHONPATH-based non-root installation, and
+ also the convenient ``virtual-python.py`` script, based on a contribution
+ by Ian Bicking. The setuptools egg now contains a hacked ``site`` module
+ that makes the PYTHONPATH-based approach work with .pth files, so that you
+ can get the full EasyInstall feature set on such installations.
+
+ * Added ``--no-deps`` and ``--allow-hosts`` options.
+
+ * Improved Windows ``.exe`` script wrappers so that the script can have the
+ same name as a module without confusing Python.
+
+ * Changed dependency processing so that it's breadth-first, allowing a
+ depender's preferences to override those of a dependee, to prevent conflicts
+ when a lower version is acceptable to the dependee, but not the depender.
+ Also, ensure that currently installed/selected packages aren't given
+ precedence over ones desired by a package being installed, which could
+ cause conflict errors.
+
0.6a5
-----
on Windows and other platforms. (The special handling is only for Windows;
other platforms are treated the same as for ``console_scripts``.)
+ * Improved error message when trying to use old ways of running
+ ``easy_install``. Removed the ability to run via ``python -m`` or by
+ running ``easy_install.py``; ``easy_install`` is the command to run on all
+ supported platforms.
+
+ * Improved wrapper script generation and runtime initialization so that a
+ VersionConflict doesn't occur if you later install a competing version of a
+ needed package as the default version of that package.
+
+ * Fixed a problem parsing version numbers in ``#egg=`` links.
+
0.6a2
-----
scripts get an ``.exe`` wrapper so you can just type their name. On other
platforms, the scripts are written without a file extension.
+ * EasyInstall can now install "console_scripts" defined by packages that use
+ ``setuptools`` and define appropriate entry points. On Windows, console
+ scripts get an ``.exe`` wrapper so you can just type their name. On other
+ platforms, the scripts are installed without a file extension.
+
+ * Using ``python -m easy_install`` or running ``easy_install.py`` is now
+ DEPRECATED, since an ``easy_install`` wrapper is now available on all
+ platforms.
+
0.6a1
-----
or documented, and never would have worked without EasyInstall - which it
pre-dated and was never compatible with.
+ * EasyInstall now does MD5 validation of downloads from PyPI, or from any link
+ that has an "#md5=..." trailer with a 32-digit lowercase hex md5 digest.
+
+ * EasyInstall now handles symlinks in target directories by removing the link,
+ rather than attempting to overwrite the link's destination. This makes it
+ easier to set up an alternate Python "home" directory (as described in
+ the Non-Root Installation section of the docs).
+
+ * Added support for handling MacOS platform information in ``.egg`` filenames,
+ based on a contribution by Kevin Dangoor. You may wish to delete and
+ reinstall any eggs whose filename includes "darwin" and "Power_Macintosh",
+ because the format for this platform information has changed so that minor
+ OS X upgrades (such as 10.4.1 to 10.4.2) do not cause eggs built with a
+ previous OS version to become obsolete.
+
+ * easy_install's dependency processing algorithms have changed. When using
+ ``--always-copy``, it now ensures that dependencies are copied too. When
+ not using ``--always-copy``, it tries to use a single resolution loop,
+ rather than recursing.
+
+ * Fixed installing extra ``.pyc`` or ``.pyo`` files for scripts with ``.py``
+ extensions.
+
+ * Added ``--site-dirs`` option to allow adding custom "site" directories.
+ Made ``easy-install.pth`` work in platform-specific alternate site
+ directories (e.g. ``~/Library/Python/2.x/site-packages`` on Mac OS X).
+
+ * If you manually delete the current version of a package, the next run of
+ EasyInstall against the target directory will now remove the stray entry
+ from the ``easy-install.pth`` file.
+
+ * EasyInstall now recognizes URLs with a ``#egg=project_name`` fragment ID
+ as pointing to the named project's source checkout. Such URLs have a lower
+ match precedence than any other kind of distribution, so they'll only be
+ used if they have a higher version number than any other available
+ distribution, or if you use the ``--editable`` option. The ``#egg``
+ fragment can contain a version if it's formatted as ``#egg=proj-ver``,
+ where ``proj`` is the project name, and ``ver`` is the version number. You
+ *must* use the format for these values that the ``bdist_egg`` command uses;
+ i.e., all non-alphanumeric runs must be condensed to single underscore
+ characters.
+
+ * Added the ``--editable`` option; see Editing and Viewing Source Packages
+ in the docs. Also, slightly changed the behavior of the
+ ``--build-directory`` option.
+
+ * Fixed the setup script sandbox facility not recognizing certain paths as
+ valid on case-insensitive platforms.
+
0.5a12
------
``python -m``, and marks them as unsafe for zipping, since Python 2.4 can't
handle ``-m`` on zipped modules.
+ * Fix ``python -m easy_install`` not working due to setuptools being installed
+ as a zipfile. Update safety scanner to check for modules that might be used
+ as ``python -m`` scripts.
+
+ * Misc. fixes for win32.exe support, including changes to support Python 2.4's
+ changed ``bdist_wininst`` format.
+
0.5a11
------
* Fix breakage of the "develop" command that was caused by the addition of
``--always-unzip`` to the ``easy_install`` command.
+0.5a10
+------
+
+ * Put the ``easy_install`` module back in as a module, as it's needed for
+ ``python -m`` to run it!
+
+ * Allow ``--find-links/-f`` to accept local directories or filenames as well
+ as URLs.
+
0.5a9
-----
* Fixed the swapped ``-d`` and ``-b`` options of ``bdist_egg``.
+ * EasyInstall now automatically detects when an "unmanaged" package or
+ module is going to be on ``sys.path`` ahead of a package you're installing,
+ thereby preventing the newer version from being imported. By default, it
+ will abort installation to alert you of the problem, but there are also
+ new options (``--delete-conflicting`` and ``--ignore-conflicts-at-my-risk``)
+ available to change the default behavior. (Note: this new feature doesn't
+ take effect for egg files that were built with older ``setuptools``
+ versions, because they lack the new metadata file required to implement it.)
+
+ * The ``easy_install`` distutils command now uses ``DistutilsError`` as its
+ base error type for errors that should just issue a message to stderr and
+ exit the program without a traceback.
+
+ * EasyInstall can now be given a path to a directory containing a setup
+ script, and it will attempt to build and install the package there.
+
+ * EasyInstall now performs a safety analysis on module contents to determine
+ whether a package is likely to run in zipped form, and displays
+ information about what modules may be doing introspection that would break
+ when running as a zipfile.
+
+ * Added the ``--always-unzip/-Z`` option, to force unzipping of packages that
+ would ordinarily be considered safe to unzip, and changed the meaning of
+ ``--zip-ok/-z`` to "always leave everything zipped".
+
0.5a8
-----
* Added a "setopt" command that sets a single option in a specified distutils
configuration file.
+ * There is now a separate documentation page for setuptools; revision
+ history that's not specific to EasyInstall has been moved to that page.
+
0.5a7
-----
* Setup scripts using setuptools now always install using ``easy_install``
internally, for ease of uninstallation and upgrading.
+ * Added ``--always-copy/-a`` option to always copy needed packages to the
+ installation directory, even if they're already present elsewhere on
+ sys.path. (In previous versions, this was the default behavior, but now
+ you must request it.)
+
+ * Added ``--upgrade/-U`` option to force checking PyPI for latest available
+ version(s) of all packages requested by name and version, even if a matching
+ version is available locally.
+
+ * Added automatic installation of dependencies declared by a distribution
+ being installed. These dependencies must be listed in the distribution's
+ ``EGG-INFO`` directory, so the distribution has to have declared its
+ dependencies by using setuptools. If a package has requirements it didn't
+ declare, you'll still have to deal with them yourself. (E.g., by asking
+ EasyInstall to find and install them.)
+
+ * Added the ``--record`` option to ``easy_install`` for the benefit of tools
+ that run ``setup.py install --record=filename`` on behalf of another
+ packaging system.)
+
+0.5a3
+-----
+
+ * Fixed not setting script permissions to allow execution.
+
+ * Improved sandboxing so that setup scripts that want a temporary directory
+ (e.g. pychecker) can still run in the sandbox.
+
+0.5a2
+-----
+
+ * Fix stupid stupid refactoring-at-the-last-minute typos. :(
+
0.5a1
-----
from setuptools import setup
# etc...
+ * Added support for converting ``.win32.exe`` installers to eggs on the fly.
+ EasyInstall will now recognize such files by name and install them.
+
+ * Fixed a problem with picking the "best" version to install (versions were
+ being sorted as strings, rather than as parsed values)
+
+0.4a4
+-----
+
+ * Added support for the distutils "verbose/quiet" and "dry-run" options, as
+ well as the "optimize" flag.
+
+ * Support downloading packages that were uploaded to PyPI (by scanning all
+ links on package pages, not just the homepage/download links).
+
+0.4a3
+-----
+
+ * Add progress messages to the search/download process so that you can tell
+ what URLs it's reading to find download links. (Hopefully, this will help
+ people report out-of-date and broken links to package authors, and to tell
+ when they've asked for a package that doesn't exist.)
+
0.4a2
-----
their ``command_consumes_arguments`` attribute to ``True`` in order to
receive an ``args`` option containing the rest of the command line.
+ * Added support for installing scripts
+
+ * Added support for setting options via distutils configuration files, and
+ using distutils' default options as a basis for EasyInstall's defaults.
+
+ * Renamed ``--scan-url/-s`` to ``--find-links/-f`` to free up ``-s`` for the
+ script installation directory option.
+
+ * Use ``urllib2`` instead of ``urllib``, to allow use of ``https:`` URLs if
+ Python includes SSL support.
+
+0.4a1
+-----
+
+ * Added ``--scan-url`` and ``--index-url`` options, to scan download pages
+ and search PyPI for needed packages.
+
+0.3a4
+-----
+
+ * Restrict ``--build-directory=DIR/-b DIR`` option to only be used with single
+ URL installs, to avoid running the wrong setup.py.
+
+0.3a3
+-----
+
+ * Added ``--build-directory=DIR/-b DIR`` option.
+
+ * Added "installation report" that explains how to use 'require()' when doing
+ a multiversion install or alternate installation directory.
+
+ * Added SourceForge mirror auto-select (Contributed by Ian Bicking)
+
+ * Added "sandboxing" that stops a setup script from running if it attempts to
+ write to the filesystem outside of the build area
+
+ * Added more workarounds for packages with quirky ``install_data`` hacks
+
0.3a2
-----
with a subversion revision number, the current date, or an explicit tag
value. Run ``setup.py bdist_egg --help`` to get more information.
+ * Added subversion download support for ``svn:`` and ``svn+`` URLs, as well as
+ automatic recognition of HTTP subversion URLs (Contributed by Ian Bicking)
+
* Misc. bug fixes
0.3a1
.. image:: https://img.shields.io/pypi/pyversions/setuptools.svg
+.. image:: https://tidelift.com/badges/github/pypa/setuptools
+ :target: https://tidelift.com/subscription/pkg/pypi-setuptools?utm_source=pypi-setuptools&utm_medium=readme
+
See the `Installation Instructions
<https://packaging.python.org/installing/>`_ in the Python Packaging
User's Guide for instructions on installing, upgrading, and uninstalling
Easy Install
============
+..warning::
+ Easy Install is deprecated. Do not use it. Instead use pip. If
+ you think you need Easy Install, please reach out to the PyPA
+ team (a ticket to pip or setuptools is fine), describing your
+ use-case.
+
Easy Install is a python module (``easy_install``) bundled with ``setuptools``
that lets you automatically download, build, install, and manage Python
packages.
(Also, if you'd like to learn about how you can use ``setuptools`` to make your
own packages work better with EasyInstall, or provide EasyInstall-like features
without requiring your users to use EasyInstall directly, you'll probably want
-to check out the full `setuptools`_ documentation as well.)
+to check out the full documentation as well.)
.. contents:: **Table of Contents**
8. If a package index is accessed via a ``file://`` URL, then EasyInstall will
automatically use ``index.html`` files, if present, when trying to read a
directory with a trailing ``/`` on the URL.
-
-
-Backward Compatibility
-~~~~~~~~~~~~~~~~~~~~~~
-
-Package indexes that wish to support setuptools versions prior to 0.6b4 should
-also follow these rules:
-
-* Homepage and download links must be preceded with ``"<th>Home Page"`` or
- ``"<th>Download URL"``, in addition to (or instead of) the ``rel=""``
- attributes on the actual links. These marker strings do not need to be
- visible, or uncommented, however! For example, the following is a valid
- homepage link that will work with any version of setuptools::
-
- <li>
- <strong>Home Page:</strong>
- <!-- <th>Home Page -->
- <a rel="homepage" href="http://sqlobject.org">http://sqlobject.org</a>
- </li>
-
- Even though the marker string is in an HTML comment, older versions of
- EasyInstall will still "see" it and know that the link that follows is the
- project's home page URL.
-
-* The pages described by paragraph 3(b) of the preceding section *must*
- contain the string ``"Index of Packages</title>"`` somewhere in their text.
- This can be inside of an HTML comment, if desired, and it can be anywhere
- in the page. (Note: this string MUST NOT appear on normal project pages, as
- described in paragraphs 2 and 3(a)!)
-
-In addition, for compatibility with PyPI versions that do not use ``#md5=``
-fragment IDs, EasyInstall uses the following regular expression to match PyPI's
-displayed MD5 info (broken onto two lines for readability)::
-
- <a href="([^"#]+)">([^<]+)</a>\n\s+\(<a href="[^?]+\?:action=show_md5
- &digest=([0-9a-f]{32})">md5</a>\)
-
-History
-=======
-
-0.6c9
- * Fixed ``win32.exe`` support for .pth files, so unnecessary directory nesting
- is flattened out in the resulting egg. (There was a case-sensitivity
- problem that affected some distributions, notably ``pywin32``.)
-
- * Prevent ``--help-commands`` and other junk from showing under Python 2.5
- when running ``easy_install --help``.
-
- * Fixed GUI scripts sometimes not executing on Windows
-
- * Fixed not picking up dependency links from recursive dependencies.
-
- * Only make ``.py``, ``.dll`` and ``.so`` files executable when unpacking eggs
-
- * Changes for Jython compatibility
-
- * Improved error message when a requirement is also a directory name, but the
- specified directory is not a source package.
-
- * Fixed ``--allow-hosts`` option blocking ``file:`` URLs
-
- * Fixed HTTP SVN detection failing when the page title included a project
- name (e.g. on SourceForge-hosted SVN)
-
- * Fix Jython script installation to handle ``#!`` lines better when
- ``sys.executable`` is a script.
-
- * Removed use of deprecated ``md5`` module if ``hashlib`` is available
-
- * Keep site directories (e.g. ``site-packages``) from being included in
- ``.pth`` files.
-
-0.6c7
- * ``ftp:`` download URLs now work correctly.
-
- * The default ``--index-url`` is now ``https://pypi.python.org/simple``, to use
- the Python Package Index's new simpler (and faster!) REST API.
-
-0.6c6
- * EasyInstall no longer aborts the installation process if a URL it wants to
- retrieve can't be downloaded, unless the URL is an actual package download.
- Instead, it issues a warning and tries to keep going.
-
- * Fixed distutils-style scripts originally built on Windows having their line
- endings doubled when installed on any platform.
-
- * Added ``--local-snapshots-ok`` flag, to allow building eggs from projects
- installed using ``setup.py develop``.
-
- * Fixed not HTML-decoding URLs scraped from web pages
-
-0.6c5
- * Fixed ``.dll`` files on Cygwin not having executable permissions when an egg
- is installed unzipped.
-
-0.6c4
- * Added support for HTTP "Basic" authentication using ``http://user:pass@host``
- URLs. If a password-protected page contains links to the same host (and
- protocol), those links will inherit the credentials used to access the
- original page.
-
- * Removed all special support for Sourceforge mirrors, as Sourceforge's
- mirror system now works well for non-browser downloads.
-
- * Fixed not recognizing ``win32.exe`` installers that included a custom
- bitmap.
-
- * Fixed not allowing ``os.open()`` of paths outside the sandbox, even if they
- are opened read-only (e.g. reading ``/dev/urandom`` for random numbers, as
- is done by ``os.urandom()`` on some platforms).
-
- * Fixed a problem with ``.pth`` testing on Windows when ``sys.executable``
- has a space in it (e.g., the user installed Python to a ``Program Files``
- directory).
-
-0.6c3
- * You can once again use "python -m easy_install" with Python 2.4 and above.
-
- * Python 2.5 compatibility fixes added.
-
-0.6c2
- * Windows script wrappers now support quoted arguments and arguments
- containing spaces. (Patch contributed by Jim Fulton.)
-
- * The ``ez_setup.py`` script now actually works when you put a setuptools
- ``.egg`` alongside it for bootstrapping an offline machine.
-
- * A writable installation directory on ``sys.path`` is no longer required to
- download and extract a source distribution using ``--editable``.
-
- * Generated scripts now use ``-x`` on the ``#!`` line when ``sys.executable``
- contains non-ASCII characters, to prevent deprecation warnings about an
- unspecified encoding when the script is run.
-
-0.6c1
- * EasyInstall now includes setuptools version information in the
- ``User-Agent`` string sent to websites it visits.
-
-0.6b4
- * Fix creating Python wrappers for non-Python scripts
-
- * Fix ``ftp://`` directory listing URLs from causing a crash when used in the
- "Home page" or "Download URL" slots on PyPI.
-
- * Fix ``sys.path_importer_cache`` not being updated when an existing zipfile
- or directory is deleted/overwritten.
-
- * Fix not recognizing HTML 404 pages from package indexes.
-
- * Allow ``file://`` URLs to be used as a package index. URLs that refer to
- directories will use an internally-generated directory listing if there is
- no ``index.html`` file in the directory.
-
- * Allow external links in a package index to be specified using
- ``rel="homepage"`` or ``rel="download"``, without needing the old
- PyPI-specific visible markup.
-
- * Suppressed warning message about possibly-misspelled project name, if an egg
- or link for that project name has already been seen.
-
-0.6b3
- * Fix local ``--find-links`` eggs not being copied except with
- ``--always-copy``.
-
- * Fix sometimes not detecting local packages installed outside of "site"
- directories.
-
- * Fix mysterious errors during initial ``setuptools`` install, caused by
- ``ez_setup`` trying to run ``easy_install`` twice, due to a code fallthru
- after deleting the egg from which it's running.
-
-0.6b2
- * Don't install or update a ``site.py`` patch when installing to a
- ``PYTHONPATH`` directory with ``--multi-version``, unless an
- ``easy-install.pth`` file is already in use there.
-
- * Construct ``.pth`` file paths in such a way that installing an egg whose
- name begins with ``import`` doesn't cause a syntax error.
-
- * Fixed a bogus warning message that wasn't updated since the 0.5 versions.
-
-0.6b1
- * Better ambiguity management: accept ``#egg`` name/version even if processing
- what appears to be a correctly-named distutils file, and ignore ``.egg``
- files with no ``-``, since valid Python ``.egg`` files always have a version
- number (but Scheme eggs often don't).
-
- * Support ``file://`` links to directories in ``--find-links``, so that
- easy_install can build packages from local source checkouts.
-
- * Added automatic retry for Sourceforge mirrors. The new download process is
- to first just try dl.sourceforge.net, then randomly select mirror IPs and
- remove ones that fail, until something works. The removed IPs stay removed
- for the remainder of the run.
-
- * Ignore bdist_dumb distributions when looking at download URLs.
-
-0.6a11
- * Process ``dependency_links.txt`` if found in a distribution, by adding the
- URLs to the list for scanning.
-
- * Use relative paths in ``.pth`` files when eggs are being installed to the
- same directory as the ``.pth`` file. This maximizes portability of the
- target directory when building applications that contain eggs.
-
- * Added ``easy_install-N.N`` script(s) for convenience when using multiple
- Python versions.
-
- * Added automatic handling of installation conflicts. Eggs are now shifted to
- the front of sys.path, in an order consistent with where they came from,
- making EasyInstall seamlessly co-operate with system package managers.
-
- The ``--delete-conflicting`` and ``--ignore-conflicts-at-my-risk`` options
- are now no longer necessary, and will generate warnings at the end of a
- run if you use them.
-
- * Don't recursively traverse subdirectories given to ``--find-links``.
-
-0.6a10
- * Added exhaustive testing of the install directory, including a spawn test
- for ``.pth`` file support, and directory writability/existence checks. This
- should virtually eliminate the need to set or configure ``--site-dirs``.
-
- * Added ``--prefix`` option for more do-what-I-mean-ishness in the absence of
- RTFM-ing. :)
-
- * Enhanced ``PYTHONPATH`` support so that you don't have to put any eggs on it
- manually to make it work. ``--multi-version`` is no longer a silent
- default; you must explicitly use it if installing to a non-PYTHONPATH,
- non-"site" directory.
-
- * Expand ``$variables`` used in the ``--site-dirs``, ``--build-directory``,
- ``--install-dir``, and ``--script-dir`` options, whether on the command line
- or in configuration files.
-
- * Improved SourceForge mirror processing to work faster and be less affected
- by transient HTML changes made by SourceForge.
-
- * PyPI searches now use the exact spelling of requirements specified on the
- command line or in a project's ``install_requires``. Previously, a
- normalized form of the name was used, which could lead to unnecessary
- full-index searches when a project's name had an underscore (``_``) in it.
-
- * EasyInstall can now download bare ``.py`` files and wrap them in an egg,
- as long as you include an ``#egg=name-version`` suffix on the URL, or if
- the ``.py`` file is listed as the "Download URL" on the project's PyPI page.
- This allows third parties to "package" trivial Python modules just by
- linking to them (e.g. from within their own PyPI page or download links
- page).
-
- * The ``--always-copy`` option now skips "system" and "development" eggs since
- they can't be reliably copied. Note that this may cause EasyInstall to
- choose an older version of a package than what you expected, or it may cause
- downloading and installation of a fresh version of what's already installed.
-
- * The ``--find-links`` option previously scanned all supplied URLs and
- directories as early as possible, but now only directories and direct
- archive links are scanned immediately. URLs are not retrieved unless a
- package search was already going to go online due to a package not being
- available locally, or due to the use of the ``--update`` or ``-U`` option.
-
- * Fixed the annoying ``--help-commands`` wart.
-
-0.6a9
- * Fixed ``.pth`` file processing picking up nested eggs (i.e. ones inside
- "baskets") when they weren't explicitly listed in the ``.pth`` file.
-
- * If more than one URL appears to describe the exact same distribution, prefer
- the shortest one. This helps to avoid "table of contents" CGI URLs like the
- ones on effbot.org.
-
- * Quote arguments to python.exe (including python's path) to avoid problems
- when Python (or a script) is installed in a directory whose name contains
- spaces on Windows.
-
- * Support full roundtrip translation of eggs to and from ``bdist_wininst``
- format. Running ``bdist_wininst`` on a setuptools-based package wraps the
- egg in an .exe that will safely install it as an egg (i.e., with metadata
- and entry-point wrapper scripts), and ``easy_install`` can turn the .exe
- back into an ``.egg`` file or directory and install it as such.
-
-0.6a8
- * Update for changed SourceForge mirror format
-
- * Fixed not installing dependencies for some packages fetched via Subversion
-
- * Fixed dependency installation with ``--always-copy`` not using the same
- dependency resolution procedure as other operations.
-
- * Fixed not fully removing temporary directories on Windows, if a Subversion
- checkout left read-only files behind
-
- * Fixed some problems building extensions when Pyrex was installed, especially
- with Python 2.4 and/or packages using SWIG.
-
-0.6a7
- * Fixed not being able to install Windows script wrappers using Python 2.3
-
-0.6a6
- * Added support for "traditional" PYTHONPATH-based non-root installation, and
- also the convenient ``virtual-python.py`` script, based on a contribution
- by Ian Bicking. The setuptools egg now contains a hacked ``site`` module
- that makes the PYTHONPATH-based approach work with .pth files, so that you
- can get the full EasyInstall feature set on such installations.
-
- * Added ``--no-deps`` and ``--allow-hosts`` options.
-
- * Improved Windows ``.exe`` script wrappers so that the script can have the
- same name as a module without confusing Python.
-
- * Changed dependency processing so that it's breadth-first, allowing a
- depender's preferences to override those of a dependee, to prevent conflicts
- when a lower version is acceptable to the dependee, but not the depender.
- Also, ensure that currently installed/selected packages aren't given
- precedence over ones desired by a package being installed, which could
- cause conflict errors.
-
-0.6a3
- * Improved error message when trying to use old ways of running
- ``easy_install``. Removed the ability to run via ``python -m`` or by
- running ``easy_install.py``; ``easy_install`` is the command to run on all
- supported platforms.
-
- * Improved wrapper script generation and runtime initialization so that a
- VersionConflict doesn't occur if you later install a competing version of a
- needed package as the default version of that package.
-
- * Fixed a problem parsing version numbers in ``#egg=`` links.
-
-0.6a2
- * EasyInstall can now install "console_scripts" defined by packages that use
- ``setuptools`` and define appropriate entry points. On Windows, console
- scripts get an ``.exe`` wrapper so you can just type their name. On other
- platforms, the scripts are installed without a file extension.
-
- * Using ``python -m easy_install`` or running ``easy_install.py`` is now
- DEPRECATED, since an ``easy_install`` wrapper is now available on all
- platforms.
-
-0.6a1
- * EasyInstall now does MD5 validation of downloads from PyPI, or from any link
- that has an "#md5=..." trailer with a 32-digit lowercase hex md5 digest.
-
- * EasyInstall now handles symlinks in target directories by removing the link,
- rather than attempting to overwrite the link's destination. This makes it
- easier to set up an alternate Python "home" directory (as described above in
- the `Non-Root Installation`_ section).
-
- * Added support for handling MacOS platform information in ``.egg`` filenames,
- based on a contribution by Kevin Dangoor. You may wish to delete and
- reinstall any eggs whose filename includes "darwin" and "Power_Macintosh",
- because the format for this platform information has changed so that minor
- OS X upgrades (such as 10.4.1 to 10.4.2) do not cause eggs built with a
- previous OS version to become obsolete.
-
- * easy_install's dependency processing algorithms have changed. When using
- ``--always-copy``, it now ensures that dependencies are copied too. When
- not using ``--always-copy``, it tries to use a single resolution loop,
- rather than recursing.
-
- * Fixed installing extra ``.pyc`` or ``.pyo`` files for scripts with ``.py``
- extensions.
-
- * Added ``--site-dirs`` option to allow adding custom "site" directories.
- Made ``easy-install.pth`` work in platform-specific alternate site
- directories (e.g. ``~/Library/Python/2.x/site-packages`` on Mac OS X).
-
- * If you manually delete the current version of a package, the next run of
- EasyInstall against the target directory will now remove the stray entry
- from the ``easy-install.pth`` file.
-
- * EasyInstall now recognizes URLs with a ``#egg=project_name`` fragment ID
- as pointing to the named project's source checkout. Such URLs have a lower
- match precedence than any other kind of distribution, so they'll only be
- used if they have a higher version number than any other available
- distribution, or if you use the ``--editable`` option. The ``#egg``
- fragment can contain a version if it's formatted as ``#egg=proj-ver``,
- where ``proj`` is the project name, and ``ver`` is the version number. You
- *must* use the format for these values that the ``bdist_egg`` command uses;
- i.e., all non-alphanumeric runs must be condensed to single underscore
- characters.
-
- * Added the ``--editable`` option; see `Editing and Viewing Source Packages`_
- above for more info. Also, slightly changed the behavior of the
- ``--build-directory`` option.
-
- * Fixed the setup script sandbox facility not recognizing certain paths as
- valid on case-insensitive platforms.
-
-0.5a12
- * Fix ``python -m easy_install`` not working due to setuptools being installed
- as a zipfile. Update safety scanner to check for modules that might be used
- as ``python -m`` scripts.
-
- * Misc. fixes for win32.exe support, including changes to support Python 2.4's
- changed ``bdist_wininst`` format.
-
-0.5a10
- * Put the ``easy_install`` module back in as a module, as it's needed for
- ``python -m`` to run it!
-
- * Allow ``--find-links/-f`` to accept local directories or filenames as well
- as URLs.
-
-0.5a9
- * EasyInstall now automatically detects when an "unmanaged" package or
- module is going to be on ``sys.path`` ahead of a package you're installing,
- thereby preventing the newer version from being imported. By default, it
- will abort installation to alert you of the problem, but there are also
- new options (``--delete-conflicting`` and ``--ignore-conflicts-at-my-risk``)
- available to change the default behavior. (Note: this new feature doesn't
- take effect for egg files that were built with older ``setuptools``
- versions, because they lack the new metadata file required to implement it.)
-
- * The ``easy_install`` distutils command now uses ``DistutilsError`` as its
- base error type for errors that should just issue a message to stderr and
- exit the program without a traceback.
-
- * EasyInstall can now be given a path to a directory containing a setup
- script, and it will attempt to build and install the package there.
-
- * EasyInstall now performs a safety analysis on module contents to determine
- whether a package is likely to run in zipped form, and displays
- information about what modules may be doing introspection that would break
- when running as a zipfile.
-
- * Added the ``--always-unzip/-Z`` option, to force unzipping of packages that
- would ordinarily be considered safe to unzip, and changed the meaning of
- ``--zip-ok/-z`` to "always leave everything zipped".
-
-0.5a8
- * There is now a separate documentation page for `setuptools`_; revision
- history that's not specific to EasyInstall has been moved to that page.
-
- .. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools
-
-0.5a5
- * Made ``easy_install`` a standard ``setuptools`` command, moving it from
- the ``easy_install`` module to ``setuptools.command.easy_install``. Note
- that if you were importing or extending it, you must now change your imports
- accordingly. ``easy_install.py`` is still installed as a script, but not as
- a module.
-
-0.5a4
- * Added ``--always-copy/-a`` option to always copy needed packages to the
- installation directory, even if they're already present elsewhere on
- sys.path. (In previous versions, this was the default behavior, but now
- you must request it.)
-
- * Added ``--upgrade/-U`` option to force checking PyPI for latest available
- version(s) of all packages requested by name and version, even if a matching
- version is available locally.
-
- * Added automatic installation of dependencies declared by a distribution
- being installed. These dependencies must be listed in the distribution's
- ``EGG-INFO`` directory, so the distribution has to have declared its
- dependencies by using setuptools. If a package has requirements it didn't
- declare, you'll still have to deal with them yourself. (E.g., by asking
- EasyInstall to find and install them.)
-
- * Added the ``--record`` option to ``easy_install`` for the benefit of tools
- that run ``setup.py install --record=filename`` on behalf of another
- packaging system.)
-
-0.5a3
- * Fixed not setting script permissions to allow execution.
-
- * Improved sandboxing so that setup scripts that want a temporary directory
- (e.g. pychecker) can still run in the sandbox.
-
-0.5a2
- * Fix stupid stupid refactoring-at-the-last-minute typos. :(
-
-0.5a1
- * Added support for converting ``.win32.exe`` installers to eggs on the fly.
- EasyInstall will now recognize such files by name and install them.
-
- * Fixed a problem with picking the "best" version to install (versions were
- being sorted as strings, rather than as parsed values)
-
-0.4a4
- * Added support for the distutils "verbose/quiet" and "dry-run" options, as
- well as the "optimize" flag.
-
- * Support downloading packages that were uploaded to PyPI (by scanning all
- links on package pages, not just the homepage/download links).
-
-0.4a3
- * Add progress messages to the search/download process so that you can tell
- what URLs it's reading to find download links. (Hopefully, this will help
- people report out-of-date and broken links to package authors, and to tell
- when they've asked for a package that doesn't exist.)
-
-0.4a2
- * Added support for installing scripts
-
- * Added support for setting options via distutils configuration files, and
- using distutils' default options as a basis for EasyInstall's defaults.
-
- * Renamed ``--scan-url/-s`` to ``--find-links/-f`` to free up ``-s`` for the
- script installation directory option.
-
- * Use ``urllib2`` instead of ``urllib``, to allow use of ``https:`` URLs if
- Python includes SSL support.
-
-0.4a1
- * Added ``--scan-url`` and ``--index-url`` options, to scan download pages
- and search PyPI for needed packages.
-
-0.3a4
- * Restrict ``--build-directory=DIR/-b DIR`` option to only be used with single
- URL installs, to avoid running the wrong setup.py.
-
-0.3a3
- * Added ``--build-directory=DIR/-b DIR`` option.
-
- * Added "installation report" that explains how to use 'require()' when doing
- a multiversion install or alternate installation directory.
-
- * Added SourceForge mirror auto-select (Contributed by Ian Bicking)
-
- * Added "sandboxing" that stops a setup script from running if it attempts to
- write to the filesystem outside of the build area
-
- * Added more workarounds for packages with quirky ``install_data`` hacks
-
-0.3a2
- * Added subversion download support for ``svn:`` and ``svn+`` URLs, as well as
- automatic recognition of HTTP subversion URLs (Contributed by Ian Bicking)
-
- * Misc. bug fixes
-
-0.3a1
- * Initial release.
-
-
-Future Plans
-============
-
-* Additional utilities to list/remove/verify packages
-* Signature checking? SSL? Ability to suppress PyPI search?
-* Display byte progress meter when downloading distributions and long pages?
-* Redirect stdout/stderr to log during run_setup?
To advertise an entry point, a project needs to use ``setuptools`` and provide
an ``entry_points`` argument to ``setup()`` in its setup script, so that the
entry points will be included in the distribution's metadata. For more
-details, see the ``setuptools`` documentation. (XXX link here to setuptools)
+details, see the [``setuptools`` documentation](https://setuptools.readthedocs.io/en/latest/setuptools.html#dynamic-discovery-of-services-and-plugins).
Each project distribution can advertise at most one entry point of a given
name within the same entry point group. For example, a distutils extension
-sphinx
+sphinx!=1.8.0
rst.linker>=1.9
jaraco.packaging>=3.2
importer = get_importer(path_item)
if importer is None:
return None
- loader = importer.find_module(packageName)
+
+ # capture warnings due to #1111
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore")
+ loader = importer.find_module(packageName)
+
if loader is None:
return None
module = sys.modules.get(packageName)
parts = path_parts[:-module_parts]
return safe_sys_path_index(_normalize_cached(os.sep.join(parts)))
- if not isinstance(orig_path, list):
- # Is this behavior useful when module.__path__ is not a list?
- return
+ new_path = sorted(orig_path, key=position_in_sys_path)
+ new_path = [_normalize_cached(p) for p in new_path]
- orig_path.sort(key=position_in_sys_path)
- module.__path__[:] = [_normalize_cached(p) for p in orig_path]
+ if isinstance(module.__path__, list):
+ module.__path__[:] = new_path
+ else:
+ module.__path__ = new_path
def declare_namespace(packageName):
if packageName in _namespace_packages:
return
- path, parent = sys.path, None
- if '.' in packageName:
- parent = '.'.join(packageName.split('.')[:-1])
+ path = sys.path
+ parent, _, _ = packageName.rpartition('.')
+
+ if parent:
declare_namespace(parent)
if parent not in _namespace_packages:
__import__(parent)
# Track what packages are namespaces, so when new path items are added,
# they can be updated
- _namespace_packages.setdefault(parent, []).append(packageName)
+ _namespace_packages.setdefault(parent or None, []).append(packageName)
_namespace_packages.setdefault(packageName, [])
for path_item in path:
[bumpversion]
-current_version = 40.2.0
+current_version = 40.3.0
commit = True
tag = True
setup_params = dict(
name="setuptools",
- version="40.2.0",
+ version="40.3.0",
description=(
"Easily download, build, install, upgrade, and uninstall "
"Python packages"
return config_settings
-def _get_build_requires(config_settings):
+def _get_build_requires(config_settings, requirements):
config_settings = _fix_config(config_settings)
- requirements = ['setuptools', 'wheel']
sys.argv = sys.argv[:1] + ['egg_info'] + \
config_settings["--global-option"]
def get_requires_for_build_wheel(config_settings=None):
config_settings = _fix_config(config_settings)
- return _get_build_requires(config_settings)
+ return _get_build_requires(config_settings, requirements=['setuptools', 'wheel'])
def get_requires_for_build_sdist(config_settings=None):
config_settings = _fix_config(config_settings)
- return _get_build_requires(config_settings)
+ return _get_build_requires(config_settings, requirements=['setuptools'])
def prepare_metadata_for_build_wheel(metadata_directory, config_settings=None):
sys.argv = sys.argv[:1] + ['dist_info', '--egg-base', _to_str(metadata_directory)]
_run_setup()
-
+
dist_info_directory = metadata_directory
- while True:
+ while True:
dist_infos = [f for f in os.listdir(dist_info_directory)
if f.endswith('.dist-info')]
def run(self):
self.mkpath(self.egg_info)
+ os.utime(self.egg_info, None)
installer = self.distribution.fetch_build_egg
for ep in iter_entry_points('egg_info.writers'):
ep.require(installer=installer)
Changes include:
* `yield from` and PEP3102 `*` removed.
- * `bytes` changed to `six.binary_type`.
* Hidden files are not ignored.
"""
import os
import re
import fnmatch
-from setuptools.extern.six import binary_type
__all__ = ["glob", "iglob", "escape"]
def glob1(dirname, pattern):
if not dirname:
- if isinstance(pattern, binary_type):
+ if isinstance(pattern, bytes):
dirname = os.curdir.encode('ASCII')
else:
dirname = os.curdir
# Recursively yields relative pathnames inside a literal directory.
def _rlistdir(dirname):
if not dirname:
- if isinstance(dirname, binary_type):
- dirname = binary_type(os.curdir, 'ASCII')
+ if isinstance(dirname, bytes):
+ dirname = os.curdir.encode('ASCII')
else:
dirname = os.curdir
try:
def has_magic(s):
- if isinstance(s, binary_type):
+ if isinstance(s, bytes):
match = magic_check_bytes.search(s)
else:
match = magic_check.search(s)
def _isrecursive(pattern):
- if isinstance(pattern, binary_type):
+ if isinstance(pattern, bytes):
return pattern == b'**'
else:
return pattern == '**'
# Escaping is done by wrapping any of "*?[" between square brackets.
# Metacharacters do not work in the drive part and shouldn't be escaped.
drive, pathname = os.path.splitdrive(pathname)
- if isinstance(pathname, binary_type):
+ if isinstance(pathname, bytes):
pathname = magic_check_bytes.sub(br'[\1]', pathname)
else:
pathname = magic_check.sub(r'[\1]', pathname)
import os
-from setuptools.extern.six import binary_type
import pkg_resources.py31compat
pkg_resources.py31compat.makedirs(full_name, exist_ok=True)
build_files(contents, prefix=full_name)
else:
- if isinstance(contents, binary_type):
+ if isinstance(contents, bytes):
with open(full_name, 'wb') as f:
f.write(contents)
else:
return getattr(mod, name)(*args, **kw)
-defns = [{
- 'setup.py': DALS("""
- __import__('setuptools').setup(
- name='foo',
- py_modules=['hello'],
- setup_requires=['six'],
- )
- """),
- 'hello.py': DALS("""
- def run():
- print('hello')
- """),
- },
- {
- 'setup.py': DALS("""
- assert __name__ == '__main__'
- __import__('setuptools').setup(
- name='foo',
- py_modules=['hello'],
- setup_requires=['six'],
- )
- """),
- 'hello.py': DALS("""
- def run():
- print('hello')
- """),
- },
- {
- 'setup.py': DALS("""
- variable = True
- def function():
- return variable
- assert variable
- __import__('setuptools').setup(
- name='foo',
- py_modules=['hello'],
- setup_requires=['six'],
- )
- """),
- 'hello.py': DALS("""
- def run():
- print('hello')
- """),
- }]
+defns = [
+ {
+ 'setup.py': DALS("""
+ __import__('setuptools').setup(
+ name='foo',
+ py_modules=['hello'],
+ setup_requires=['six'],
+ )
+ """),
+ 'hello.py': DALS("""
+ def run():
+ print('hello')
+ """),
+ },
+ {
+ 'setup.py': DALS("""
+ assert __name__ == '__main__'
+ __import__('setuptools').setup(
+ name='foo',
+ py_modules=['hello'],
+ setup_requires=['six'],
+ )
+ """),
+ 'hello.py': DALS("""
+ def run():
+ print('hello')
+ """),
+ },
+ {
+ 'setup.py': DALS("""
+ variable = True
+ def function():
+ return variable
+ assert variable
+ __import__('setuptools').setup(
+ name='foo',
+ py_modules=['hello'],
+ setup_requires=['six'],
+ )
+ """),
+ 'hello.py': DALS("""
+ def run():
+ print('hello')
+ """),
+ },
+]
@pytest.fixture(params=defns)
assert sorted(actual) == sorted(expected)
+def test_get_requires_for_build_sdist(build_backend):
+ actual = build_backend.get_requires_for_build_sdist()
+ expected = ['six', 'setuptools']
+ assert sorted(actual) == sorted(expected)
+
+
def test_build_wheel(build_backend):
dist_dir = os.path.abspath('pip-wheel')
os.makedirs(dist_dir)
# -*- coding: utf-8 -*-
"""Easy install Tests
"""
-from __future__ import absolute_import
+from __future__ import absolute_import, unicode_literals
import sys
import os
import mock
import time
+from setuptools.extern import six
from setuptools.extern.six.moves import urllib
import pytest
def get_entry_map(self, group):
if group != 'console_scripts':
return {}
- return {'name': 'ep'}
+ return {str('name'): 'ep'}
def as_requirement(self):
return 'spec'
sys.exit(
load_entry_point('spec', 'console_scripts', 'name')()
)
- """)
+ """) # noqa: E501
dist = FakeDist()
args = next(ei.ScriptWriter.get_args(dist))
site.getsitepackages.
"""
path = normalize_path('/setuptools/test/site-packages')
- mock_gsp = lambda: [path]
+
+ def mock_gsp():
+ return [path]
monkeypatch.setattr(site, 'getsitepackages', mock_gsp, raising=False)
assert path in ei.get_site_dirs()
"",
),
(
- u'mypkg/\u2603.txt',
+ 'mypkg/☃.txt',
"",
),
]
return str(sdist)
@fail_on_ascii
- def test_unicode_filename_in_sdist(self, sdist_unicode, tmpdir, monkeypatch):
+ def test_unicode_filename_in_sdist(
+ self, sdist_unicode, tmpdir, monkeypatch):
"""
The install command should execute correctly even if
the package has unicode filenames.
DALS(
"""
#!/bin/sh
- # \xc3\xa1
+ # á
non_python_fn() {
}
# with zip sdists.
sdist_zip = zipfile.ZipFile(str(sdist), "w")
for filename, content in files:
- sdist_zip.writestr(filename, content)
+ sdist_zip.writestr(filename, content.encode('utf-8'))
sdist_zip.close()
return str(sdist)
@fail_on_ascii
- def test_unicode_content_in_sdist(self, sdist_unicode_in_script, tmpdir, monkeypatch):
+ def test_unicode_content_in_sdist(
+ self, sdist_unicode_in_script, tmpdir, monkeypatch):
"""
The install command should execute correctly even if
the package has unicode in scripts.
"""),
),
(
- u'mypkg_script',
+ 'mypkg_script',
DALS("""
#/usr/bin/python
print('mypkg_script')
dist_file,
]
with sandbox.save_argv(['easy_install']):
- # attempt to install the dist. It should fail because
- # it doesn't exist.
+ # attempt to install the dist. It should
+ # fail because it doesn't exist.
with pytest.raises(SystemExit):
easy_install_pkg.main(ei_params)
# there should have been two or three requests to the server
with contexts.save_pkg_resources_state():
with contexts.tempdir() as temp_dir:
- test_pkg = create_setup_requires_package(temp_dir, use_setup_cfg=use_setup_cfg)
+ test_pkg = create_setup_requires_package(
+ temp_dir, use_setup_cfg=use_setup_cfg)
test_setup_py = os.path.join(test_pkg, 'setup.py')
with contexts.quiet() as (stdout, stderr):
# Don't even need to install the package, just
# running the setup.py at all is sufficient
- run_setup(test_setup_py, ['--name'])
+ run_setup(test_setup_py, [str('--name')])
lines = stdout.readlines()
assert len(lines) > 0
try:
# Don't even need to install the package, just
# running the setup.py at all is sufficient
- run_setup(test_setup_py, ['--name'])
+ run_setup(test_setup_py, [str('--name')])
except pkg_resources.VersionConflict:
- self.fail('Installing setup.py requirements '
+ self.fail(
+ 'Installing setup.py requirements '
'caused a VersionConflict')
assert 'FAIL' not in stdout.getvalue()
@pytest.mark.parametrize('use_setup_cfg', use_setup_cfg)
def test_setup_requires_with_attr_version(self, use_setup_cfg):
def make_dependency_sdist(dist_path, distname, version):
- make_sdist(dist_path, [
- ('setup.py',
- DALS("""
- import setuptools
- setuptools.setup(
- name={name!r},
- version={version!r},
- py_modules=[{name!r}],
- )
- """.format(name=distname, version=version))),
- (distname + '.py',
- DALS("""
- version = 42
- """
- ))])
+ files = [(
+ 'setup.py',
+ DALS("""
+ import setuptools
+ setuptools.setup(
+ name={name!r},
+ version={version!r},
+ py_modules=[{name!r}],
+ )
+ """.format(name=distname, version=version)),
+ ), (
+ distname + '.py',
+ DALS("""
+ version = 42
+ """),
+ )]
+ make_sdist(dist_path, files)
with contexts.save_pkg_resources_state():
with contexts.tempdir() as temp_dir:
test_pkg = create_setup_requires_package(
)
test_setup_py = os.path.join(test_pkg, 'setup.py')
with contexts.quiet() as (stdout, stderr):
- run_setup(test_setup_py, ['--version'])
+ run_setup(test_setup_py, [str('--version')])
lines = stdout.readlines()
assert len(lines) > 0
assert lines[-1].strip() == '42'
import setuptools
setuptools.setup(**%r)
""")
-
with open(test_setup_py, 'w') as f:
f.write(setup_py_template % test_setup_attrs)
)
class TestScriptHeader:
non_ascii_exe = '/Users/José/bin/python'
+ if six.PY2:
+ non_ascii_exe = non_ascii_exe.encode('utf-8')
exe_with_spaces = r'C:\Program Files\Python36\python.exe'
def test_get_script_header(self):
assert actual == expected
def test_get_script_header_args(self):
- expected = '#!%s -x\n' % ei.nt_quote_arg(os.path.normpath
- (sys.executable))
+ expected = '#!%s -x\n' % ei.nt_quote_arg(
+ os.path.normpath(sys.executable))
actual = ei.ScriptWriter.get_script_header('#!/usr/bin/python -x')
assert actual == expected
def test_get_script_header_non_ascii_exe(self):
- actual = ei.ScriptWriter.get_script_header('#!/usr/bin/python',
+ actual = ei.ScriptWriter.get_script_header(
+ '#!/usr/bin/python',
executable=self.non_ascii_exe)
- expected = '#!%s -x\n' % self.non_ascii_exe
+ expected = str('#!%s -x\n') % self.non_ascii_exe
assert actual == expected
def test_get_script_header_exe_with_spaces(self):
- actual = ei.ScriptWriter.get_script_header('#!/usr/bin/python',
+ actual = ei.ScriptWriter.get_script_header(
+ '#!/usr/bin/python',
executable='"' + self.exe_with_spaces + '"')
expected = '#!"%s"\n' % self.exe_with_spaces
assert actual == expected
+import datetime
import sys
import ast
import os
import glob
import re
import stat
+import time
from setuptools.command.egg_info import egg_info, manifest_maker
from setuptools.dist import Distribution
]
assert sorted(actual) == expected
+ def test_rebuilt(self, tmpdir_cwd, env):
+ """Ensure timestamps are updated when the command is re-run."""
+ self._create_project()
+
+ self._run_egg_info_command(tmpdir_cwd, env)
+ timestamp_a = os.path.getmtime('foo.egg-info')
+
+ # arbitrary sleep just to handle *really* fast systems
+ time.sleep(.001)
+
+ self._run_egg_info_command(tmpdir_cwd, env)
+ timestamp_b = os.path.getmtime('foo.egg-info')
+
+ assert timestamp_a != timestamp_b
+
def test_manifest_template_is_read(self, tmpdir_cwd, env):
self._create_project()
build_files({
--- /dev/null
+import pytest
+
+from setuptools.glob import glob
+
+from .files import build_files
+
+
+@pytest.mark.parametrize('tree, pattern, matches', (
+ ('', b'', []),
+ ('', '', []),
+ ('''
+ appveyor.yml
+ CHANGES.rst
+ LICENSE
+ MANIFEST.in
+ pyproject.toml
+ README.rst
+ setup.cfg
+ setup.py
+ ''', '*.rst', ('CHANGES.rst', 'README.rst')),
+ ('''
+ appveyor.yml
+ CHANGES.rst
+ LICENSE
+ MANIFEST.in
+ pyproject.toml
+ README.rst
+ setup.cfg
+ setup.py
+ ''', b'*.rst', (b'CHANGES.rst', b'README.rst')),
+))
+def test_glob(monkeypatch, tmpdir, tree, pattern, matches):
+ monkeypatch.chdir(tmpdir)
+ build_files({name: '' for name in tree.split()})
+ assert list(sorted(glob(pattern))) == list(sorted(matches))
class TestNamespaces:
- @pytest.mark.xfail(sys.version_info < (3, 5),
- reason="Requires importlib.util.module_from_spec")
- @pytest.mark.skipif(bool(os.environ.get("APPVEYOR")),
- reason="https://github.com/pypa/setuptools/issues/851")
+ @pytest.mark.xfail(
+ sys.version_info < (3, 5),
+ reason="Requires importlib.util.module_from_spec",
+ )
def test_mixed_site_and_non_site(self, tmpdir):
"""
Installing two packages sharing the same namespace, one installed
with test.test.paths_on_pythonpath(map(str, targets)):
subprocess.check_call(try_import)
- @pytest.mark.skipif(bool(os.environ.get("APPVEYOR")),
- reason="https://github.com/pypa/setuptools/issues/851")
def test_pkg_resources_import(self, tmpdir):
"""
Ensure that a namespace package doesn't break on import
with test.test.paths_on_pythonpath([str(target)]):
subprocess.check_call(try_import)
- @pytest.mark.skipif(bool(os.environ.get("APPVEYOR")),
- reason="https://github.com/pypa/setuptools/issues/851")
def test_namespace_package_installed_and_cwd(self, tmpdir):
"""
Installing a namespace packages but also having it in the current
]
with test.test.paths_on_pythonpath([str(target)]):
subprocess.check_call(pkg_resources_imp, cwd=str(pkg_A))
+
+ def test_packages_in_the_same_namespace_installed_and_cwd(self, tmpdir):
+ """
+ Installing one namespace package and also have another in the same
+ namespace in the current working directory, both of them must be
+ importable.
+ """
+ pkg_A = namespaces.build_namespace_package(tmpdir, 'myns.pkgA')
+ pkg_B = namespaces.build_namespace_package(tmpdir, 'myns.pkgB')
+ target = tmpdir / 'packages'
+ # use pip to install to the target directory
+ install_cmd = [
+ sys.executable,
+ '-m',
+ 'pip.__main__',
+ 'install',
+ str(pkg_A),
+ '-t', str(target),
+ ]
+ subprocess.check_call(install_cmd)
+ namespaces.make_site_dir(target)
+
+ # ensure that all packages import and pkg_resources imports
+ pkg_resources_imp = [
+ sys.executable,
+ '-c', 'import pkg_resources; import myns.pkgA; import myns.pkgB',
+ ]
+ with test.test.paths_on_pythonpath([str(target)]):
+ subprocess.check_call(pkg_resources_imp, cwd=str(pkg_B))