Skip to content

Commit ba45647

Browse files
authored
Merge pull request faif#289 from gyermolenko/setup_tox_
Setup tox
2 parents 423fe9d + 1eeaa94 commit ba45647

File tree

4 files changed

+57
-14
lines changed

4 files changed

+57
-14
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
__pycache__
22
*.pyc
33
.idea
4+
*.egg-info/
5+
.tox/

.travis.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
1-
# vim ft=yaml
21
dist: xenial
32
language: python
43

54
sudo: false
65

7-
python:
8-
- "2.7"
9-
- "3.6"
10-
- "3.7"
6+
matrix:
7+
include:
8+
- python: "2.7"
9+
env: TOXENV=ci27
10+
- python: "3.6"
11+
env: TOXENV=ci36
12+
- python: "3.7"
13+
env: TOXENV=ci37
1114

1215
cache:
1316
- pip
1417

1518
install:
16-
- pip install -r requirements-dev.txt
19+
- pip install tox
1720

1821
script:
19-
- if [ "${TRAVIS_PYTHON_VERSION:0:1}" = 2 ]; then export PYEXCLUDE=3; else export PYEXCLUDE=2; fi
20-
- flake8 --exclude="*__py${PYEXCLUDE}.py" patterns/
21-
- pytest --doctest-modules --ignore-glob="*__py${PYEXCLUDE}.py" patterns/
22-
- pytest -s -vv --cov=. --log-level=INFO tests/
23-
# Actually run all the scripts, contributing to coverage
24-
- PYTHONPATH=. ./run_all.sh
22+
- tox
2523

2624
after_success:
2725
- codecov

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
from setuptools import setup
1+
from setuptools import setup, find_packages
22

33
setup(
4-
name="python-patterns",
4+
name="patterns",
5+
packages=find_packages(),
56
description="A collection of design patterns and idioms in Python.",
67
classifiers=[
78
"Programming Language :: Python :: 2",

tox.ini

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
[tox]
2+
envlist = ci27,ci36,ci37,cov-report
3+
4+
5+
[testenv]
6+
setenv =
7+
COVERAGE_FILE = .coverage.{envname}
8+
9+
[testenv:ci27]
10+
basepython = python2.7
11+
deps =
12+
-r requirements-dev.txt
13+
commands =
14+
flake8 --exclude="*__py3.py" patterns/
15+
pytest --doctest-modules --ignore-glob="*__py3.py" patterns/
16+
pytest -s -vv --cov={envsitepackagesdir}/patterns --log-level=INFO tests/
17+
18+
[testenv:ci36]
19+
basepython = python3.6
20+
deps =
21+
-r requirements-dev.txt
22+
commands =
23+
flake8 --exclude="*__py2.py" patterns/
24+
pytest --doctest-modules --ignore-glob="*__py2.py" patterns/
25+
pytest -s -vv --cov={envsitepackagesdir}/patterns --log-level=INFO tests/
26+
27+
[testenv:ci37]
28+
basepython = python3.7
29+
deps =
30+
-r requirements-dev.txt
31+
commands =
32+
flake8 --exclude="*__py2.py" patterns/
33+
pytest --doctest-modules --ignore-glob="*__py2.py" patterns/
34+
pytest -s -vv --cov={envsitepackagesdir}/patterns --log-level=INFO tests/
35+
36+
[testenv:cov-report]
37+
setenv =
38+
COVERAGE_FILE = .coverage
39+
deps = coverage
40+
commands =
41+
coverage combine
42+
coverage report

0 commit comments

Comments
 (0)