Skip to content

Commit

Permalink
Raise for bad Python versions in the setup script; add relevant Trove…
Browse files Browse the repository at this point in the history
… classifiers.
  • Loading branch information
mdickinson committed Jan 13, 2017
1 parent 85142cc commit e578fa3
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions setup.py
Expand Up @@ -95,7 +95,28 @@ def write_version_py(filename='traits/_version.py'):
git_revision=git_rev,
is_released=IS_RELEASED))


def check_python_version():
"""
Check that this version of Python is supported.
Raise SystemExit for unsupported Python versions.
"""
supported_python_version = (
(2, 7) <= sys.version_info < (3,)
or (3, 4) <= sys.version_info
)
if not supported_python_version:
sys.exit(
(
"Python version {0} is not supported by Traits. "
"Traits requires Python >= 2.7 or Python >= 3.4."
).format(sys.version_info)
)


if __name__ == "__main__":
check_python_version()
write_version_py()
from traits import __version__

Expand Down Expand Up @@ -136,6 +157,13 @@ def additional_commands():
Operating System :: Unix
Programming Language :: C
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: Implementation :: CPython
Topic :: Scientific/Engineering
Topic :: Software Development
Topic :: Software Development :: Libraries
Expand Down

0 comments on commit e578fa3

Please sign in to comment.