From 7e360eede2f37bb0c498086c2f56d6738d8d9a6d Mon Sep 17 00:00:00 2001 From: Peter Odding Date: Wed, 30 Nov 2016 23:23:24 +0100 Subject: [PATCH] Update stdeb.cfg from setup.py (to avoid duplicate dependencies) --- setup.py | 19 +++++++++++++++---- stdeb.cfg | 1 - vcs_repo_mgr/__init__.py | 4 ++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index eaf62e1..9bb4dd6 100755 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ # Setup script for the `vcs-repo-mgr' package. # # Author: Peter Odding -# Last Change: October 25, 2016 +# Last Change: November 30, 2016 # URL: https://github.com/xolox/python-vcs-repo-mgr """ @@ -28,6 +28,9 @@ # De-facto standard solution for Python packaging. from setuptools import find_packages, setup +PY2 = (sys.version_info[0] == 2) +""":data:`True` on Python 2, :data:`False` otherwise.""" + PYTHON_TWO_DEPS = ['bzr >= 2.6.0', 'mercurial >= 2.9'] """ The `vcs-repo-mgr` package depends on Bazaar and Mercurial which don't support @@ -58,9 +61,8 @@ def get_version(*args): def get_install_requires(): """Add conditional dependencies for Python 2 (when creating source distributions).""" install_requires = get_requirements('requirements.txt') - if 'bdist_wheel' not in sys.argv: - if sys.version_info[0] == 2: - install_requires.extend(PYTHON_TWO_DEPS) + if PY2 and 'bdist_wheel' not in sys.argv: + install_requires.extend(PYTHON_TWO_DEPS) return sorted(install_requires) @@ -106,6 +108,15 @@ def have_environment_marker_support(): return False +# When our installation requirements include Bazaar and Mercurial it is silly +# to also require the Bazaar and Mercurial system packages through stdeb.cfg +# so we overwrite the file to remove these dependencies. +if PY2: + with open(get_absolute_path('stdeb.cfg'), 'w') as handle: + handle.write('[vcs-repo-mgr]\n') + handle.write('Depends: git | git-core\n') + + setup(name='vcs-repo-mgr', version=get_version('vcs_repo_mgr', '__init__.py'), description="Version control repository manager", diff --git a/stdeb.cfg b/stdeb.cfg index 23a50ce..1567ce1 100644 --- a/stdeb.cfg +++ b/stdeb.cfg @@ -1,3 +1,2 @@ [vcs-repo-mgr] Depends: bzr, git | git-core, mercurial -XS-Python-Version: >= 2.6 diff --git a/vcs_repo_mgr/__init__.py b/vcs_repo_mgr/__init__.py index ad16122..d348f68 100644 --- a/vcs_repo_mgr/__init__.py +++ b/vcs_repo_mgr/__init__.py @@ -1,7 +1,7 @@ # Version control system repository manager. # # Author: Peter Odding -# Last Change: October 26, 2016 +# Last Change: November 30, 2016 # URL: https://github.com/xolox/python-vcs-repo-mgr """ @@ -110,7 +110,7 @@ ) # Semi-standard module versioning. -__version__ = '0.33' +__version__ = '0.33.1' USER_CONFIG_FILE = os.path.expanduser('~/.vcs-repo-mgr.ini') """The absolute pathname of the user-specific configuration file (a string)."""