-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathsetup.client.py
60 lines (49 loc) · 1.73 KB
/
setup.client.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
import os
from datetime import datetime
from setuptools import find_packages, setup
today = datetime.utcnow()
version = f'{today.year}.{today.month:02}.{today.day:02}'
def bs_common_version():
in_ci = bool(os.environ.get('CI'))
if in_ci:
if os.environ.get('BSC_UPDATED') == 'true':
# There was a new version of bugswarm-common in this same CI run; use today's date as the version
return f'=={version}'
# Otherwise, get latest version from PyPI API
import requests
response = requests.get('https://pypi.org/pypi/bugswarm-common/json')
response.raise_for_status()
return '=={}'.format(response.json()['version'])
# Use the value of the BUGSWARM_COMMON environment variable, if present
if 'BUGSWARM_COMMON' in os.environ:
return '=={}'.format(os.environ['BUGSWARM_COMMON'])
# Don't pin bugswarm-common
return ''
setup(
name='bugswarm-client',
version=version,
url='https://github.com/BugSwarm/bugswarm',
author='BugSwarm',
author_email='dev.bugswarm@gmail.com',
description='The official command line client for the BugSwarm artifact dataset',
long_description='The official command line client for the BugSwarm artifact dataset',
classifiers=[
'Programming Language :: Python :: 3',
'License :: OSI Approved :: BSD License',
],
zip_safe=False,
packages=find_packages(include=['bugswarm.client*']),
namespace_packages=[
'bugswarm',
],
install_requires=[
'click==6.7',
'requests>=2.20.0',
'bugswarm-common' + bs_common_version(),
],
entry_points={
'console_scripts': [
'bugswarm = bugswarm.client.bugswarm:cli',
],
},
)