forked from ooni/backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
40 lines (35 loc) · 1.42 KB
/
setup.py
File metadata and controls
40 lines (35 loc) · 1.42 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
from __future__ import with_statement
from oonib import __version__
from setuptools import setup, find_packages
def get_requirements():
with open('requirements.txt', 'r') as f:
requirements = f.read().splitlines()
# For urls such as https://hg.secdev.org/scapy/archive/tip.zip#egg=scapy in
# requirements.txt we need to add the package name to install_requires and
# the entire url to dependency_links. That way setuptools will be able to
# satisfy the dependency using that url (as long as it is in standard sdist
# format, a single .py file or an egg).
pypi_packages = []
dependency_links = []
for package_desc in requirements:
if package_desc.startswith("#") or package_desc.startswith("-i"):
continue
if '#egg=' in package_desc:
dependency_links.append(package_desc)
pypi_packages.append(package_desc.split('#egg=')[-1])
else:
pypi_packages.append(package_desc)
return pypi_packages, dependency_links
install_requires, dependency_links = get_requirements()
setup(
name="oonib",
version=__version__,
author="The Tor Project, Inc",
url="https://ooni.torproject.org",
license="LICENSE",
description="OONI-Probe Backend",
scripts=["bin/oonib", "bin/oonibadmin", "bin/archive_oonib_reports"],
packages=find_packages(),
install_requires=install_requires,
dependency_links=dependency_links,
)