-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
96 lines (82 loc) · 3.32 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
import os
from setuptools import setup, find_packages
# our package constants.
from spotifywebapipython.const import (
VERSION
)
# setup constants.
NAME = 'spotifywebapiPython'
DESCRIPTION = 'Spotify Web API Python3 Library'
# if installing using less than Python v3, then stop the install!
import sys
if sys.version_info < (3,5):
sys.exit('Sorry, Python < 3.5 is not supported.')
# function to read the contents of the README.md file, and return it to the caller.
def readme(pathName:str):
with open(pathName) as f:
return f.read()
# function to build a list of files in a directory.
def getDirFilesList(pathName:str) -> list[str]:
print(str.format("getting list of files in path \"{0}\" ...", pathName))
dir_list = os.listdir(pathName)
files:list[str] = []
for file in dir_list: # process all matches.
if os.path.isfile(pathName + file): # only include files (not directories)
files.append(str(pathName + file))
return files
# package setup.
setup(
# basic package information.
name=NAME,
version=VERSION,
author='Todd Lucas',
author_email='<[email protected]>',
description=DESCRIPTION,
# use the README.md markdown file for the description.
long_description_content_type='text/markdown',
long_description=readme('README.md'),
# find and include all packages in the project (anything with an '__init__.py' file).
packages=find_packages(),
# place documentation folder named "docs" in the package folder.
data_files=[
('../../spotifywebapiPython/docs', getDirFilesList('docspdoc/build/')),
('../../spotifywebapiPython/docs/spotifywebapipython', getDirFilesList('docspdoc/build/spotifywebapipython/')),
],
# set minimum python version requirement.
python_requires='>3.5.1',
# set minimum dependencies requirements.
# note that urllib3 version must be less than 2!
install_requires=[
'lxml>=5.2.0',
'oauthlib>=3.2.2',
'platformdirs>=4.1.0',
'requests>=2.31.0',
'requests_oauthlib>=1.3.1',
'smartinspectPython>=3.0.33',
'urllib3>=1.21.1,<1.27',
'zeroconf>=0.132.2'
],
# set keywords to associate this package with on Pypi.org.
keywords=['spotify', 'spotifywebapi', 'api', 'audio', 'music', 'library'],
# set classifiers to associate this package with on Pypi.org.
classifiers=[
'Development Status :: 5 - Production/Stable',
# 'Development Status :: 4 - Beta',
# 'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'Programming Language :: Python :: 3',
'Operating System :: Microsoft :: Windows',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Unix',
'Topic :: Software Development :: Libraries',
'Topic :: Multimedia :: Sound/Audio :: Players',
'Natural Language :: English',
'License :: Free To Use But Restricted',
],
# provide some links to list on the Pypi.org site.
project_urls={
'Changelog': 'https://github.com/thlucas1/spotifywebapiPython/blob/master/CHANGELOG.md',
'Documentation': 'https://spotifywebapiPython.readthedocs.io/en/latest/__init__.html',
'GitHub': 'https://github.com/thlucas1/spotifywebapiPython',
}
)