-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
76 lines (64 loc) · 2.25 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
#!/usr/bin/env python
from pathlib import Path
from setuptools import find_packages, setup
# Version
version = None
with open(Path(__file__).parent / "ipybuilding" / "_version.py", "r") as file:
for line in file:
line = line.strip()
if line.startswith("__version__"):
version = line.split("=")[1].strip().strip("'")
break
if version is None:
raise RuntimeError("Could not determine version.")
# Descriptions
short_description = "A simple open source Python package"
long_description_file = Path(__file__).parent / "README.md"
with open(long_description_file, "r", encoding="utf8") as file:
long_description = file.read()
if long_description_file.suffix == ".md":
long_description_content_type = "text/markdown"
elif long_description_file.suffix == ".rst":
long_description_content_type = "text/x-rst"
else:
long_description_content_type = "text/plain"
# Dependencies
def get_requirements(path):
"""Get mandatory dependencies from file."""
install_requires = list()
with open(path, "r") as file:
for line in file:
if line.startswith("#"):
continue
req = line.strip()
if len(line) == 0:
continue
install_requires.append(req)
return install_requires
install_requires = get_requirements("requirements.txt")
setup(
name="ipybuilding",
version=version,
author="Victor Férat, Jonathan Chambers",
author_email="victor.ferat@unige.ch",
description=short_description,
long_description=long_description,
long_description_content_type=long_description_content_type,
url="https://https://github.com/vferat/ipybuilding",
license="BSD-3-Clause",
platforms="any",
python_requires=">=3.7",
install_requires=install_requires,
packages=find_packages(exclude=["docs", "tests"]),
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
],
# Include other files
include_package_data=True,
)