-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py.in
113 lines (93 loc) · 4.29 KB
/
setup.py.in
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
from setuptools import find_packages
except ImportError:
from distutils.core import setup
from distutils.core import find_packages
def get_requires (requirements_filename):
'''
What packages are required for this module to be executed?
Parameters
----------
requirements_filename : str
filename of requirements (e.g requirements.txt)
Returns
-------
requirements : list
list of required packages
'''
with open(requirements_filename, 'r') as fp:
requirements = fp.read()
return list(filter(lambda x: x != '', requirements.split()))
def read_description (readme_filename):
'''
Description package from filename
Parameters
----------
readme_filename : str
filename with readme information (e.g README.md)
Returns
-------
description : str
str with description
'''
try:
with open(readme_filename, 'r') as fp:
description = '\n'
description += fp.read()
return description
except IOError:
return ''
# Author meta-data.
AUTHOR = "Nico Curti, Daniele Dall'Olio"
EMAIL = '[email protected]'
# Package meta-data.
REQUIRES_PYTHON = '>=2.7'
KEYWORDS = 'wsi, histology, pathomics, computer-vision, image-processing'
setup(
name = '@CMAKE_PROJECT_NAME@',
version = '@CMAKE_PROJECT_VERSION@',
description = '@CMAKE_PROJECT_DESCRIPTION@',
long_description = read_description('@CMAKE_SOURCE_DIR@/README.md'),
long_description_content_type = 'text/markdown',
author = AUTHOR,
author_email = EMAIL,
maintainer = AUTHOR,
maintainer_email = EMAIL,
python_requires = REQUIRES_PYTHON,
install_requires = get_requires('@CMAKE_SOURCE_DIR@/requirements.txt'),
url = '@CMAKE_PROJECT_HOMEPAGE_URL',
download_url = '@CMAKE_PROJECT_HOMEPAGE_URL',
keywords = KEYWORDS,
setup_requires = [# Setuptools 18.0 properly handles Cython extensions.
'setuptools>=18.0',
'cython'],
packages = find_packages(include=['scorer', 'scorer.*'], exclude=('test', 'example')),
package_data = {'scorer': ['lib/*.pxd', 'source/*.pyx', 'source/*.cpp'],},
include_package_data = True, # no absolute paths are allowed
data_files = [('', ['CMakeLists.txt', 'README.md', 'LICENSE', 'setup.py.in', 'Scorer.pc.in', 'ScorerConfig.cmake.in']),
('example', ['example/example.cpp']),
('cmake', ['cmake/modules/FindCython.cmake', 'cmake/modules/FindSphinx.cmake', 'cmake/modules/UseCython.cmake']),
('utils', ['utils/dependency_graph.py', 'utils/make_cython.py', 'utils/make_script.py', 'utils/sklearn_lut.conf', 'utils/view_stats.py'])
],
platforms = 'any',
classifiers = [
#'License :: OSI Approved :: GPL License',
'Natural Language :: English',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX',
'Operating System :: POSIX :: Linux',
'Operating System :: Microsoft :: Windows',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy'
],
license = 'MIT',
)