Skip to content

Commit

Permalink
Merge b1ab446 into f5b7ff6
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianWilhelm committed Aug 16, 2018
2 parents f5b7ff6 + b1ab446 commit b65b019
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Requirements
============

The installation of PyScaffold only requires a recent version of `setuptools`_,
i.e. at least version 31, as well as a working installation of `Git`_.
i.e. at least version 38.3, as well as a working installation of `Git`_.
Especially Windows users should make sure that the command ``git`` is available on
the command line. Otherwise, check and update your ``PATH`` environment
variable or run PyScaffold from the *Git Bash*.
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ python_requires = >=3.4
include_package_data = True
package_dir =
=src
install_requires = setuptools>=31
install_requires = setuptools>=38.3

[options.packages.find]
where = src
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ def bootstrap_cfg():
src_dir = os.path.join(__location__, 'src')
egg_info_dir = os.path.join(__location__, 'PyScaffold.egg-info')
has_entrypoints = os.path.isdir(egg_info_dir)
import pkg_resources

sys.path.insert(0, src_dir)
pkg_resources.working_set.add_entry(src_dir)
from pyscaffold.utils import check_setuptools_version
from pyscaffold.contrib.setuptools_scm import get_version
from pyscaffold.contrib.setuptools_scm.hacks import parse_pkginfo
Expand Down
2 changes: 1 addition & 1 deletion src/pyscaffold/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class OldSetuptools(RuntimeError):
"""PyScaffold requires a recent version of setuptools."""

DEFAULT_MESSAGE = (
"Your setuptools version is too old (<31). "
"Your setuptools version is too old (<38.3). "
"Use `pip install -U setuptools` to upgrade.\n"
"If you have the deprecated `distribute` package installed "
"remove it or update to version 0.7.3.")
Expand Down
9 changes: 9 additions & 0 deletions src/pyscaffold/templates/setup_py.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,17 @@
PyScaffold helps you to put up the scaffold of your new Python project.
Learn more under: https://pyscaffold.org/
"""
import sys

from pkg_resources import require, VersionConflict
from setuptools import setup

try:
require('setuptools>=38.3')
except VersionConflict:
print("Error: version of setuptools is too old (<38.3)!")
sys.exit(1)


if __name__ == "__main__":
setup(use_pyscaffold=True)
2 changes: 1 addition & 1 deletion src/pyscaffold/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def check_setuptools_version():
except ImportError:
raise OldSetuptools

setuptools_too_old = parse_version(setuptools_ver) < parse_version('31')
setuptools_too_old = parse_version(setuptools_ver) < parse_version('38.3')
setuptools_scm_check_failed = VERSION_CLASS is None
if setuptools_too_old or setuptools_scm_check_failed:
raise OldSetuptools
Expand Down

0 comments on commit b65b019

Please sign in to comment.