Commit 9c2c28aa by Will Daly

Merge pull request #51 from edx/will/sane-requirements

Reorganize requirements files
parents cf1be470 6eee938f
...@@ -7,8 +7,9 @@ before_install: ...@@ -7,8 +7,9 @@ before_install:
- sudo apt-get update - sudo apt-get update
- sudo xargs -a apt-packages.txt apt-get install --fix-missing - sudo xargs -a apt-packages.txt apt-get install --fix-missing
install: install:
- pip install -r base_requirements.txt - pip install -r base-requirements.txt
- pip install -r dev-requirements.txt
- sudo apt-get install python-matplotlib python-numpy python-scipy python-sklearn - sudo apt-get install python-matplotlib python-numpy python-scipy python-sklearn
- pip install nltk==2.0.3 scikit-learn==0.12.1 - pip install nltk==2.0.3 scikit-learn==0.12.1
- sudo mv ease/data/nltk_data /usr/share/nltk_data - sudo mv ease/data/nltk_data /usr/share/nltk_data
script: nosetests script: nosetests
\ No newline at end of file
# Most of the requirements, except for the ones
# that take a long time to install and have pre-built
# binaries on Ubuntu. This allows us to speed up the
# test builds, since we don't need to recompile numpy/scipy/nltk/scikit
# every time.
lxml==3.0.1 lxml==3.0.1
mock==0.8.0
nose==1.2.1
path.py==3.0 path.py==3.0
pylint==0.26.0
pytz==2012h pytz==2012h
fisher==0.1.4 fisher==0.1.4
# Test and doc requirements
coverage==3.5.3
django-sphinx-autodoc
mock==0.8.0
nose==1.2.1
pylint==0.26.0
sphinx
# Numpy needs to be installed separately from Scipy,
# so we can't include them in the same requirements file.
numpy==1.6.2 numpy==1.6.2
-r base_requirements.txt -r base-requirements.txt
coverage==3.5.3
scipy==0.11.0 scipy==0.11.0
scikit-learn==0.12.1 scikit-learn==0.12.1
sphinx
django-sphinx-autodoc
nltk==2.0.3 nltk==2.0.3
...@@ -18,15 +18,18 @@ def is_requirement(line): ...@@ -18,15 +18,18 @@ def is_requirement(line):
line.startswith('git+') line.startswith('git+')
) )
def load_requirements(*requirements_paths):
REQUIREMENTS = [ """
line.strip() for line in ( Load all requirements from the specified requirements files.
open("pre-requirements.txt").readlines() + Returns a list of requirement strings.
open("requirements.txt").readlines() + """
open("base_requirements.txt").readlines() requirements = set()
) for path in requirements_paths:
if is_requirement(line) requirements.update(
] line.strip() for line in open(path).readlines()
if is_requirement(line)
)
return list(requirements)
setup( setup(
...@@ -43,5 +46,6 @@ setup( ...@@ -43,5 +46,6 @@ setup(
keywords = "ml machine learning nlp essay education", keywords = "ml machine learning nlp essay education",
url = "https://github.com/edx/ease", url = "https://github.com/edx/ease",
include_package_data = True, include_package_data = True,
install_requires=REQUIREMENTS, install_requires=load_requirements("pre-requirements.txt", "requirements.txt"),
tests_require=load_requirements("dev-requirements.txt"),
) )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment