diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2015-12-16 08:25:05 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-12-16 08:25:05 -0500 |
commit | 1bf92e3a3cc1e246b1ecc05c63287bb177939efa (patch) | |
tree | 8a1be21ad74536247cb560543e605c8dfc96cdac | |
parent | cfcfccb6c78490ed368fa08d7ee84418ac4706a6 (diff) | |
download | external_python_setuptools-1bf92e3a3cc1e246b1ecc05c63287bb177939efa.tar.gz external_python_setuptools-1bf92e3a3cc1e246b1ecc05c63287bb177939efa.tar.bz2 external_python_setuptools-1bf92e3a3cc1e246b1ecc05c63287bb177939efa.zip |
Experiment with using setuptools_scm for release management. This approach drastically simplifies the codebase, but imposes an initial dependency at install time, which could prove problemmatic in scenarios where connectivity is limited. This approach may not be viable for real-world consumption, but I'm committing it in this branch for consideration with no plans to release it without more testing and discussion.
-rw-r--r-- | docs/conf.py | 10 | ||||
-rw-r--r-- | release.py | 20 | ||||
-rwxr-xr-x | setup.cfg | 7 | ||||
-rwxr-xr-x | setup.py | 8 | ||||
-rw-r--r-- | setuptools/__init__.py | 4 | ||||
-rw-r--r-- | setuptools/version.py | 1 |
6 files changed, 8 insertions, 42 deletions
diff --git a/docs/conf.py b/docs/conf.py index c2a63873..846e4b3e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,11 +18,7 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -# Allow Sphinx to find the setup command that is imported below, as referenced above. -import sys, os -sys.path.append(os.path.abspath('..')) - -import setup as setup_script +import setuptools_scm # -- General configuration ----------------------------------------------------- @@ -51,9 +47,9 @@ copyright = '2009-2014, The fellowship of the packaging' # built documents. # # The short X.Y version. -version = setup_script.setup_params['version'] +version = setuptools_scm.get_version(root='..', relative_to=__file__) # The full version, including alpha/beta/rc tags. -release = setup_script.setup_params['version'] +release = version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/release.py b/release.py deleted file mode 100644 index dd1d6a1c..00000000 --- a/release.py +++ /dev/null @@ -1,20 +0,0 @@ -""" -Setuptools is released using 'jaraco.packaging.release'. To make a release, -install jaraco.packaging and run 'python -m jaraco.packaging.release' -""" - -import os - -import pkg_resources - -pkg_resources.require('jaraco.packaging>=2.0') -pkg_resources.require('wheel') - -files_with_versions = 'setuptools/version.py', - -# bdist_wheel must be included or pip will break -dist_commands = 'sdist', 'bdist_wheel' - -test_info = "Travis-CI tests: http://travis-ci.org/#!/jaraco/setuptools" - -os.environ["SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES"] = "1" @@ -1,10 +1,5 @@ -[egg_info] -tag_build = dev - [aliases] -release = egg_info -RDb '' -source = register sdist binary -binary = bdist_egg upload --show-response +release = sdist bdist_wheel upload build_sphinx upload_docs test = pytest [build_sphinx] @@ -22,11 +22,6 @@ with open(init_path) as init_file: SETUP_COMMANDS = command_ns['__all__'] -main_ns = {} -ver_path = convert_path('setuptools/version.py') -with open(ver_path) as ver_file: - exec(ver_file.read(), main_ns) - import setuptools scripts = [] @@ -70,7 +65,7 @@ sphinx = ['sphinx', 'rst.linker'] if needs_sphinx else [] setup_params = dict( name="setuptools", - version=main_ns['__version__'], + use_scm_version=True, description="Easily download, build, install, upgrade, and uninstall " "Python packages", author="Python Packaging Authority", @@ -162,6 +157,7 @@ setup_params = dict( 'pytest>=2.8', ] + (['mock'] if sys.version_info[:2] < (3, 3) else []), setup_requires=[ + 'setuptools_scm>=1.9', ] + sphinx + pytest_runner, ) diff --git a/setuptools/__init__.py b/setuptools/__init__.py index 712ec082..b0a5401f 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -8,7 +8,7 @@ from distutils.core import Command as _Command from distutils.util import convert_path from fnmatch import fnmatchcase -import setuptools.version +import pkg_resources from setuptools.extension import Extension from setuptools.dist import Distribution, Feature, _get_unpatched from setuptools.depends import Require @@ -19,7 +19,7 @@ __all__ = [ 'find_packages' ] -__version__ = setuptools.version.__version__ +__version__ = pkg_resources.require('setuptools')[0].version bootstrap_install_from = None diff --git a/setuptools/version.py b/setuptools/version.py deleted file mode 100644 index 16f3f638..00000000 --- a/setuptools/version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = '19.2' |