Skip to content

Commit 26fe984

Browse files
author
Manuel
committed
Change CI/CD settings
- start tests with tox * test python 3.5 to 3.7 * test building docs * run example_scripts * optionally check coding style - add setup.cfg to build docs using setup.py - add development requirements - setup.py reads requirements and installs them with setup.py install/develop - make development compatible with tox - make travis autodeploy when new tag is set
1 parent 74a1626 commit 26fe984

File tree

6 files changed

+76
-20
lines changed

6 files changed

+76
-20
lines changed

.travis.yml

+29-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,36 @@
11
language: python
22
python:
3-
- "3.5"
43
- "3.6"
54
sudo: false
65

7-
before_install: pip install codecov
8-
after_success: codecov
6+
branches:
7+
only:
8+
- master
99

10-
install:
11-
- pip install numpy
12-
- pip install -r requirements.txt
13-
- python install_resources.py omssa_2_1_9
10+
matrix:
11+
include:
12+
- python: 3.5
13+
env: TOXENV=py35
14+
- python: 3.6
15+
env: TOXENV=py36
16+
- python: 3.7
17+
env: TOXENV=py37
18+
dist: xenial
19+
- python: 3.6
20+
env: TOXENV=docu
21+
- python: 3.6
22+
env: TOXENV=example_scripts
1423

15-
script: nosetests --with-coverage
24+
25+
script:
26+
- tox
27+
- |
28+
if [[ $TRAVIS_TAG ]]; then
29+
# upload package to pypi
30+
python setup.py sdist
31+
python setup.py bdist_wheel --universal
32+
pip install twine
33+
twine upload --repository-url https://test.pypi.org/legacy/ -u $TWINE_USERNAMEE -p $TWINE_TEST_PASSWORD dist/*
34+
twine upload -u $TWINE_USERNAME -p $TWINE_PASSWORD dist/*
35+
# upload docu
36+
fi

requirements.txt

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
pymzml >= 2.0
2-
nose >=1.3
1+
pymzml>=2.0
2+
nose>=1.3
33
regex
4-
pyahocorasick >= 1.1.4; sys_platform != 'win32'
5-
https://github.com/pygcluster/pyGCluster/archive/master.zip
6-
https://github.com/pyQms/pyqms/archive/master.zip
4+
pyahocorasick>=1.1.4; sys_platform != 'win32'
5+
pyqms

requirements_dev.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-r requirements.txt
2+
coverage
3+
codecov
4+
tox

setup.cfg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[build_sphinx]
2+
source-dir = docs/source
3+
build-dir = docs/build
4+
all_files = 1

setup.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ def run(self):
4747
with open(version_path, 'r') as version_file:
4848
ursgal_version = version_file.read().strip()
4949

50+
with open('requirements.txt') as req:
51+
requirements = req.readlines()
5052

5153
setup(
5254
name='ursgal',
@@ -66,12 +68,7 @@ def run(self):
6668
build_requires=[
6769
'numpy',
6870
],
69-
install_requires=[
70-
'pymzml',
71-
'regex',
72-
'pyqms',
73-
"pyahocorasick >= 1.1.4;sys_platform!='win32'",
74-
],
71+
install_requires=requirements,
7572
long_description='Universal Python module combining common bottom-up proteomics tools for large-scale analysis',
7673
author='Lukas P. M. Kremer, Purevdulam Oyunchimeg, Johannes Barth, Stefan Schulze and Christian Fufezan',
7774
author_email='[email protected]',
@@ -97,4 +94,4 @@ def run(self):
9794
'Topic :: Software Development :: Libraries :: Python Modules'
9895
],
9996
cmdclass={'install_lib': my_install_lib}
100-
)
97+
)

tox.ini

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[tox]
2+
envlist=py35,py36,py37,docu,example_scripts
3+
[testenv]
4+
deps =
5+
-Ur{toxinidir}/requirements_dev.txt
6+
commands =
7+
coverage erase
8+
coverage run {envbindir}/nosetests
9+
coverage report --include=ursgal/* --omit=test/
10+
codecov
11+
12+
[testenv:docu]
13+
deps =
14+
-Ur{toxinidir}/docs/requirements.txt
15+
changedir = {toxinidir}/docs
16+
commands =
17+
make latex
18+
make html
19+
20+
[testenv:example_scripts]
21+
deps =
22+
-Ur{toxinidir}/requirements.txt
23+
changedir = {toxinidir}/example_scripts
24+
commands =
25+
# selected example_scripts here
26+
python filter_csv_validation_example.py
27+
python filter_csv_for_mods_example.py
28+
29+
[testenv:pycodestyle]
30+
commands =
31+
pycodestyle ursgal

0 commit comments

Comments
 (0)