diff --git a/.bandit b/.bandit deleted file mode 120000 index bf39a01..0000000 --- a/.bandit +++ /dev/null @@ -1 +0,0 @@ -tox.ini \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 59142fd..4784861 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: '3.8' - name: Get pip cache dir id: pip-cache diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 28c6eaf..1f9df91 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ on: - master jobs: - build: + python-django: runs-on: ubuntu-latest strategy: max-parallel: 5 @@ -24,6 +24,10 @@ jobs: - '2.2' - '3.2' - '4.0' + exclude: + - { django-version: '2.2', python-version: '3.10' } + - { django-version: '4.0', python-version: '3.6' } + - { django-version: '4.0', python-version: '3.7' } steps: - uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore index c702437..4f17f7d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /.tox /.coverage /coverage.xml +/tests/reports /build /dist diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..c51c02e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,19 @@ +[tool.bandit] +# Exclude/ignore of files is currently broken in Bandit. + +[tool.black] +color = true + +[tool.coverage.xml] +output = "tests/reports/coverage.xml" + +[tool.isort] +color_output = true +profile = "black" + +[tool.pylint.master] +output-format = "colorized" + +[tool.pytest.ini_options] +addopts = "--junitxml=tests/reports/unittests.xml --color=yes --verbose" +DJANGO_SETTINGS_MODULE = "tests.testproject.settings" diff --git a/tox.ini b/tox.ini index 9387fdd..cf70de9 100644 --- a/tox.ini +++ b/tox.ini @@ -17,48 +17,32 @@ deps = pytest-django django22: Django>=2.2,<3.0 django32: Django>=3.2,<4.0 - django40: Django>=4.0a1,<4.1 - + django40: Django>=4.0,<4.1 commands = coverage run -m pytest coverage xml -[gh-actions] -python = - 3.6: py36 - 3.7: py37 - 3.8: py38 - 3.9: py39 - 3.10: py310 - -[gh-actions:env] -DJANGO = - 2.2: django22 - 3.2: django32 - 4.0: django40 - [testenv:bandit] description = PyCQA security linter deps = bandit<1.6 -commands = - bandit -r --ini tox.ini -ignore_errors = true +commands = -bandit --ini tox.ini {posargs:-r .} [testenv:docs] description = Build the HTML documentation deps = sphinx commands = sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html -whitelist_externals = make +allowlist_externals = make [testenv:flake8] description = Static code analysis and code style deps = flake8 -commands = flake8 +commands = flake8 {posargs} [testenv:isort] -description = Ensure imports are ordered +description = Ensure imports are ordered consistently +deps = isort[colors] +commands = isort --check-only --diff {posargs:analytical setup.py tests} skip_install = True -deps = isort -commands = isort tests setup.py analytical --check --diff [testenv:readme] description = Ensure README renders on PyPI @@ -73,13 +57,26 @@ deps = pyclean commands = pyclean -v {toxinidir} rm -rf .tox/ build/ dist/ django_analytical.egg-info/ .coverage coverage.xml -whitelist_externals = +allowlist_externals = rm [bandit] -exclude = .cache,.git,.tox,build,dist,docs,tests -targets = . +exclude = .git,.github,.tox,build,dist,docs,tests [flake8] exclude = .cache,.git,.tox,build,dist max-line-length = 100 + +[gh-actions] +python = + 3.6: py36 + 3.7: py37 + 3.8: py38 + 3.9: py39 + 3.10: py310 + +[gh-actions:env] +DJANGO = + 2.2: django22 + 3.2: django32 + 4.0: django40