Commit b5dbcb65 authored by Tjerk Vreeken's avatar Tjerk Vreeken

Use tox for tests

This allows us to easily run tests for multiple platforms, and multiple
versions of Python.

Closes #1000
parent 4a6b6bd0
image: python:3-jessie
image: python:3.6
before_script:
- pip install tox
stages:
- build
- test
- deploy
# build
build:
stage: build
script:
......@@ -15,20 +19,43 @@ build:
expire_in: 1 week
tags:
- docker
- python3
test:
# test
.job_template: &unittests
stage: test
script:
- tox -vv
py35:linux:
<<: *unittests
image: python:3.5-jessie
variables:
TOXENV: py35
tags:
- docker
- linux
py36:linux:
<<: *unittests
image: python:3.6-jessie
variables:
TOXENV: py36
tags:
- docker
- linux
# deploy
deploy:
stage: deploy
dependencies:
- build
script:
- python -m venv venv
- source venv/bin/activate
- pip install git+https://github.com/pymoca/pymoca.git
- pip install dist/*.whl
- pip install nose
- cd tests
- python -m nose
- pip install twine
- twine upload -u $PYPI_USER -p $PYPI_PASSWORD dist/*
only:
- tags
except:
# Do not deploy tags that do not start with 2.
- /^(?!2\.).*$
tags:
- docker
- python3
casadi >= 3.2.0
numpy >= 1.14.0
scipy
pymoca
\ No newline at end of file
......@@ -28,10 +28,6 @@ Operating System :: Unix
Operating System :: MacOS
"""
# Install requirements
with open('requirements.txt', 'r') as req_file:
install_reqs = req_file.read().split('\n')
setup(
name = 'rtc-tools',
version = versioneer.get_version(),
......@@ -45,7 +41,10 @@ setup(
platforms = ['Windows', 'Linux', 'Mac OS-X', 'Unix'],
packages = find_packages("src"),
package_dir = {"": "src"},
install_requires = install_reqs,
install_requires = ["casadi >= 3.2.0",
"numpy >= 1.14.0",
"scipy >= 1.0.0",
"pymoca >= 0.2.4"],
tests_require = ['nose'],
test_suite = 'nose.collector',
python_requires='>=3.5',
......
[tox]
envlist =
py{35,36}
[testenv]
commands = python setup.py test {posargs}
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