From 80d29ed93d0ee3ea95ea921ae38e59bb86d4f627 Mon Sep 17 00:00:00 2001 From: Patrick Lannigan Date: Mon, 2 Jan 2017 08:15:40 -0500 Subject: Document use of environment markers in extras_require --- docs/setuptools.txt | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/setuptools.txt b/docs/setuptools.txt index 2f78b133..94ee09ad 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -769,6 +769,38 @@ so that Package B doesn't have to remove the ``[PDF]`` from its requirement specifier. +.. _Platform Specific Dependencies: + + +Declaring platform specific dependencies +---------------------------------------- + +Sometimes a project might require a dependency to run on a specific platform. +This could to a package that back ports a module so that it can be used in +older python versions. Or it could be a package that is required to run on a +specific operating system. This will allow a project to work on multiple +different platforms without installing dependencies that are not required for +a platform that is installing the project. + +For example, here is a project that uses the ``enum`` module and ``pywin32``:: + + setup( + name="Project", + ... + extras_require={ + ':python_version < "3.4"': ["enum34"], + ':sys_platform == "win32"': ["pywin32 >= 1.0"] + } + ) + +Since the ``enum`` module was added in python 3.4, it should only be installed +if the python version is earlier. Since ``pywin32`` will only be used on +windows, it should only be installed when the operating system is Windows. +Specifying version requirements for the dependencies is supported as normal. + +The environmental markers that may be used for testing platform types are +detailed in PEP 496. + Including Data Files ==================== -- cgit v1.2.1 From dc8683bd8e8600680a7581fd3a2d34ba8f1fa0ab Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 2 Jan 2017 09:29:42 -0500 Subject: More aggressively remove references to 'tag_svn_revision' option in egg_info. Ref #619. --- setup.cfg | 2 +- setuptools/command/egg_info.py | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/setup.cfg b/setup.cfg index e46be52a..406aa4f9 100755 --- a/setup.cfg +++ b/setup.cfg @@ -8,7 +8,7 @@ tag_build = .post tag_date = 1 [aliases] -clean_egg_info = egg_info -RDb '' +clean_egg_info = egg_info -Db '' release = clean_egg_info sdist bdist_wheel source = register sdist binary binary = bdist_egg upload --show-response diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 98a87300..e3578074 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -121,18 +121,13 @@ class egg_info(Command): user_options = [ ('egg-base=', 'e', "directory containing .egg-info directories" " (default: top of the source tree)"), - ('tag-svn-revision', 'r', - "Add subversion revision ID to version number"), ('tag-date', 'd', "Add date stamp (e.g. 20050528) to version number"), ('tag-build=', 'b', "Specify explicit tag to add to version number"), - ('no-svn-revision', 'R', - "Don't add subversion revision ID [default]"), ('no-date', 'D', "Don't include date stamp [default]"), ] - boolean_options = ['tag-date', 'tag-svn-revision'] + boolean_options = ['tag-date'] negative_opt = { - 'no-svn-revision': 'tag-svn-revision', 'no-date': 'tag-date', } @@ -148,8 +143,8 @@ class egg_info(Command): def save_version_info(self, filename): """ - Materialize the values of svn_revision and date into the - build tag. Install these keys in a deterministic order + Materialize the value of date into the + build tag. Install build keys in a deterministic order to avoid arbitrary reordering on subsequent builds. """ # python 2.6 compatibility -- cgit v1.2.1 From b848627d17328cab9bdce4fabd314c76d5f7d96e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 2 Jan 2017 09:56:47 -0500 Subject: Add a no-op property for 'tag_svn_revision' to suppress errors when distutils attempts to detect and set these values based on settings in setup.cfg as found in sdists built by earlier versions of setuptools. Ref #619. --- setuptools/command/egg_info.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index e3578074..ca6a4348 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -141,6 +141,18 @@ class egg_info(Command): self.broken_egg_info = False self.vtags = None + #################################### + # allow the 'tag_svn_revision' to be detected and + # set, supporting sdists built on older Setuptools. + @property + def tag_svn_revision(self): + pass + + @tag_svn_revision.setter + def tag_svn_revision(self, value): + pass + #################################### + def save_version_info(self, filename): """ Materialize the value of date into the -- cgit v1.2.1 From 76e888d72b178880d62a731da52b9a3a51832a4f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 2 Jan 2017 10:16:27 -0500 Subject: Remove references to SVN sandbox. --- docs/setuptools.txt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/setuptools.txt b/docs/setuptools.txt index 2f78b133..7dcbb6f2 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -59,14 +59,6 @@ Feature Highlights: * Create extensible applications and frameworks that automatically discover extensions, using simple "entry points" declared in a project's setup script. -In addition to the PyPI downloads, the development version of ``setuptools`` -is available from the `Python SVN sandbox`_, and in-development versions of the -`0.6 branch`_ are available as well. - -.. _0.6 branch: http://svn.python.org/projects/sandbox/branches/setuptools-0.6/#egg=setuptools-dev06 - -.. _Python SVN sandbox: http://svn.python.org/projects/sandbox/trunk/setuptools/#egg=setuptools-dev - .. contents:: **Table of Contents** .. _ez_setup.py: `bootstrap module`_ -- cgit v1.2.1 From 8db1d2d4f72f347f3fd5a9d8cf4a225173251318 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 2 Jan 2017 10:22:37 -0500 Subject: Remove documentation about tag-svn-revision. Ref #619. --- docs/setuptools.txt | 102 ++++------------------------------------------------ 1 file changed, 7 insertions(+), 95 deletions(-) diff --git a/docs/setuptools.txt b/docs/setuptools.txt index 7dcbb6f2..458ad59b 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -1414,10 +1414,6 @@ egg distributions by adding one or more of the following to the project's manually-specified post-release tag, such as a build or revision number (``--tag-build=STRING, -bSTRING``) -* A "last-modified revision number" string generated automatically from - Subversion's metadata (assuming your project is being built from a Subversion - "working copy") (``--tag-svn-revision, -r``) - * An 8-character representation of the build date (``--tag-date, -d``), as a postrelease tag @@ -1549,68 +1545,6 @@ this:: in order to check out the in-development version of ``projectname``. -Managing "Continuous Releases" Using Subversion ------------------------------------------------ - -If you expect your users to track in-development versions of your project via -Subversion, there are a few additional steps you should take to ensure that -things work smoothly with EasyInstall. First, you should add the following -to your project's ``setup.cfg`` file: - -.. code-block:: ini - - [egg_info] - tag_build = .dev - tag_svn_revision = 1 - -This will tell ``setuptools`` to generate package version numbers like -``1.0a1.dev-r1263``, which will be considered to be an *older* release than -``1.0a1``. Thus, when you actually release ``1.0a1``, the entire egg -infrastructure (including ``setuptools``, ``pkg_resources`` and EasyInstall) -will know that ``1.0a1`` supersedes any interim snapshots from Subversion, and -handle upgrades accordingly. - -(Note: the project version number you specify in ``setup.py`` should always be -the *next* version of your software, not the last released version. -Alternately, you can leave out the ``tag_build=.dev``, and always use the -*last* release as a version number, so that your post-1.0 builds are labelled -``1.0-r1263``, indicating a post-1.0 patchlevel. Most projects so far, -however, seem to prefer to think of their project as being a future version -still under development, rather than a past version being patched. It is of -course possible for a single project to have both situations, using -post-release numbering on release branches, and pre-release numbering on the -trunk. But you don't have to make things this complex if you don't want to.) - -Commonly, projects releasing code from Subversion will include a PyPI link to -their checkout URL (as described in the previous section) with an -``#egg=projectname-dev`` suffix. This allows users to request EasyInstall -to download ``projectname==dev`` in order to get the latest in-development -code. Note that if your project depends on such in-progress code, you may wish -to specify your ``install_requires`` (or other requirements) to include -``==dev``, e.g.: - -.. code-block:: python - - install_requires=["OtherProject>=0.2a1.dev-r143,==dev"] - -The above example says, "I really want at least this particular development -revision number, but feel free to follow and use an ``#egg=OtherProject-dev`` -link if you find one". This avoids the need to have actual source or binary -distribution snapshots of in-development code available, just to be able to -depend on the latest and greatest a project has to offer. - -A final note for Subversion development: if you are using SVN revision tags -as described in this section, it's a good idea to run ``setup.py develop`` -after each Subversion checkin or update, because your project's version number -will be changing, and your script wrappers need to be updated accordingly. - -Also, if the project's requirements have changed, the ``develop`` command will -take care of fetching the updated dependencies, building changed extensions, -etc. Be sure to also remind any of your users who check out your project -from Subversion that they need to run ``setup.py develop`` after every update -in order to keep their checkout completely in sync. - - Making "Official" (Non-Snapshot) Releases ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1624,18 +1558,18 @@ tagging the release, so the trunk will still produce development snapshots. Alternately, if you are not branching for releases, you can override the default version options on the command line, using something like:: - python setup.py egg_info -RDb "" sdist bdist_egg register upload + python setup.py egg_info -Db "" sdist bdist_egg register upload -The first part of this command (``egg_info -RDb ""``) will override the +The first part of this command (``egg_info -Db ""``) will override the configured tag information, before creating source and binary eggs, registering the project with PyPI, and uploading the files. Thus, these commands will use -the plain version from your ``setup.py``, without adding the Subversion -revision number or build designation string. +the plain version from your ``setup.py``, without adding the build designation +string. Of course, if you will be doing this a lot, you may wish to create a personal alias for this operation, e.g.:: - python setup.py alias -u release egg_info -RDb "" + python setup.py alias -u release egg_info -Db "" You can then use it like this:: @@ -1695,8 +1629,7 @@ the command line supplies its expansion. For example, this command defines a sitewide alias called "daily", that sets various ``egg_info`` tagging options:: - setup.py alias --global-config daily egg_info --tag-svn-revision \ - --tag-build=development + setup.py alias --global-config daily egg_info --tag-build=development Once the alias is defined, it can then be used with other setup commands, e.g.:: @@ -1706,7 +1639,7 @@ e.g.:: setup.py daily sdist bdist_egg # generate both The above commands are interpreted as if the word ``daily`` were replaced with -``egg_info --tag-svn-revision --tag-build=development``. +``egg_info --tag-build=development``. Note that setuptools will expand each alias *at most once* in a given command line. This serves two purposes. First, if you accidentally create an alias @@ -1993,27 +1926,6 @@ added in the following order: it on the command line using ``-b ""`` or ``--tag-build=""`` as an argument to the ``egg_info`` command. -``--tag-svn-revision, -r`` - If the current directory is a Subversion checkout (i.e. has a ``.svn`` - subdirectory, this appends a string of the form "-rNNNN" to the project's - version string, where NNNN is the revision number of the most recent - modification to the current directory, as obtained from the ``svn info`` - command. - - If the current directory is not a Subversion checkout, the command will - look for a ``PKG-INFO`` file instead, and try to find the revision number - from that, by looking for a "-rNNNN" string at the end of the version - number. (This is so that building a package from a source distribution of - a Subversion snapshot will produce a binary with the correct version - number.) - - If there is no ``PKG-INFO`` file, or the version number contained therein - does not end with ``-r`` and a number, then ``-r0`` is used. - -``--no-svn-revision, -R`` - Don't include the Subversion revision in the version number. This option - is included so you can override a default setting put in ``setup.cfg``. - ``--tag-date, -d`` Add a date stamp of the form "-YYYYMMDD" (e.g. "-20050528") to the project's version number. -- cgit v1.2.1 From 78339bc0d77649f47be496879e4a5f768657d229 Mon Sep 17 00:00:00 2001 From: Patrick Lannigan Date: Mon, 2 Jan 2017 16:40:22 -0500 Subject: Have documentation link to referenced PEP. --- docs/setuptools.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/setuptools.txt b/docs/setuptools.txt index 94ee09ad..5dd30b13 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -799,7 +799,9 @@ windows, it should only be installed when the operating system is Windows. Specifying version requirements for the dependencies is supported as normal. The environmental markers that may be used for testing platform types are -detailed in PEP 496. +detailed in `PEP 496`_. + +.. _PEP 496: https://www.python.org/dev/peps/pep-0496/ Including Data Files ==================== -- cgit v1.2.1 From 37a48e9a7a5ae5ac770b05b8f1ff52bdceda3cae Mon Sep 17 00:00:00 2001 From: Patrick Lannigan Date: Mon, 2 Jan 2017 21:21:01 -0500 Subject: Document use of install_requires with corrected PEP PEP 496 is a draft that was never accepted, so it does not have the correct information. --- docs/setuptools.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/setuptools.txt b/docs/setuptools.txt index 5dd30b13..601628b4 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -787,21 +787,21 @@ For example, here is a project that uses the ``enum`` module and ``pywin32``:: setup( name="Project", ... - extras_require={ - ':python_version < "3.4"': ["enum34"], - ':sys_platform == "win32"': ["pywin32 >= 1.0"] - } + install_requires=[ + 'enum34;python_version<"3.4"', + 'pywin32 >= 1.0;platform_system=="Windows"' + ] ) -Since the ``enum`` module was added in python 3.4, it should only be installed +Since the ``enum`` module was added in Python 3.4, it should only be installed if the python version is earlier. Since ``pywin32`` will only be used on windows, it should only be installed when the operating system is Windows. Specifying version requirements for the dependencies is supported as normal. The environmental markers that may be used for testing platform types are -detailed in `PEP 496`_. +detailed in `PEP 508`_. -.. _PEP 496: https://www.python.org/dev/peps/pep-0496/ +.. _PEP 508: https://www.python.org/dev/peps/pep-0508/ Including Data Files ==================== -- cgit v1.2.1 From bb2251bae83b072cd972f6865198d70272e7a824 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 7 Jan 2017 13:08:56 -0500 Subject: Include tox.ini in the sdist. Ref #904. --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index e25a5ea5..325bbed8 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -11,3 +11,4 @@ include LICENSE include launcher.c include msvc-build-launcher.cmd include pytest.ini +include tox.ini -- cgit v1.2.1 From 93d8715bff84449b62c2439dfa5845a9d12006e1 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 7 Jan 2017 13:10:31 -0500 Subject: Remove pytest alias. Use tox to run tests. Ref #904. --- setup.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 406aa4f9..74d7e085 100755 --- a/setup.cfg +++ b/setup.cfg @@ -12,7 +12,6 @@ clean_egg_info = egg_info -Db '' release = clean_egg_info sdist bdist_wheel source = register sdist binary binary = bdist_egg upload --show-response -test = pytest [upload] repository = https://upload.pypi.org/legacy/ -- cgit v1.2.1 From 9c4d84f53e96b023c79ef54b8092a8c1440212ab Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 7 Jan 2017 13:19:31 -0500 Subject: Update documentation references from removed pythonhosted docs to RTD. Fixes #903. --- CHANGES.rst | 10 +++++----- README.rst | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 264b939a..8c214db3 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -97,7 +97,7 @@ v30.3.0 * #394 via #862: Added support for `declarative package config in a setup.cfg file - `_. + `_. v30.2.1 ------- @@ -708,7 +708,7 @@ v20.6.0 `semver `_ precisely. The 'v' prefix on version numbers now also allows version numbers to be referenced in the changelog, - e.g. https://pythonhosted.org/setuptools/history.html#v20-6-0. + e.g. http://setuptools.readthedocs.io/en/latest/history.html#v20-6-0. 20.5 ---- @@ -788,7 +788,7 @@ v20.6.0 * Added support for using passwords from keyring in the upload command. See `the upload docs - `_ + `_ for details. 20.0 @@ -1542,7 +1542,7 @@ process to fail and PyPI uploads no longer accept files for 13.0. --- * Added a `Developer Guide - `_ to the official + `_ to the official documentation. * Some code refactoring and cleanup was done with no intended behavioral changes. @@ -2962,7 +2962,7 @@ easy_install * ``setuptools`` now finds its commands, ``setup()`` argument validators, and metadata writers using entry points, so that they can be extended by third-party packages. See `Creating distutils Extensions - `_ + `_ for more details. * The vestigial ``depends`` command has been removed. It was never finished diff --git a/README.rst b/README.rst index 9cb8758f..accaac3c 100755 --- a/README.rst +++ b/README.rst @@ -126,8 +126,8 @@ Use ``--help`` to get a full options list, but we recommend consulting the `EasyInstall manual`_ for detailed instructions, especially `the section on custom installation locations`_. -.. _EasyInstall manual: https://pythonhosted.org/setuptools/EasyInstall -.. _the section on custom installation locations: https://pythonhosted.org/setuptools/EasyInstall#custom-installation-locations +.. _EasyInstall manual: https://setuptools.readthedocs.io/en/latest/easy_install.html +.. _the section on custom installation locations: https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations Downloads -- cgit v1.2.1 From 3c182f9f1eea89040fbfc88d1ccbed31ece6a00b Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 7 Jan 2017 13:23:43 -0500 Subject: Remove documentation for upload_docs command, deprecated in v27. --- docs/setuptools.txt | 62 ----------------------------------------------------- 1 file changed, 62 deletions(-) diff --git a/docs/setuptools.txt b/docs/setuptools.txt index 5c72445b..2a494fca 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -2273,68 +2273,6 @@ password from the keyring. New in 20.1: Added keyring support. -.. _upload_docs: - -``upload_docs`` - Upload package documentation to PyPI -====================================================== - -PyPI now supports uploading project documentation to the dedicated URL -https://pythonhosted.org//. - -The ``upload_docs`` command 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 distutils ``register`` -command -- just like the ``upload`` command. - -Assuming there is an ``Example`` project with documentation in the -subdirectory ``docs``, e.g.:: - - Example/ - |-- example.py - |-- setup.cfg - |-- setup.py - |-- docs - | |-- build - | | `-- html - | | | |-- index.html - | | | `-- tips_tricks.html - | |-- conf.py - | |-- index.txt - | `-- tips_tricks.txt - -You can simply pass the documentation directory path to the ``upload_docs`` -command:: - - python setup.py upload_docs --upload-dir=docs/build/html - -If no ``--upload-dir`` is given, ``upload_docs`` will attempt to run the -``build_sphinx`` command to generate uploadable documentation. -For the command to become available, `Sphinx `_ -must be installed in the same environment as distribute. - -As with other ``setuptools``-based commands, you can define useful -defaults in the ``setup.cfg`` of your Python project, e.g.: - -.. code-block:: ini - - [upload_docs] - upload-dir = docs/build/html - -The ``upload_docs`` command has the following options: - -``--upload-dir`` - The directory to be uploaded to the repository. - -``--show-response`` - Display the full response text from server; this is useful for debugging - PyPI problems. - -``--repository=URL, -r URL`` - The URL of the repository to upload to. Defaults to - https://pypi.python.org/pypi (i.e., the main PyPI installation). - ----------------------------------------- Configuring setup() using setup.cfg files -- cgit v1.2.1