Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
__pycache__
*.pyc
.idea
*.egg-info/
.tox/
22 changes: 10 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
# vim ft=yaml
dist: xenial
language: python

sudo: false

python:
- "2.7"
- "3.6"
- "3.7"
matrix:
include:
- python: "2.7"
env: TOXENV=ci27
- python: "3.6"
env: TOXENV=ci36
- python: "3.7"
env: TOXENV=ci37

cache:
- pip

install:
- pip install -r requirements-dev.txt
- pip install tox

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

after_success:
- codecov
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from setuptools import setup
from setuptools import setup, find_packages

setup(
name="python-patterns",
name="patterns",
packages=find_packages(),
description="A collection of design patterns and idioms in Python.",
classifiers=[
"Programming Language :: Python :: 2",
Expand Down
42 changes: 42 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[tox]
envlist = ci27,ci36,ci37,cov-report


[testenv]
setenv =
COVERAGE_FILE = .coverage.{envname}

[testenv:ci27]
basepython = python2.7
deps =
-r requirements-dev.txt
commands =
flake8 --exclude="*__py3.py" patterns/
pytest --doctest-modules --ignore-glob="*__py3.py" patterns/
pytest -s -vv --cov={envsitepackagesdir}/patterns --log-level=INFO tests/

[testenv:ci36]
basepython = python3.6
deps =
-r requirements-dev.txt
commands =
flake8 --exclude="*__py2.py" patterns/
pytest --doctest-modules --ignore-glob="*__py2.py" patterns/
pytest -s -vv --cov={envsitepackagesdir}/patterns --log-level=INFO tests/

[testenv:ci37]
basepython = python3.7
deps =
-r requirements-dev.txt
commands =
flake8 --exclude="*__py2.py" patterns/
pytest --doctest-modules --ignore-glob="*__py2.py" patterns/
pytest -s -vv --cov={envsitepackagesdir}/patterns --log-level=INFO tests/

[testenv:cov-report]
setenv =
COVERAGE_FILE = .coverage
deps = coverage
commands =
coverage combine
coverage report