Skip to content

Commit

Permalink
Changes to remove python2 support and upgrade the tensorflow version …
Browse files Browse the repository at this point in the history
…to avoid a CVE high severity issue (#383)
  • Loading branch information
karlmutch committed Jan 30, 2020
1 parent 0f455b3 commit e14f8f0
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
5 changes: 3 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ pillow
flask
jinja2

pyyaml
cma

apscheduler
Expand Down
34 changes: 33 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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=[
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion test_requirements.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e14f8f0

Please sign in to comment.