-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
59 lines (49 loc) · 1.77 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
#!/usr/bin/env python3
from os.path import abspath, dirname, join
import os
import pip
from setuptools import setup, find_packages
# Besides not advised,
# https://pip.pypa.io/en/stable/user_guide/#using-pip-from-your-program
# That's the only sane way to parse requirements.txt
pip_major_version = int(pip.__version__.split(".")[0])
if pip_major_version >= 20:
from pip._internal.network.session import PipSession
from pip._internal.req import parse_requirements
elif pip_major_version >= 10:
from pip._internal.download import PipSession
from pip._internal.req import parse_requirements
else:
from pip.download import PipSession
from pip.req import parse_requirements
CWD = dirname(abspath(__file__))
def requires():
reqs_file = join(CWD, 'requirements.txt')
reqs_install = parse_requirements(reqs_file, session=PipSession())
try:
return [str(ir.requirement) for ir in reqs_install]
except AttributeError:
print('attributeError')
return [str(ir.req) for ir in reqs_install]
setup(
name='bert-e',
version=os.getenv('VERSION', '1.0-dev'),
python_requires=">=3.10",
platforms=['any'],
description='Scality\'s automated branch merging tool',
url='https://github.com/scality/bert-e',
license='Apache',
include_package_data=True,
packages=find_packages(),
install_requires=requires(),
entry_points={
'console_scripts': [
'bert-e=bert_e.bert_e:main',
'bert-e-serve=bert_e.server.server:main',
'filter_pull_requests=bert_e.bin.filter_pull_requests:main',
'nobuildstatus=bert_e.bin.nobuildstatus:main',
'webhook_parser=bert_e.bin.webhook_parser:main',
'webhook_register=bert_e.bin.webhook_register:main',
],
}
)