forked from elcorto/imagecluster
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·57 lines (49 loc) · 1.84 KB
/
Copy pathsetup.py
File metadata and controls
executable file
·57 lines (49 loc) · 1.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
#!/usr/bin/env python3
# publish on pypi
# ---------------
# $ python3 setup.py sdist
# $ twine upload dist/imagecluster-x.y.z.tar.gz
import os, importlib
from setuptools import setup
from distutils.version import StrictVersion as Version
here = os.path.abspath(os.path.dirname(__file__))
bindir = 'bin'
with open(os.path.join(here, 'README.rst')) as fd:
long_description = fd.read()
# Hack to make pip respect system packages.
install_requires = []
# (pip name, import name, operator, version)
# ('numpy', 'numpy', '>', '1.0')
reqs = [('numpy', 'numpy', None, None),
('tensorflow', 'tensorflow', None, None),
('keras', 'keras', None, None),
('Pillow', 'PIL', None, None),
]
for pip_name,import_name,op,ver in reqs:
print("checking dependency: {}".format(import_name))
req = pip_name + op + ver if op and ver else pip_name
try:
pkg = importlib.import_module(import_name)
if op and ver:
cmd = "Version(pkg.__version__) {op} Version('{ver}')".format(op=op,
ver=ver)
if not eval(cmd):
install_requires.append(req)
except ImportError:
install_requires.append(req)
print("install_requires: {}".format(install_requires))
setup(
name='imagecluster',
version='0.0.0',
description='cluster images based on image content using a pre-trained ' \
'deep neural network and hierarchical clustering',
long_description=long_description,
url='https://github.com/elcorto/imagecluster',
author='Steve Schmerler',
author_email='git@elcorto.com',
license='BSD 3-Clause',
keywords='image cluster vgg16 deep-learning',
packages=['imagecluster'],
install_requires=install_requires,
## scripts=['{}/{}'.format(bindir, script) for script in os.listdir(bindir)]
)