forked from WyattBlue/auto-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
111 lines (89 loc) · 3.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
'''setup.py'''
import os
import re
import sys
from setuptools import setup, find_packages
def pip_version():
with open(os.path.abspath('auto_editor/__init__.py')) as f:
version_content = f.read()
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_content, re.M)
if(version_match):
return version_match.group(1).replace('dev', '')
raise ValueError('Unable to find version string.')
def replace_version():
with open(os.path.abspath('auto_editor/__init__.py')) as f:
version_content = f.read()
import datetime
year, week_num, _ = datetime.date.today().isocalendar()
year = str(year - 2000)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_content, re.M)
informal_match = re.search(r"version = ['\"]([^'\"]*)['\"]",
version_content, re.M)
my_version = version_match.group(1)
informal_version = informal_match.group(1)
if(not my_version.startswith('{}.{}.'.format(year, week_num))):
raise ValueError('Pip version with wrong date.')
if(not informal_version.startswith('{}w{}'.format(year, week_num))):
raise ValueError('Informal version wrong date.')
version_content = version_content.replace('-dev', '').replace('dev', '')
with open(os.path.abspath('auto_editor/__init__.py'), 'w') as f:
f.write(version_content)
if(sys.argv[-1] == 'replace_version'):
replace_version()
if(sys.argv[-1] == 'publish'):
from shutil import rmtree
rmtree('build')
rmtree('dist')
os.system('python3 setup.py sdist bdist_wheel')
os.system('twine upload dist/*')
sys.exit()
with open('README.md', 'r') as f:
long_description = f.read()
setup(
name='auto-editor',
version=pip_version(),
description='Auto-Editor: Effort free video editing!',
long_description=long_description,
long_description_content_type='text/markdown',
license='Unlicense',
url='https://github.com/WyattBlue/auto-editor',
author='WyattBlue',
author_email='[email protected]',
keywords='video audio media editor editing processing nonlinear automatic ' \
'silence-detect silence-removal silence-speedup motion-detection',
packages=find_packages(),
include_package_data=True,
install_requires=[
'numpy',
'audiotsm2~=0.2.1',
'opencv-python>=4.3',
'youtube-dl',
'av>=6.0.0',
],
classifiers=[
'Topic :: Multimedia :: Sound/Audio',
'Topic :: Multimedia :: Video',
'License :: Public Domain',
'License :: OSI Approved :: The Unlicense (Unlicense)',
'Environment :: Console',
'Natural Language :: English',
'Intended Audience :: End Users/Desktop',
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Programming Language :: Python :: Implementation :: IronPython',
'Programming Language :: Python :: Implementation :: Jython',
],
entry_points={
"console_scripts": ["auto-editor=auto_editor.__main__:main"]
}
)