diff --git a/docs/installation.rst b/docs/installation.rst index ba7b8fd7..ed7ab6fe 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -94,8 +94,9 @@ When working with the pypi command line tooling you should create a The command to push a release is as follows. :: - - python setup.py sdist upload + pip install twine + python setup.py sdist bdist_wheel + twine upload dist/* If you wish to test releases and not pollute our pypi production release train and numbering, please use the '-r' option to specify the test pypi diff --git a/requirements.txt b/requirements.txt index a27095ef..56798dbc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,6 @@ pillow flask jinja2 -pyyaml cma apscheduler diff --git a/setup.py b/setup.py index 28aac308..cca9059a 100644 --- a/setup.py +++ b/setup.py @@ -13,6 +13,38 @@ import ctypes import pip +# **Python version check** +# +# This check is also made in IPython/__init__, don't forget to update both when +# changing Python version requirements. +if sys.version_info < (3, 4): + pip_message = 'This may be due to an out of date pip. Make sure you have pip >= 9.0.1.' + try: + import pip + pip_version = tuple([int(x) for x in pip.__version__.split('.')[:3]]) + if pip_version < (9, 0, 1) : + pip_message = 'Your pip version is out of date, please install pip >= 9.0.1. '\ + 'pip {} detected.'.format(pip.__version__) + else: + # pip is new enough - it must be something else + pip_message = '' + except Exception: + pass + + + error = """ +IPython 7.0+ supports Python 3.4 and above. +When using Python 2.7, please install IPython 5.x LTS Long Term Support version. +Python 3.3 was supported up to IPython 6.x. +See IPython `README.rst` file for more information: + https://github.com/ipython/ipython/blob/master/README.rst +Python {py} detected. +{pip} +""".format(py=sys.version_info, pip=pip_message ) + + print(error) + sys.exit(1) + def read(fname): try: with open(os.path.join(os.path.dirname(__file__), fname)) as f: @@ -131,6 +163,7 @@ def copyconfig(): use_scm_version={ "version_scheme": version_scheme, "local_scheme": local_scheme}, + python_requires='>=3.4', setup_requires=['setuptools_scm', 'setuptools_scm_git_archive'], cmdclass={'develop': MyDevelop, 'install': MyInstall}, classifiers=[ @@ -139,7 +172,6 @@ def copyconfig(): "Intended Audience :: Developers", "Intended Audience :: Science/Research", "Operating System :: POSIX :: Linux", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Utilities", diff --git a/test_requirements.txt b/test_requirements.txt index 31105d00..48697ebd 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -1,5 +1,5 @@ pycodestyle pytest_xdist -tensorflow<=1.12.3 +tensorflow<2.0,>=1.15.2 keras<=2.0.8 certifi==2018.1.18