-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathsetup.py
More file actions
81 lines (76 loc) · 2.84 KB
/
setup.py
File metadata and controls
81 lines (76 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
"""
The setup package to install TensorPy dependencies.
*> This does NOT include TensorFlow installation.
*> To install TensorFlow, use "./install.sh"
"""
from setuptools import setup, find_packages # noqa
import os
import sys
this_directory = os.path.abspath(os.path.dirname(__file__))
long_description = None
try:
with open(os.path.join(this_directory, 'README.md'), 'rb') as f:
long_description = f.read().decode('utf-8')
except IOError:
long_description = 'Easy Image Classification with TensorFlow!'
if sys.argv[-1] == 'publish':
reply = None
input_method = input
if not sys.version_info[0] >= 3:
input_method = raw_input # noqa
reply = str(input_method(
'>>> Confirm release PUBLISH to PyPI? (yes/no): ')).lower().strip()
if reply == 'yes':
print("\n*** Checking code health with flake8:\n")
flake8_status = os.system("flake8 --exclude=temp")
if flake8_status != 0:
print("\nWARNING! Fix flake8 issues before publishing to PyPI!\n")
sys.exit()
else:
print("*** No flake8 issues detected. Continuing...")
print("\n*** Rebuilding distribution packages: ***\n")
os.system('rm -f dist/*.egg; rm -f dist/*.tar.gz; rm -f dist/*.whl')
os.system('python setup.py sdist bdist_wheel') # Create new tar/wheel
print("\n*** Installing twine: *** (Required for PyPI uploads)\n")
os.system("python -m pip install --upgrade 'twine>=1.15.0'")
print("\n*** Installing tqdm: *** (Required for PyPI uploads)\n")
os.system("python -m pip install --upgrade 'tqdm>=4.49.0'")
print("\n*** Publishing The Release to PyPI: ***\n")
os.system('python -m twine upload dist/*') # Requires ~/.pypirc Keys
print("\n*** The Release was PUBLISHED SUCCESSFULLY to PyPI! :) ***\n")
else:
print("\n>>> The Release was NOT PUBLISHED to PyPI! <<<\n")
sys.exit()
setup(
name='tensorpy',
version='1.6.1',
description='Easy Image Classification with TensorFlow!',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/TensorPy/TensorPy',
platforms=["Linux", "Unix", "Mac OS-X"],
author='Michael Mintz',
author_email='mdmintz@gmail.com',
maintainer='Michael Mintz',
license="MIT",
classifiers=[
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
],
python_requires='>=3.5, <3.8',
install_requires=[
'tensorflow==1.15.4',
'pip>=20.2.3',
'six>=1.15.0',
'requests>=2.24.0',
'Pillow==7.2.0',
'beautifulsoup4==4.9.2',
],
packages=['tensorpy'],
entry_points={
'console_scripts': [
'classify = tensorpy.classify:main',
],
},
)