[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [ooni-probe/master] First setup.py draft
commit aa54de948011eb45f494f3bca7a714d02a89da62
Author: Flavio Amieiro <amieiro.flavio@xxxxxxxxx>
Date: Sun Nov 18 22:28:05 2012 -0200
First setup.py draft
---
setup.py | 37 +++++++++++++++++++++++++++++++++++++
1 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..0112d95
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,37 @@
+from __future__ import with_statement
+from setuptools import setup, find_packages
+
+def get_requirements():
+ with open('requirements.txt', 'r') as f:
+ requirements = f.read().splitlines()
+
+ with open('oonib/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 = []
+ external_links = []
+ for package_desc in requirements:
+ if '#egg=' in package_desc:
+ external_links.append(package_desc)
+ pypi_packages.append(package_desc.split('#egg=')[-1])
+ else:
+ pypi_packages.append(package_desc)
+
+ return pypi_packages, external_links
+
+install_requires, dependency_links = get_requirements()
+
+setup(
+ name="ooni-probe",
+ version="0.6",
+ url="http://ooni.nu/",
+ packages=find_packages(),
+ scripts=["bin/canary", "bin/oonib", "bin/ooniprobe"],
+ install_requires=install_requires,
+ dependency_links=dependency_links,
+)
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits