-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
118 lines (82 loc) · 3.74 KB
/
setup.py
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
## setup.py file for roicat
from pathlib import Path
from distutils.core import setup
## Get the parent directory of this file
dir_parent = Path(__file__).parent
## Get requirements from requirements.txt
def read_requirements():
with open(str(dir_parent / "requirements.txt"), "r") as req:
content = req.read() ## read the file
requirements = content.split("\n") ## make a list of requirements split by (\n) which is the new line character
## Filter out any empty strings from the list
requirements = [req for req in requirements if req]
## Filter out any lines starting with #
requirements = [req for req in requirements if not req.startswith("#")]
## Remove any commas, quotation marks, and spaces from each requirement
requirements = [req.replace(",", "").replace("\"", "").replace("\'", "").strip() for req in requirements]
return requirements
deps_all = read_requirements()
## Dependencies: latest versions of requirements
### remove everything starting and after the first =,>,<,! sign
deps_names = [req.split('=')[0].split('>')[0].split('<')[0].split('!')[0] for req in deps_all]
deps_all_dict = dict(zip(deps_names, deps_all))
deps_all_latest = dict(zip(deps_names, deps_names))
## Get README.md
with open(str(dir_parent / "README.md"), "r") as f:
readme = f.read()
## Get version number
with open(str(dir_parent / "sparse_convolution" / "__init__.py"), "r") as f:
for line in f:
if line.startswith("__version__"):
version = line.split("=")[1].strip().replace("\"", "").replace("\'", "")
break
setup(
name='sparse_convolution',
version=version,
description='Sparse convolution in python using Toeplitz convolution matrix multiplication.',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
# The project's main homepage.
url='https://github.com/RichieHakim/sparse_convolution',
# Author details
author='Richard Hakim',
author_email='[email protected]',
# Choose your license
license='MIT',
# Supported platforms
platforms=['Any'],
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 5 - Production/Stable',
# Indicate who your project is intended for
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Bio-Informatics',
# Pick your license as you wish (should match "license" above)
# 'License :: OSI Approved :: MIT License',
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
# 'Programming Language :: Python :: 2',
# 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
# 'Programming Language :: Python :: 3.6',
# 'Programming Language :: Python :: 3.7'
],
# What does your project relate to?
keywords='sparse convolution Toeplitz python',
# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
packages=['sparse_convolution'],
# Alternatively, if you want to distribute just a my_module.py, uncomment
# this:
# py_modules=["my_module"],
# List run-time dependencies here. These will be installed by pip when
# your project is installed. For an analysis of "install_requires" vs pip's
# requirements files see:
# https://packaging.python.org/en/latest/requirements.html
install_requires=list(deps_all_dict.values()),
include_package_data=True,
)