Skip to content

Commit

Permalink
Modernize Travis and Tox configuration
Browse files Browse the repository at this point in the history
Drop Python 2.7 from test matrix
  • Loading branch information
bittner committed Feb 12, 2020
1 parent 4b1290c commit 05a1701
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 53 deletions.
82 changes: 39 additions & 43 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,49 @@
dist: xenial
sudo: required

os: linux
language: python
python:
- 2.7
- 3.4
- 3.5
- 3.6
- 3.7

install:
- pip install tox-travis
script:
- tox
- 3.4
- 3.5
- 3.6
- 3.7
- 3.8

env:
- DJANGO=1.11
- DJANGO=2.1
- DJANGO=2.2
- DJANGO=1.11
- DJANGO=2.2
- DJANGO=3.0

matrix:
exclude:
# Python/Django combinations that aren't officially supported
- { python: 3.7, env: DJANGO=1.11 }
- { python: 2.7, env: DJANGO=2.1 }
- { python: 3.4, env: DJANGO=2.1 }
- { python: 2.7, env: DJANGO=2.2 }
- { python: 3.4, env: DJANGO=2.2 }
install:
- pip install tox-travis
script:
- tox

stages:
- lint
- test
- deploy
- lint
- test
- deploy

jobs:
exclude:
# Python/Django combinations that aren't officially supported
- { python: 3.4, env: DJANGO=2.2 }
- { python: 3.4, env: DJANGO=3.0 }
- { python: 3.5, env: DJANGO=3.0 }
- { python: 3.8, env: DJANGO=1.11 }
include:
- { stage: lint, python: 3.7, env: TOXENV=flake8 }
- { stage: lint, python: 3.7, env: TOXENV=pylint }
- { stage: lint, python: 3.7, env: TOXENV=bandit }
- { stage: lint, python: 3.7, env: TOXENV=readme }
- stage: deploy
env:
install: skip
script: skip
deploy:
provider: pypi
distributions: sdist bdist_wheel
user: Bashar.said
password:
secure: D99UQ4DWGbwtry9Yyaszw+qZp0Ma4KZKBMFIe1dwzl8XQdRtdH+duQhPJY62OyYhZd2vD8MlAi/gcN5aknQ9P0GA+kcThB9SRdDca5Zmy80JLRE3jkksnCg9EmgjLXMdAjJ9fx14OmjGw6leshu1gptKUnBqcbOEvGJ7jF857bB/TY74LqP1BpB49My2Tw4d6MMt1oOWU4EoILX3cY2lZiVu0X/CvqMnBBNwl48Roi8iWDi7u2nbf9tW29Sw/7iPWUA1wkj044NL96K7eoLNyWlsYyEnvkCfYl1QKKw0TMLvd5G3ht4TgiIOeVN07jtDLohPqGJz5sW0AX98/Xl+1nhKxGax0FLZzTVnh8whQi8OnH89m2MXlt0+sy9RCWEyGWat0m5il+47Ce/WXhNc3expoXkLJ5qnyCz9znm0Nt9gAATxsF5LcafqyYVZA7q9G3CMXrQ92FE+2wYo3GuK/0m+Vj7B+kl6dLyA1urTOoBnKW9wiHLjOIIgcffZ/6j0whwdFYKNb+RVHNFF1KfW1fqpWtJ2h7m4fFP0zIpfZGe94gXtagReawcTvrRwkTUMICdQsQWBdzlTinFq5v3s928898llPHpUocY70rID0KfuYggOK5ZNw+GTnNs+KH/O+zmQgKL3zFc7HjiyNnKCx+dMP0P/Apphz8DyWoVnhBM=
on:
tags: true
- { stage: lint, python: 3.7, env: TOXENV=flake8 }
- { stage: lint, python: 3.7, env: TOXENV=pylint }
- { stage: lint, python: 3.7, env: TOXENV=bandit }
- { stage: lint, python: 3.7, env: TOXENV=readme }
- stage: deploy
python: 3.7
env:
install: skip
script: skip
deploy:
provider: pypi
distributions: sdist bdist_wheel
user: Bashar.said
password:
secure: D99UQ4DWGbwtry9Yyaszw+qZp0Ma4KZKBMFIe1dwzl8XQdRtdH+duQhPJY62OyYhZd2vD8MlAi/gcN5aknQ9P0GA+kcThB9SRdDca5Zmy80JLRE3jkksnCg9EmgjLXMdAjJ9fx14OmjGw6leshu1gptKUnBqcbOEvGJ7jF857bB/TY74LqP1BpB49My2Tw4d6MMt1oOWU4EoILX3cY2lZiVu0X/CvqMnBBNwl48Roi8iWDi7u2nbf9tW29Sw/7iPWUA1wkj044NL96K7eoLNyWlsYyEnvkCfYl1QKKw0TMLvd5G3ht4TgiIOeVN07jtDLohPqGJz5sW0AX98/Xl+1nhKxGax0FLZzTVnh8whQi8OnH89m2MXlt0+sy9RCWEyGWat0m5il+47Ce/WXhNc3expoXkLJ5qnyCz9znm0Nt9gAATxsF5LcafqyYVZA7q9G3CMXrQ92FE+2wYo3GuK/0m+Vj7B+kl6dLyA1urTOoBnKW9wiHLjOIIgcffZ/6j0whwdFYKNb+RVHNFF1KfW1fqpWtJ2h7m4fFP0zIpfZGe94gXtagReawcTvrRwkTUMICdQsQWBdzlTinFq5v3s928898llPHpUocY70rID0KfuYggOK5ZNw+GTnNs+KH/O+zmQgKL3zFc7HjiyNnKCx+dMP0P/Apphz8DyWoVnhBM=
on:
tags: true
12 changes: 9 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,25 @@ def read_file(filename):
url=package.__url__,
packages=find_packages(exclude=['test*']),
include_package_data=True,
keywords=['django', 'database', 'probes', 'docker', 'kubernetes'],
keywords=[
'django',
'database',
'probes',
'docker',
'kubernetes',
],
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Framework :: Django',
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.0',
'Framework :: Django :: 2.1',
'Framework :: Django :: 3.0',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
)
20 changes: 13 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,34 @@

[tox]
envlist =
# Python/Django combinations that are officially supported
py{27,34,35,36}-django111
py{35,36,37}-django{21,22}
flake8
pylint
bandit
# Python/Django combinations that are officially supported
py{34,35,36,37}-django111
py{35,36,37,38}-django22
py{36,37,38}-django30
readme
clean

[testenv]
description = Unit tests
deps =
py27: mock
pytest-django
pytest-pythonpath
django111: Django>=1.11,<2.0
django21: Django>=2.1,<2.2
django22: Django>=2.2,<3.0
django30: Django>=3.0,<3.1
psycopg2-binary
commands = pytest

[testenv:bandit]
deps = bandit
description = PyCQA security linter
deps = bandit<1.6
commands = bandit -r --ini tox.ini

[testenv:clean]
description = Remove Python bytecode and other debris
deps = pyclean
commands =
py3clean -v {toxinidir}
Expand All @@ -36,16 +39,19 @@ whitelist_externals =
rm

[testenv:flake8]
description = Static code analysis and code style
deps = flake8
commands = flake8

[testenv:pylint]
description = Check for errors and code smells
deps =
django
pylint
commands = pylint django_probes setup

[testenv:readme]
description = Ensure README renders on PyPI
deps = twine
commands =
{envpython} setup.py -q sdist bdist_wheel
Expand All @@ -54,8 +60,8 @@ commands =
[travis:env]
DJANGO =
1.11: django111
2.1: django21
2.2: django22
3.0: django30

[bandit]
exclude = .cache,.git,.tox,build,dist,tests
Expand Down

0 comments on commit 05a1701

Please sign in to comment.