Uh oh!
There was an error while loading. Please reload this page.
forked from celeduc/lambda-packages
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
Latest commit
74 lines (61 loc) · 2.15 KB
/
Copy pathsetup.py
File metadata and controls
74 lines (61 loc) · 2.15 KB
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
importdatetime
importos
importre
importsetuptools
importsys
fromsetuptoolsimportsetup, find_packages
# Set external files
try:
frompypandocimportconvert
README=convert('README.md', 'rst')
exceptImportError:
README=open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
defget_version(*file_paths):
filename=os.path.join(os.path.dirname(__file__), *file_paths)
version_file=open(filename).read()
version_match=re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
ifversion_match:
returnversion_match.group(1)
raiseRuntimeError('Unable to find version string.')
VERSION=get_version('xref_lambda_packages', '__init__.py')
# HISTORY = open('HISTORY.rst').read().replace('.. :changelog:', '')
defget_package():
filename=os.path.join(
os.path.dirname(__file__), 'dist',
'xref_lambda_packages-{}.tar.gz'.format(VERSION)
)
returnfilename
ifsys.argv[-1] =='publish':
print('Publishing the the package on gemfury:')
os.system('fury push {} --as xref'.format(get_package()))
sys.exit()
ifsys.argv[-1] =='tag':
print('Tagging the version on github:')
os.system('git tag -a {} -m "version {}"'.format(VERSION, VERSION))
os.system('git push --tags')
sys.exit()
setup(
name='xref_lambda_packages',
version=VERSION,
packages=['xref_lambda_packages'],
include_package_data=True,
license='MIT License',
description='AWS Lambda Packages',
long_description=README,
url='https://github.com/xrefdev/lambda-packages',
author='X',
author_email='',
classifiers=[
'Environment :: Console',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.6',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
)