-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
54 lines (43 loc) · 1.7 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
## setup.py file for vqt
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()
## Get README.md
with open(str(dir_parent / "README.md"), "r") as f:
readme = f.read()
## Get version number
with open(str(dir_parent / "vqt" / "__init__.py"), "r") as f:
for line in f:
if line.startswith("__version__"):
version = line.split("=")[1].strip().replace("\"", "").replace("\'", "")
break
setup(
name='vqt',
version=version,
author='Richard Hakim',
keywords=['neuroscience', 'neuroimaging', 'machine learning', 'deep learning'],
license='LICENSE',
description='Variable Q-Transform with PyTorch backend',
long_description=readme,
long_description_content_type="text/markdown",
url='https://github.com/RichieHakim/vqt',
packages=[
'vqt',
],
install_requires=deps_all,
# extras_require={},
)