-
Notifications
You must be signed in to change notification settings - Fork 20
/
setup.py
53 lines (41 loc) · 1.54 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
"""Install openedx-webhooks."""
import re
from setuptools import find_packages, setup
# UPDATED VIA SEMGREP - if you need to remove/modify this method remove this line and add a comment specifying why
def is_requirement(line):
"""
Return True if the requirement line is a package requirement.
Returns:
bool: True if the line is not blank, a comment,
a URL, or an included file
"""
return line and line.strip() and not line.startswith(('-r', '#', '-e', 'git+', '-c'))
def get_requirements(path):
with open(path) as f:
lines = f.readlines()
return [line.strip() for line in lines if is_requirement(line)]
version = ''
with open('openedx_webhooks/__init__.py', 'r') as fd:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)
if not version:
raise RuntimeError('Cannot find version information')
setup(
name="openedx_webhooks",
version=version,
description="Automated tasks for Open edX",
long_description=open('README.rst').read(),
author="Open Source Community Managers at edX",
author_email="[email protected]",
url="https://github.com/openedx/openedx_webhooks",
packages=find_packages(),
install_requires=get_requirements("requirements.txt"),
license='Apache 2.0',
classifiers=(
'License :: OSI Approved :: Apache Software License',
'Framework :: Flask',
'Programming Language :: Python',
'Programming Language :: Python :: 3.11',
),
zip_safe=False,
)