-
Notifications
You must be signed in to change notification settings - Fork 40
/
setup.py
102 lines (87 loc) · 2.87 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
#! /usr/bin/env python
import os
import sys
import setuptools
def get_abjad_version():
version_file_path = os.path.join(os.path.dirname(__file__), "abjad", "_version.py")
with open(version_file_path, "r") as file_pointer:
file_contents_string = file_pointer.read()
local_dict: dict = {}
exec(file_contents_string, None, local_dict)
__version__ = local_dict["__version__"]
return __version__
def check_python_version(abjad_version):
CURRENT_PYTHON = sys.version_info[:2]
SUPPORTED_PYTHONS = [(3, 10), (3, 11), (3, 12)]
if CURRENT_PYTHON not in SUPPORTED_PYTHONS:
current_python = ".".join([str(_) for _ in CURRENT_PYTHON])
supported_pythons = ", ".join([f"{_[0]}.{_[1]}" for _ in SUPPORTED_PYTHONS])
string = f"This is Abjad {abjad_version},"
string += f" which supports Python {supported_pythons}.\n"
string += "\n"
string += "But it looks like you're trying to install Abjad"
string += f" with Python {current_python}."
sys.stderr.write(string)
sys.exit(1)
description = "Abjad is a Python API for building LilyPond files."
with open("README.rst", "r") as file_pointer:
long_description = file_pointer.read()
author = ["Trevor Bača", "Josiah Wolf Oberholtzer"]
author_email = [
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: GNU General Public License (GPL)",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Artistic Software",
]
extras_require = {
"nauert": ["abjad-ext-nauert>=3.19"],
"rmakers": ["abjad-ext-rmakers>=3.19"],
"dev": [
"black>=23.7.0",
"flake8>=6.1.0",
"isort>=5.12.0",
"mypy>=1.4.1",
"pytest>=8.1.1",
"pytest-cov>=4.1.0",
"pytest-helpers-namespace>=2021.12.29",
"sphinx-autodoc-typehints>=1.22.0",
"sphinx-rtd-theme>=1.0.0",
],
}
keywords = [
"music composition",
"music notation",
"lilypond",
]
install_requires = [
"ply>=3.11",
"roman>=1.4",
"uqbar>=0.6.9",
]
if __name__ == "__main__":
version = get_abjad_version()
check_python_version(version)
setuptools.setup(
author=", ".join(author),
author_email=", ".join(author_email),
classifiers=classifiers,
description=description,
extras_require=extras_require,
include_package_data=True,
install_requires=install_requires,
keywords=", ".join(keywords),
license="MIT",
long_description=long_description,
long_description_content_type="text/x-rst",
name="abjad",
packages=["abjad"],
platforms="Any",
python_requires=">=3.10",
url="https://abjad.github.io",
version=version,
)