8000 Setup tox · faif/python-patterns@2e5cd24 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2e5cd24

Browse files
committed
Setup tox
1 parent 423fe9d commit 2e5cd24

File tree

4 files changed

+58
-10
lines changed

4 files changed

+58
-10
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: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# vim ft=yaml
21
dist: xenial
32
language: python
43

@@ -9,19 +8,23 @@ python:
98
- "3.6"
109
- "3.7"
1110

11+
matrix:
12+
include:
13+
- python: "2.7"
14+
env: TOXENV=ci27
15+
- python: "3.6"
16+
env: TOXENV=ci36
17+
- python: "3.7"
18+
env: TOXENV=ci37
19+
1220
cache:
1321
- pip
1422

1523
install:
16-
- pip install -r requirements-dev.txt
24+
- pip install tox
1725

1826
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
27+
- tox
2528

2629
after_success:
2730
- 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)
0