diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..8968e0fa2 --- /dev/null +++ b/.travis.yml @@ -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 diff --git a/MANIFEST.in b/MANIFEST.in index 97a50c19a..1ee75eeeb 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -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 diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..10928d116 --- /dev/null +++ b/Makefile @@ -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 diff --git a/requirements.yml b/requirements.yml new file mode 100644 index 000000000..b76a7b961 --- /dev/null +++ b/requirements.yml @@ -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 diff --git a/requirements_dev.yml b/requirements_dev.yml new file mode 100644 index 000000000..01fb867ae --- /dev/null +++ b/requirements_dev.yml @@ -0,0 +1,13 @@ +name: pypsa + +channels: + - conda-forge + - anaconda + +dependencies: + - pytest + - pytest-cov + - twine + - pip: + - pypower + - pandapower