This repository has been archived by the owner on Jun 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
86 lines (72 loc) · 2.48 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
import subprocess
import sys
from os import path
from shutil import rmtree
from setuptools import setup, find_packages, Command
NAME = 'youtubewatched'
requires = [
'beautifulsoup4==4.7.1',
'dash==0.40.0',
'Flask==1.0.2',
'google-api-python-client==1.7.8',
'lxml==4.6.5',
'numpy==1.16.2',
'pandas==0.24.2',
'plotly==3.7.1'
]
cur_dir = path.abspath(path.dirname(__file__))
class UploadCommand(Command):
# based on https://github.com/kennethreitz/setup.py/blob/master/setup.py
description = 'Build and publish the package.'
user_options = []
def initialize_options(self):
pass
def run(self):
dist_dir_path = path.join(cur_dir, 'dist')
if path.exists(dist_dir_path):
print('Removing old dist/ directory')
try:
if not self.dry_run:
rmtree(dist_dir_path)
except OSError:
print('Failed to delete the dist/ directory')
raise
print('Building source distribution and wheel')
if self.dry_run:
subprocess.run(f'{sys.executable} setup.py -n sdist bdist_wheel')
else:
subprocess.run(f'{sys.executable} setup.py sdist bdist_wheel')
print('Uploading to PyPi...')
if not self.dry_run:
subprocess.run(f'twine upload --repository pypi dist/*')
def finalize_options(self):
pass
setup(
name=NAME,
version='0.1.4',
author='Vladimir Belitskiy',
author_email='[email protected]',
description='Visualization of Youtube watch history from Google Takeout',
long_description=open(path.join(cur_dir, 'README.md'), 'r').read(),
long_description_content_type='text/markdown',
url='https://github.com/VldmrB/youtube-watched',
packages=find_packages(),
license='MIT',
python_requires='>=3.6.0',
install_requires=requires,
include_package_data=True,
keywords='visualization youtube takeout',
entry_points=f'''[console_scripts]
{NAME}={NAME}.__main__:launch''',
classifiers=[
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython',
'Operating System :: OS Independent',
'Framework :: Flask'
],
cmdclass={'upload': UploadCommand}
)