Skip to content

Commit

Permalink
Prepare for travis-ci
Browse files Browse the repository at this point in the history
- Includes conda requirements files
- Loosely based on calliope from https://github.com/calliope-project/calliope
  • Loading branch information
coroa committed Dec 1, 2017
1 parent 7e8d759 commit ce119e2
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Modified from
# https://github.com/calliope-project/calliope/blob/master/.travis.yml

language: python
sudo: false # Use container-based infrastructure

matrix:
include:
- env:
- PYTHON_VERSION="2.7"
- env:
- PYTHON_VERSION="3.6"

before_install:
- if [[ "$PYTHON_VERSION" == "2.7" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
# Useful for debugging any issues with conda
- conda info -a

install:
- conda create -n pypsa python=$PYTHON_VERSION
- conda env update -n pypsa --file=requirements.yml
- conda env update -n pypsa --file=requirements_dev.yml
- source activate pypsa
- conda install -c conda-forge python-coveralls # don't install on appveyor
- pip install --no-cache-dir .

# before_script: # configure a headless display to test plot generation
# - "export DISPLAY=:99.0"
# - "sh -e /etc/init.d/xvfb start"
# - sleep 3 # give xvfb some time to start

script: "make test"

after_success:
- coveralls
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include pypsa/component_attrs/*.csv
include pypsa/standard_types/*.csv
include pypsa/components.csv
include README.rst LICENSE.txt
include requirements.yml
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.PHONY : test sdist upload clean dist

test :
pytest --cov pypsa --cov-report term-missing

sdist :
python setup.py sdist

upload :
twine upload dist/*

clean :
rm dist/*

dist : sdist upload clean
15 changes: 15 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: pypsa
channels:
- conda-forge
dependencies:
- python
- six
- numpy
- pyomo
- scipy
- pandas>=0.19.0
- matplotlib
- networkx>=1.10
- pyomo
- coincbc
- glpk
13 changes: 13 additions & 0 deletions requirements_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: pypsa

channels:
- conda-forge
- anaconda

dependencies:
- pytest
- pytest-cov
- twine
- pip:
- pypower
- pandapower

0 comments on commit ce119e2

Please sign in to comment.