Skip to content

Commit

Permalink
Update stdeb.cfg from setup.py (to avoid duplicate dependencies)
Browse files Browse the repository at this point in the history
  • Loading branch information
xolox committed Nov 30, 2016
1 parent 12083cc commit 7e360ee
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
19 changes: 15 additions & 4 deletions setup.py
Expand Up @@ -3,7 +3,7 @@
# Setup script for the `vcs-repo-mgr' package.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: October 25, 2016
# Last Change: November 30, 2016
# URL: https://github.com/xolox/python-vcs-repo-mgr

"""
Expand All @@ -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
Expand Down Expand Up @@ -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)


Expand Down Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion stdeb.cfg
@@ -1,3 +1,2 @@
[vcs-repo-mgr]
Depends: bzr, git | git-core, mercurial
XS-Python-Version: >= 2.6
4 changes: 2 additions & 2 deletions vcs_repo_mgr/__init__.py
@@ -1,7 +1,7 @@
# Version control system repository manager.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: October 26, 2016
# Last Change: November 30, 2016
# URL: https://github.com/xolox/python-vcs-repo-mgr

"""
Expand Down Expand Up @@ -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)."""
Expand Down

0 comments on commit 7e360ee

Please sign in to comment.