commit 149d986bcd98513cd9864b96ad7846aeb0d1f783 Author: Arturo Filastò art@fuffa.org Date: Sat May 4 15:51:08 2013 +0200
Re-add install_requires and install_dependencies
Add a note stating that pip must be run before running the setup.py script --- README.md | 3 +++ setup.py | 46 +++++++++++++++++++++++----------------------- 2 files changed, 26 insertions(+), 23 deletions(-)
diff --git a/README.md b/README.md index 90a3d1a..06d5013 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,9 @@ setting up this up and installing are: mkvirtualenv -a $PWD --unzip-setuptools --setuptools --no-site-packages oonib # ...and install ooni-backend (sudo is not necessary since we're in a virtualenv): pip install -r requirements.txt --use-mirrors + # Note: it is important that you install the requirements before you run + # the setup.py script. If you fail to do so they will be downloaded over + # plaintext. python setup.py install
# Running an OONI collector diff --git a/setup.py b/setup.py index e474b0d..6151a72 100644 --- a/setup.py +++ b/setup.py @@ -1,27 +1,27 @@ 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() -# -# # 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 '#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() +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 '#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="0.9", @@ -31,6 +31,6 @@ setup( description="OONI-Probe Backend", scripts=["bin/oonib"], packages=find_packages(), - #install_requires=install_requires, - #dependency_links=dependency_links, + install_requires=install_requires, + dependency_links=dependency_links, )
tor-commits@lists.torproject.org