diff --git a/.bandit b/.bandit new file mode 120000 index 0000000..bf39a01 --- /dev/null +++ b/.bandit @@ -0,0 +1 @@ +tox.ini \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index cd922b7..d9fa40a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,39 +1,50 @@ language: python -cache: pip - python: - - 2.7 - - 3.4 - - 3.5 - - 3.6 +- 2.7 +- 3.4 +- 3.5 +- 3.6 +- 3.7 + env: - - DJANGO=1.7 - - DJANGO=1.8 - - DJANGO=1.9 - - DJANGO=1.10 - - DJANGO=1.11 - - DJANGO=2.0 - - DJANGO=2.1 +- DJANGO=1.11 +- DJANGO=2.1 +- DJANGO=2.2 + matrix: exclude: - # Python/Django combinations that aren't officially supported - - { python: 3.5, env: DJANGO=1.7 } - - { python: 3.6, env: DJANGO=1.7 } - - { python: 3.6, env: DJANGO=1.8 } - - { python: 3.6, env: DJANGO=1.9 } - - { python: 3.6, env: DJANGO=1.10 } - - { python: 2.7, env: DJANGO=2.0 } - - { python: 2.7, env: DJANGO=2.1 } - - { python: 3.4, env: DJANGO=2.1 } - include: - - { python: 3.6, env: TOXENV=flake8 } - - { python: 3.6, env: TOXENV=readme, dist: xenial } # requires sqlite3>=3.8.3 which is not in trusty - # Work around Travis Python 3.7 issue: https://github.com/travis-ci/travis-ci/issues/9815 - - { python: 3.7, env: DJANGO=1.11, dist: xenial, sudo: true } - - { python: 3.7, env: DJANGO=2.0, dist: xenial, sudo: true } - - { python: 3.7, env: DJANGO=2.1, dist: xenial, sudo: true } + # Python/Django combinations that aren't officially supported + - { env: DJANGO=1.11, python: 3.7 } + - { env: DJANGO=2.1, python: 2.7 } + - { env: DJANGO=2.1, python: 3.4 } + - { env: DJANGO=2.2, python: 2.7 } + - { env: DJANGO=2.2, python: 3.4 } install: - - pip install tox-travis +- pip install tox-travis script: - - tox +- tox + +stages: +- lint +- test +- deploy + +jobs: + include: + - { stage: lint, env: TOXENV=flake8, python: 3.7 } + - { stage: lint, env: TOXENV=bandit, python: 3.7 } + - { stage: lint, env: TOXENV=readme, python: 3.7 } + - stage: deploy + env: + python: 3.7 + install: skip + script: skip + deploy: + provider: pypi + distributions: sdist bdist_wheel + user: bittner + password: + secure: JrgKNLiONVUmfg+Vt9NxDccXl9DbPqbXq8xfMY4tFb6CfRWCESgt26wPORyFJvP3FB9yvKXRL5Lb5AFWroTM+h1zlsdHmvEnSP4ldSVU8a2U35lqjZgN9lhViYtn2rt+wcvdWToBAAZolHKRzUoElVCHMt5kBQBSI1oSmNfCn6k= + on: + tags: true diff --git a/README.rst b/README.rst index 9b41962..80044b1 100644 --- a/README.rst +++ b/README.rst @@ -32,8 +32,8 @@ an asynchronous version of the Javascript code if possible. .. |coveralls| image:: https://coveralls.io/repos/jazzband/django-analytical/badge.svg :alt: Test coverage :target: https://coveralls.io/r/jazzband/django-analytical -.. |health| image:: https://landscape.io/github/jazzband/django-analytical/master/landscape.svg?style=flat - :target: https://landscape.io/github/jazzband/django-analytical/master +.. |health| image:: https://img.shields.io/codacy/grade/********************/master.svg + :target: https://www.codacy.com/app/jazzband/django-analytical :alt: Code health .. |python-support| image:: https://img.shields.io/pypi/pyversions/django-analytical.svg :target: https://pypi.python.org/pypi/django-analytical diff --git a/tox.ini b/tox.ini index a37c5e9..4c447e8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,15 +1,13 @@ [tox] envlist = # Python/Django combinations that are officially supported - py{27,34}-django17 - py{27,34,35}-django18 - py{27,34,35}-django19 - py{27,34,35}-django110 - py{27,34,35,36,37}-django111 - py{34,35,36,37}-django20 - py{35,36,37}-django21 + py{27,34,35,36}-django111 + py{35,36,37}-django{21,22} flake8 + bandit readme + docs + clean [testenv] commands = @@ -18,16 +16,30 @@ commands = deps = coverage coveralls - django17: Django>=1.7,<1.8 - django18: Django>=1.8,<1.9 - django19: Django>=1.9,<1.10 - django110: Django>=1.10,<1.11 django111: Django>=1.11,<2.0 - django20: Django>=2.0,<2.1 django21: Django>=2.1,<2.2 + django22: Django>=2.2,<3.0 passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH whitelist_externals = sh +[testenv:bandit] +deps = bandit +commands = bandit -r --ini tox.ini + +[testenv:clean] +deps = pyclean +commands = + rm -rf .tox/ django_analytical.egg-info/ build/ dist/ docs/_build/ + py3clean -v {toxinidir} +whitelist_externals = + rm + +[testenv:docs] +deps = sphinx +changedir = docs +commands = make html +whitelist_externals = make + [testenv:flake8] deps = flake8 commands = flake8 @@ -40,13 +52,13 @@ commands = [travis:env] DJANGO = - 1.7: django17 - 1.8: django18 - 1.9: django19 - 1.10: django110 1.11: django111 - 2.0: django20 2.1: django21 + 2.2: django22 + +[bandit] +exclude = .cache,.git,.tox,build,dist,docs,tests +targets = . [flake8] exclude = .cache,.git,.tox,build,dist