-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.py
108 lines (91 loc) · 3.4 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
import json
import os
from typing import List
import setuptools
from dizqueTV._info import __version__
__title__ = "dizqueTV"
__author__ = 'Nate Harris'
__author_email__ = '[email protected]'
__github_username__ = "nwithan8"
__github_repo__ = "dizqueTV-python"
__copyright__ = "Copyright © YEARADDEDBYGITHUB - Nate Harris"
__license__ = 'GNU General Public License v3 (GPLv3)'
__docs__ = "https://dizquetv.readthedocs.io/en/latest"
__description__ = "Interact with a dizqueTV instance's API"
__keywords__ = [
"dizqueTV",
"Plex",
"Jellyfin",
"Emby",
"media",
"API",
"server",
"interaction",
"TV",
"television",
"streaming",
]
with open("README.md", "r") as fh:
long_description = fh.read()
with open("requirements.txt", "r") as fh:
REQUIREMENTS = fh.read().splitlines()
with open("dev_requirements.txt", "r") as fh:
DEV_REQUIREMENTS = fh.read().splitlines()
def __supported_python_versions__() -> List[str]:
"""Return a list of supported Python versions."""
with open(os.path.join(os.path.dirname(__file__), "dizqueTV", "PYTHON_VERSIONS.json")) as f:
versions = f.read()
return json.loads(versions)
def python_versions() -> List[str]:
"""Return a list of supported Python versions."""
versions = __supported_python_versions__()
version_strings = ['Programming Language :: Python :: 3']
for version in versions:
version_strings.append(f"Programming Language :: Python :: {version}")
return version_strings
def python3_range() -> str:
"""Return a string of the supported Python version range."""
versions = __supported_python_versions__()
return f">={versions[0]}, <4"
classifiers = [
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Development Status :: 4 - Beta',
# Chose either "3 - Alpha", "4 - Beta" or "5 - Production/Stable" as the current state of your package
'Intended Audience :: Developers', # Define that your audience are developers
'Topic :: Software Development :: Build Tools',
'Topic :: Multimedia :: Video',
'Topic :: Multimedia',
'Topic :: Internet :: WWW/HTTP',
'Operating System :: OS Independent'
]
classifiers.extend(python_versions())
# Replace version if not replaced already
try:
_ = setuptools._vendor.packaging.version.Version(__version__)
except Exception:
if "." in __version__: # If __version__ was replaced by GitHub Actions, but could not be converted to a version
__version__ = 'VERSIONADDEDBYGITHUB' # Will be replaced by GitHub Actions with actual version number
else:
__version__ = "0.0.0" # If __version__ was not replaced by GitHub Actions, set to 0.0.0
setuptools.setup(
name=__title__,
packages=setuptools.find_packages(exclude=["tests"]),
include_package_data=True,
version=__version__,
license=__license__,
description=__description__,
long_description=long_description,
long_description_content_type="text/markdown",
author=__author__,
author_email=__author_email__,
url=f'https://github.com/{__github_username__}/{__github_repo__}',
download_url=f'https://github.com/{__github_username__}/{__github_repo__}/archive/refs/tags/{__version__}.tar.gz',
keywords=__keywords__,
install_requires=REQUIREMENTS,
extras_require={
"dev": DEV_REQUIREMENTS,
},
test_suite="test",
classifiers=classifiers,
python_requires=python3_range(),
)