Commit 357113c4 by Will Daly

Merge pull request #453 from edx/will/ai-testing-support

Test setup for running the full AI grading suite in Travis
parents bd5c184f f18d6eec
language: python
python:
- "2.7"
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
before_install:
- sudo apt-get update
- sudo xargs -a apt-packages.txt apt-get install --fix-missing
install:
- "pip install coveralls"
- "./scripts/install-wheels.sh"
- travis_retry ./scripts/download-nltk-data.sh
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
script:
- "./scripts/test.sh"
- "./scripts/i18n.sh"
- "python setup.py install"
after_success:
coveralls
aspell
gcc
g++
gfortran
libblas3gf
libblas-dev
liblapack3gf
liblapack-dev
libatlas-base-dev
libxml2-dev
libxslt1-dev
# Include the requirements we're caching as "wheel" archives
# to speed up the test builds.
-r wheels.txt
# edX Internal Requirements
git+https://github.com/edx/XBlock.git@fc5fea25c973ec66d8db63cf69a817ce624f5ef5#egg=XBlock
git+https://github.com/edx/xblock-sdk.git@643900aadcb18aaeb7fe67271ca9dbf36e463ee6#egg=xblock-sdk
......@@ -18,3 +22,6 @@ loremipsum==1.0.2
python-dateutil==2.1
pytz==2012h
South==0.7.6
# AI grading
git+https://github.com/edx/ease.git@97de68448e5495385ba043d3091f570a699d5b5f#egg=ease
# These packages require compilation, so they take a long time to install.
# To speed up the test builds, we create binary "wheel" archives.
# http://pip.readthedocs.org/en/latest/reference/pip_wheel.html
lxml==3.0.1
nltk==2.0.3
numpy==1.6.2
scikit-learn==0.12.1
scipy==0.11.0
#!/usr/bin/env bash
PYTHON=`which python`
sudo $PYTHON -m nltk.downloader stopwords maxent_treebank_pos_tagger wordnet -d /usr/local/share/nltk_data --quiet
#!/usr/bin/env bash
# Install "wheel" archives of the requirements for running the test suite.
# http://pip.readthedocs.org/en/latest/reference/pip_wheel.html
# This runs in Travis to install pre-built binary packages, which
# means the builds are faster and more reliable.
cd `dirname $BASH_SOURCE` && cd ..
pip install --upgrade pip
pip install wheel
WHEELHOUSE="scripts/data/wheelhouse"
# Ensure that numpy is installed first; otherwise scipy won't be able to install
pip install --use-wheel --no-index --upgrade --find-links=$WHEELHOUSE numpy
# Then install everything else
pip install --use-wheel --no-index --upgrade --find-links=$WHEELHOUSE -r requirements/wheels.txt
#!/usr/bin/env bash
# Create "wheel" archives of the requirements for running the test suite.
# http://pip.readthedocs.org/en/latest/reference/pip_wheel.html
# Run this whenever you update requirements to speed up test jobs in Travis.
# Since the archives contain binary distributions, however,
# you MUST run the script within an Ubuntu 12.04 box.
cd `dirname $BASH_SOURCE` && cd ..
pip install --upgrade pip
pip install wheel
WHEELHOUSE="scripts/data/wheelhouse"
pip wheel --wheel-dir=$WHEELHOUSE -r requirements/wheels.txt
......@@ -18,14 +18,26 @@ def is_requirement(line):
line = line.strip()
# Skip blank lines, comments, and editable installs
return not (line == '' or line.startswith('#') or line.startswith('-e') or line.startswith('git+'))
return not (
line == '' or
line.startswith('-r') or
line.startswith('#') or
line.startswith('-e') or
line.startswith('git+')
)
REQUIREMENTS = [
line.strip() for line in
open("requirements/base.txt").readlines()
if is_requirement(line)
]
def load_requirements(*requirements_paths):
"""
Load all requirements from the specified requirements files.
Returns a list of requirement strings.
"""
requirements = set()
for path in requirements_paths:
requirements.update(
line.strip() for line in open(path).readlines()
if is_requirement(line)
)
return list(requirements)
setup(
name='ora2',
......@@ -42,7 +54,8 @@ setup(
'Programming Language :: Python',
],
packages=PACKAGES,
install_requires=REQUIREMENTS,
install_requires=load_requirements('requirements/base.txt', 'requirements/wheels.txt'),
tests_require=load_requirements('requirements/test.txt'),
entry_points={
'xblock.v1': [
'openassessment = openassessment.xblock.openassessmentblock:OpenAssessmentBlock',
......
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