forked from bj80heyue/One_Shot_Face_Reenactment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
88 lines (69 loc) · 2.29 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
#!/usr/bin/env python
import os
import sys
try:
from setuptools import setup, Command
except ImportError:
from distutils.core import setup
from distutils.cmd import Command
here = os.path.abspath(os.path.dirname(__file__))
with open('LICENSE') as f:
license = f.read()
with open('requirements.txt') as f:
requirements = f.read().splitlines()
with open('README.md') as f:
long_description = f.read()
about = {}
with open(os.path.join(here, 'runway', '__version__.py'), 'r') as f:
exec(f.read(), about)
class VerifyVersionCommand(Command):
"""Custom command to verify that the git tag matches our version"""
description = 'verify that the git tag matches our version'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
tag = os.getenv('CIRCLE_TAG')
if tag != about['__version__']:
info = "Git tag: {0} does not match the version of this app: {1}".format(
tag, about['__version__']
)
sys.exit(info)
class TagReleaseCommand(Command):
"""Custom command to use the version from __version__.py to tag a release"""
description = 'verify that the git tag matches our version'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
os.system('git tag %s' % about['__version__'])
setup(
name='runway-python',
version=about['__version__'],
description='Helper library for creating Runway models',
long_description=long_description,
long_description_content_type='text/markdown',
author='Runway AI, Inc.',
author_email='[email protected]',
url='https://github.com/runwayml/model-sdk',
packages=['runway'],
scripts=[],
python_requires=">=3.6",
install_requires=requirements,
classifiers=[
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Development Status :: 4 - Beta",
"Topic :: Software Development :: Libraries :: Python Modules",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7"
],
cmdclass={
'verify': VerifyVersionCommand,
'tag_release': TagReleaseCommand
}
)