mirror of
https://github.com/jazzband/django-analytical.git
synced 2026-03-16 22:20:25 +00:00
Migrate packaging from setup.py to pyproject.toml
This commit is contained in:
parent
8d6419eec8
commit
82fbbeb6b2
11 changed files with 216 additions and 159 deletions
16
.github/workflows/check.yml
vendored
16
.github/workflows/check.yml
vendored
|
|
@ -15,21 +15,21 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
env:
|
env:
|
||||||
- isort
|
- lint
|
||||||
- flake8
|
- format
|
||||||
- bandit
|
- audit
|
||||||
- readme
|
- package
|
||||||
- docs
|
- docs
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions/setup-python@v2
|
- uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.8'
|
python-version: '3.12'
|
||||||
|
|
||||||
- name: Install prerequisites
|
- name: Install prerequisites
|
||||||
run: python -m pip install --upgrade setuptools pip wheel tox
|
run: python -m pip install tox
|
||||||
|
|
||||||
- name: Run ${{ matrix.env }}
|
- name: Run ${{ matrix.env }}
|
||||||
run: tox -e ${{ matrix.env }}
|
run: tox -e ${{ matrix.env }}
|
||||||
|
|
|
||||||
19
.github/workflows/release.yml
vendored
19
.github/workflows/release.yml
vendored
|
|
@ -5,20 +5,24 @@ on:
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
|
|
||||||
|
env:
|
||||||
|
PIP_DISABLE_PIP_VERSION_CHECK: '1'
|
||||||
|
PY_COLORS: '1'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
if: github.repository == 'jazzband/django-analytical'
|
if: github.repository == 'jazzband/django-analytical'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.8'
|
python-version: '3.12'
|
||||||
|
|
||||||
- name: Get pip cache dir
|
- name: Get pip cache dir
|
||||||
id: pip-cache
|
id: pip-cache
|
||||||
|
|
@ -26,7 +30,7 @@ jobs:
|
||||||
echo "::set-output name=dir::$(pip cache dir)"
|
echo "::set-output name=dir::$(pip cache dir)"
|
||||||
|
|
||||||
- name: Cache
|
- name: Cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.pip-cache.outputs.dir }}
|
path: ${{ steps.pip-cache.outputs.dir }}
|
||||||
key: release-${{ hashFiles('**/setup.py') }}
|
key: release-${{ hashFiles('**/setup.py') }}
|
||||||
|
|
@ -35,14 +39,11 @@ jobs:
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install -U pip
|
python -m pip install tox
|
||||||
python -m pip install -U setuptools twine wheel
|
|
||||||
|
|
||||||
- name: Build package
|
- name: Build package
|
||||||
run: |
|
run: |
|
||||||
python setup.py --version
|
tox -e package
|
||||||
python setup.py sdist --format=gztar bdist_wheel
|
|
||||||
twine check dist/*
|
|
||||||
|
|
||||||
- name: Upload packages to Jazzband
|
- name: Upload packages to Jazzband
|
||||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
|
||||||
|
|
|
||||||
37
.github/workflows/test.yml
vendored
37
.github/workflows/test.yml
vendored
|
|
@ -8,6 +8,10 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
|
env:
|
||||||
|
PIP_DISABLE_PIP_VERSION_CHECK: '1'
|
||||||
|
PY_COLORS: '1'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
python-django:
|
python-django:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -15,25 +19,25 @@ jobs:
|
||||||
max-parallel: 5
|
max-parallel: 5
|
||||||
matrix:
|
matrix:
|
||||||
python-version:
|
python-version:
|
||||||
- '3.6'
|
|
||||||
- '3.7'
|
|
||||||
- '3.8'
|
|
||||||
- '3.9'
|
|
||||||
- '3.10'
|
- '3.10'
|
||||||
|
- '3.11'
|
||||||
|
- '3.12'
|
||||||
|
- '3.13'
|
||||||
django-version:
|
django-version:
|
||||||
- '2.2'
|
- '4.2'
|
||||||
- '3.2'
|
- '5.1'
|
||||||
- '4.0'
|
- '5.2'
|
||||||
|
include:
|
||||||
|
- { django-version: '4.2', python-version: '3.8' }
|
||||||
|
- { django-version: '4.2', python-version: '3.9' }
|
||||||
exclude:
|
exclude:
|
||||||
- { django-version: '2.2', python-version: '3.10' }
|
- { django-version: '4.2', python-version: '3.13' }
|
||||||
- { django-version: '4.0', python-version: '3.6' }
|
|
||||||
- { django-version: '4.0', python-version: '3.7' }
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
|
|
@ -43,18 +47,17 @@ jobs:
|
||||||
echo "::set-output name=dir::$(pip cache dir)"
|
echo "::set-output name=dir::$(pip cache dir)"
|
||||||
|
|
||||||
- name: Cache
|
- name: Cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.pip-cache.outputs.dir }}
|
path: ${{ steps.pip-cache.outputs.dir }}
|
||||||
key:
|
key:
|
||||||
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}
|
${{ matrix.python-version }}-v1-${{ hashFiles('**/pyproject.toml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ matrix.python-version }}-v1-
|
${{ matrix.python-version }}-v1-
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install tox tox-gh-actions
|
||||||
python -m pip install --upgrade tox tox-gh-actions
|
|
||||||
|
|
||||||
- name: Tox tests (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }})
|
- name: Tox tests (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }})
|
||||||
run: tox
|
run: tox
|
||||||
|
|
@ -62,6 +65,6 @@ jobs:
|
||||||
DJANGO: ${{ matrix.django-version }}
|
DJANGO: ${{ matrix.django-version }}
|
||||||
|
|
||||||
- name: Upload coverage
|
- name: Upload coverage
|
||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v5
|
||||||
with:
|
with:
|
||||||
name: Python ${{ matrix.python-version }}
|
name: Python ${{ matrix.python-version }}
|
||||||
|
|
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -18,3 +18,6 @@
|
||||||
/docs/_templates/layout.html
|
/docs/_templates/layout.html
|
||||||
/MANIFEST
|
/MANIFEST
|
||||||
*.egg-info
|
*.egg-info
|
||||||
|
|
||||||
|
/requirements.txt
|
||||||
|
/uv.lock
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
Unreleased
|
Unreleased
|
||||||
----------
|
----------
|
||||||
* Remove deprecated Piwik integration. Use Matomo instead! (Peter Bittner)
|
* Remove deprecated Piwik integration. Use Matomo instead! (Peter Bittner)
|
||||||
|
* Migrate packaging from setup.py to pyproject.toml with Ruff for linting
|
||||||
|
and formatting (Peter Bittner)
|
||||||
|
|
||||||
Version 3.1.0
|
Version 3.1.0
|
||||||
-------------
|
-------------
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
"""
|
"""
|
||||||
Analytics service integration for Django projects
|
Analytics service integration for Django projects.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__author__ = "Joost Cassee"
|
__version__ = '3.2.0.dev0'
|
||||||
__email__ = "joost@cassee.net"
|
|
||||||
__version__ = "3.1.0"
|
|
||||||
__copyright__ = "Copyright (C) 2011 Joost Cassee and contributors"
|
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,9 @@ add_function_parentheses = True
|
||||||
pygments_style = 'sphinx'
|
pygments_style = 'sphinx'
|
||||||
|
|
||||||
intersphinx_mapping = {
|
intersphinx_mapping = {
|
||||||
'http://docs.python.org/2.7': None,
|
'python': ('http://docs.python.org/3.13', None),
|
||||||
'http://docs.djangoproject.com/en/1.9':
|
'django': ('http://docs.djangoproject.com/en/stable',
|
||||||
'http://docs.djangoproject.com/en/1.9/_objects/',
|
'http://docs.djangoproject.com/en/stable/_objects/'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
123
pyproject.toml
123
pyproject.toml
|
|
@ -1,20 +1,115 @@
|
||||||
[tool.bandit]
|
[build-system]
|
||||||
# Exclude/ignore of files and TOML reading is currently broken in Bandit
|
build-backend = "setuptools.build_meta"
|
||||||
exclude = [".cache",".git",".github",".tox","build","dist","docs","tests"]
|
requires = ["setuptools>=64"]
|
||||||
|
|
||||||
[tool.black]
|
[project]
|
||||||
color = true
|
name = "django-analytical"
|
||||||
|
dynamic = ["version"]
|
||||||
|
description = "Analytics service integration for Django projects"
|
||||||
|
readme = "README.rst"
|
||||||
|
authors = [
|
||||||
|
{name = "Joost Cassee", email = "joost@cassee.net"},
|
||||||
|
{name = "Joshua Krall", email = "joshuakrall@pobox.com"},
|
||||||
|
{name = "Aleck Landgraf", email = "aleck.landgraf@buildingenergy.com"},
|
||||||
|
{name = "Alexandre Pocquet", email = "apocquet@lecko.fr"},
|
||||||
|
{name = "Bateau Knowledge", email = "info@bateauknowledge.nl"},
|
||||||
|
{name = "Bogdan Bodnar", email = "bogdanbodnar@mail.com"},
|
||||||
|
{name = "Brad Pitcher", email = "bradpitcher@gmail.com"},
|
||||||
|
{name = "Corentin Mercier", email = "corentin@mercier.link"},
|
||||||
|
{name = "Craig Bruce", email = "craig@eyesopen.com"},
|
||||||
|
{name = "Daniel Vitiello", email = "ezdismissal@gmail.com"},
|
||||||
|
{name = "David Smith", email = "smithdc@gmail.com"},
|
||||||
|
{name = "Diederik van der Boor", email = "vdboor@edoburu.nl"},
|
||||||
|
{name = "Eric Amador", email = "eric.amador14@gmail.com"},
|
||||||
|
{name = "Eric Davis", email = "eric@davislv.com"},
|
||||||
|
{name = "Eric Wang", email = "gnawrice@gmail.com"},
|
||||||
|
{name = "Garrett Coakley", email = "garrettc@users.noreply.github.com"},
|
||||||
|
{name = "Garrett Robinson", email = "garrett.f.robinson@gmail.com"},
|
||||||
|
{name = "GreenKahuna", email = "info@greenkahuna.com"},
|
||||||
|
{name = "Hugo Osvaldo Barrera", email = "hugo@barrera.io"},
|
||||||
|
{name = "Ian Ramsay", email = "ianalexr@yahoo.com"},
|
||||||
|
{name = "Iván Raskovsky", email = "raskovsky+git@gmail.com"},
|
||||||
|
{name = "James Paden", email = "james@xemion.com"},
|
||||||
|
{name = "Jannis Leidel", email = "jannis@leidel.info"},
|
||||||
|
{name = "Julien Grenier", email = "julien.grenier42@gmail.com"},
|
||||||
|
{name = "Kevin Olbrich", email = "ko@sv01.de"},
|
||||||
|
{name = "Marc Bourqui", email = "m.bourqui@edsi-tech.com"},
|
||||||
|
{name = "Martey Dodoo", email = "martey@mobolic.com"},
|
||||||
|
{name = "Martín Gaitán", email = "gaitan@gmail.com"},
|
||||||
|
{name = "Matthäus G. Chajdas", email = "dev@anteru.net"},
|
||||||
|
{name = "Max Arnold", email = "arnold.maxim@gmail.com"},
|
||||||
|
{name = "Nikolay Korotkiy", email = "sikmir@gmail.com"},
|
||||||
|
{name = "Paul Oswald", email = "pauloswald@gmail.com"},
|
||||||
|
{name = "Peter Bittner", email = "django@bittner.it"},
|
||||||
|
{name = "Petr Dlouhý", email = "petr.dlouhy@email.cz"},
|
||||||
|
{name = "Philippe O. Wagner", email = "admin@arteria.ch"},
|
||||||
|
{name = "Pi Delport", email = "pjdelport@gmail.com"},
|
||||||
|
{name = "Sandra Mau", email = "sandra.mau@gmail.com"},
|
||||||
|
{name = "Scott Adams", email = "scottadams80@gmail.com"},
|
||||||
|
{name = "Scott Karlin", email = "gitlab@karlin-online.com"},
|
||||||
|
{name = "Sean Wallace", email = "sean@lowpro.ca"},
|
||||||
|
{name = "Sid Mitra", email = "sidmitra.del@gmail.com"},
|
||||||
|
{name = "Simon Ye", email = "sye737@gmail.com"},
|
||||||
|
{name = "Steve Schwarz", email = "steve@agilitynerd.com"},
|
||||||
|
{name = "Steven Skoczen", email = "steven.skoczen@wk.com"},
|
||||||
|
{name = "Tim Gates", email = "tim.gates@iress.com"},
|
||||||
|
{name = "Tinnet Coronam", email = "tinnet@coronam.net"},
|
||||||
|
{name = "Uros Trebec", email = "uros@trebec.org"},
|
||||||
|
{name = "Walter Renner", email = "walter.renner@me.com"},
|
||||||
|
]
|
||||||
|
maintainers = [
|
||||||
|
{name = "Jazzband community", email = "jazzband-bot@users.noreply.github.com"},
|
||||||
|
{name = "Peter Bittner", email = "django@bittner.it"},
|
||||||
|
]
|
||||||
|
keywords=[
|
||||||
|
"django",
|
||||||
|
"analytics",
|
||||||
|
]
|
||||||
|
classifiers=[
|
||||||
|
"Development Status :: 5 - Production/Stable",
|
||||||
|
"Environment :: Web Environment",
|
||||||
|
"Framework :: Django",
|
||||||
|
"Framework :: Django :: 4.2",
|
||||||
|
"Framework :: Django :: 5.1",
|
||||||
|
"Framework :: Django :: 5.2",
|
||||||
|
"Intended Audience :: Developers",
|
||||||
|
"License :: OSI Approved :: MIT License",
|
||||||
|
"Operating System :: OS Independent",
|
||||||
|
"Programming Language :: Python",
|
||||||
|
"Programming Language :: Python :: 3",
|
||||||
|
"Programming Language :: Python :: 3.8",
|
||||||
|
"Programming Language :: Python :: 3.9",
|
||||||
|
"Programming Language :: Python :: 3.10",
|
||||||
|
"Programming Language :: Python :: 3.11",
|
||||||
|
"Programming Language :: Python :: 3.12",
|
||||||
|
"Programming Language :: Python :: 3.13",
|
||||||
|
"Topic :: Internet :: WWW/HTTP",
|
||||||
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
||||||
|
]
|
||||||
|
requires-python = ">=3.8"
|
||||||
|
dependencies = [
|
||||||
|
"django>=4.2",
|
||||||
|
]
|
||||||
|
|
||||||
[tool.coverage.xml]
|
[project.urls]
|
||||||
output = "tests/coverage-report.xml"
|
Homepage = "https://github.com/jazzband/django-analytical"
|
||||||
|
Documentation = "https://django-analytical.readthedocs.io/"
|
||||||
[tool.isort]
|
|
||||||
color_output = true
|
|
||||||
profile = "black"
|
|
||||||
|
|
||||||
[tool.pylint.master]
|
|
||||||
output-format = "colorized"
|
|
||||||
|
|
||||||
[tool.pytest.ini_options]
|
[tool.pytest.ini_options]
|
||||||
addopts = "--junitxml=tests/unittests-report.xml --color=yes --verbose"
|
addopts = "--junitxml=tests/unittests-report.xml --color=yes --verbose"
|
||||||
DJANGO_SETTINGS_MODULE = "tests.testproject.settings"
|
DJANGO_SETTINGS_MODULE = "tests.testproject.settings"
|
||||||
|
|
||||||
|
[tool.ruff.format]
|
||||||
|
quote-style = "single"
|
||||||
|
|
||||||
|
[tool.ruff.lint.flake8-quotes]
|
||||||
|
inline-quotes = "single"
|
||||||
|
|
||||||
|
[tool.setuptools]
|
||||||
|
packages = [
|
||||||
|
"analytical",
|
||||||
|
"analytical.templatetags",
|
||||||
|
]
|
||||||
|
|
||||||
|
[tool.setuptools.dynamic]
|
||||||
|
version = {attr = "analytical.__version__"}
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Django>=2.2.*
|
|
||||||
62
setup.py
62
setup.py
|
|
@ -1,62 +0,0 @@
|
||||||
"""
|
|
||||||
Packaging setup for django-analytical.
|
|
||||||
"""
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
from setuptools import setup
|
|
||||||
|
|
||||||
import analytical as package
|
|
||||||
|
|
||||||
|
|
||||||
def read_file(filename):
|
|
||||||
"""Read a text file and return its contents."""
|
|
||||||
project_home = Path(__file__).parent.resolve()
|
|
||||||
file_path = project_home / filename
|
|
||||||
return file_path.read_text(encoding="utf-8")
|
|
||||||
|
|
||||||
|
|
||||||
setup(
|
|
||||||
name='django-analytical',
|
|
||||||
version=package.__version__,
|
|
||||||
description=package.__doc__.strip(),
|
|
||||||
long_description=read_file('README.rst'),
|
|
||||||
long_description_content_type='text/x-rst',
|
|
||||||
author=package.__author__,
|
|
||||||
author_email=package.__email__,
|
|
||||||
packages=[
|
|
||||||
'analytical',
|
|
||||||
'analytical.templatetags',
|
|
||||||
],
|
|
||||||
keywords=[
|
|
||||||
'django',
|
|
||||||
'analytics',
|
|
||||||
],
|
|
||||||
classifiers=[
|
|
||||||
'Development Status :: 5 - Production/Stable',
|
|
||||||
'Environment :: Web Environment',
|
|
||||||
'Framework :: Django',
|
|
||||||
'Framework :: Django :: 2.2',
|
|
||||||
'Framework :: Django :: 3.2',
|
|
||||||
'Framework :: Django :: 4.0',
|
|
||||||
'Intended Audience :: Developers',
|
|
||||||
'License :: OSI Approved :: MIT License',
|
|
||||||
'Operating System :: OS Independent',
|
|
||||||
'Programming Language :: Python',
|
|
||||||
'Programming Language :: Python :: 3',
|
|
||||||
'Programming Language :: Python :: 3.6',
|
|
||||||
'Programming Language :: Python :: 3.7',
|
|
||||||
'Programming Language :: Python :: 3.8',
|
|
||||||
'Programming Language :: Python :: 3.9',
|
|
||||||
'Programming Language :: Python :: 3.10',
|
|
||||||
'Topic :: Internet :: WWW/HTTP',
|
|
||||||
'Topic :: Software Development :: Libraries :: Python Modules',
|
|
||||||
],
|
|
||||||
python_requires='>=3.6',
|
|
||||||
platforms=['any'],
|
|
||||||
url='https://github.com/jazzband/django-analytical',
|
|
||||||
download_url='https://github.com/jazzband/django-analytical/archive/main.zip',
|
|
||||||
project_urls={
|
|
||||||
'Documentation': 'https://django-analytical.readthedocs.io/',
|
|
||||||
},
|
|
||||||
)
|
|
||||||
99
tox.ini
99
tox.ini
|
|
@ -1,79 +1,98 @@
|
||||||
[tox]
|
[tox]
|
||||||
envlist =
|
envlist =
|
||||||
isort
|
lint
|
||||||
flake8
|
format
|
||||||
bandit
|
audit
|
||||||
# Python/Django combinations that are officially supported
|
# Python/Django combinations that are officially supported
|
||||||
py{36,37,38,39}-django{22}
|
py{38,39,310,311,312}-django{42}
|
||||||
py{36,37,38,39,310}-django{32}
|
py{310,311,312,313}-django{51}
|
||||||
py{38,39,310}-django{40}
|
py{310,311,312,313}-django{52}
|
||||||
readme
|
package
|
||||||
docs
|
docs
|
||||||
|
clean
|
||||||
|
|
||||||
[gh-actions]
|
[gh-actions]
|
||||||
python =
|
python =
|
||||||
3.6: py36
|
|
||||||
3.7: py37
|
|
||||||
3.8: py38
|
3.8: py38
|
||||||
3.9: py39
|
3.9: py39
|
||||||
3.10: py310
|
3.10: py310
|
||||||
|
3.10: py310
|
||||||
|
3.11: py311
|
||||||
|
3.12: py312
|
||||||
|
3.13: py313
|
||||||
|
|
||||||
[gh-actions:env]
|
[gh-actions:env]
|
||||||
DJANGO =
|
DJANGO =
|
||||||
2.2: django22
|
4.2: django42
|
||||||
3.2: django32
|
5.1: django51
|
||||||
4.0: django40
|
5.2: django52
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
description = Unit tests
|
description = Unit tests
|
||||||
deps =
|
deps =
|
||||||
coverage[toml]
|
coverage[toml]
|
||||||
pytest-django
|
pytest-django
|
||||||
django22: Django>=2.2,<3.0
|
django42: Django>=4.2,<5.0
|
||||||
django32: Django>=3.2,<4.0
|
django51: Django>=5.1,<5.2
|
||||||
django40: Django>=4.0,<4.1
|
django52: Django>=5.2,<6.0
|
||||||
commands =
|
commands =
|
||||||
coverage run -m pytest {posargs}
|
coverage run -m pytest {posargs}
|
||||||
coverage xml
|
coverage xml
|
||||||
|
|
||||||
|
[testenv:audit]
|
||||||
|
description = Scan for vulnerable dependencies
|
||||||
|
skip_install = true
|
||||||
|
deps =
|
||||||
|
pip-audit
|
||||||
|
uv
|
||||||
|
commands =
|
||||||
|
uv export --no-emit-project --no-hashes -o requirements.txt -q
|
||||||
|
pip-audit {posargs:-r requirements.txt --progress-spinner off}
|
||||||
|
|
||||||
[testenv:bandit]
|
[testenv:bandit]
|
||||||
description = PyCQA security linter
|
description = PyCQA security linter
|
||||||
|
skip_install = true
|
||||||
deps = bandit
|
deps = bandit
|
||||||
commands = -bandit {posargs:-r analytical} -v
|
commands = bandit {posargs:-r analytical} -v
|
||||||
|
|
||||||
|
[testenv:clean]
|
||||||
|
description = Clean up bytecode and build artifacts
|
||||||
|
skip_install = true
|
||||||
|
deps = pyclean
|
||||||
|
commands = pyclean {posargs:. --debris --erase requirements.txt tests/unittests-report.xml --yes}
|
||||||
|
|
||||||
[testenv:docs]
|
[testenv:docs]
|
||||||
description = Build the HTML documentation
|
description = Build the HTML documentation
|
||||||
deps = sphinx
|
deps = sphinx
|
||||||
commands = sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
|
commands = sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
|
||||||
|
|
||||||
[testenv:flake8]
|
[testenv:format]
|
||||||
description = Static code analysis and code style
|
description = Ensure consistent code style (Ruff)
|
||||||
deps = flake8
|
skip_install = true
|
||||||
commands = flake8 {posargs}
|
deps = ruff
|
||||||
|
commands = ruff format {posargs:--check --diff .}
|
||||||
|
|
||||||
[testenv:isort]
|
[testenv:lint]
|
||||||
description = Ensure imports are ordered consistently
|
description = Lightening-fast linting (Ruff)
|
||||||
deps = isort[colors]
|
skip_install = true
|
||||||
commands = isort --check-only --diff {posargs:analytical setup.py tests}
|
deps = ruff
|
||||||
|
commands = ruff check {posargs:--output-format=full .}
|
||||||
|
|
||||||
[testenv:readme]
|
[testenv:mypy]
|
||||||
description = Ensure README renders on PyPI
|
description = Perform static type checking
|
||||||
|
deps = mypy
|
||||||
|
commands = mypy {posargs:.}
|
||||||
|
|
||||||
|
[testenv:package]
|
||||||
|
description = Build package and check metadata (or upload package)
|
||||||
|
skip_install = true
|
||||||
deps =
|
deps =
|
||||||
build
|
build
|
||||||
twine
|
twine
|
||||||
commands =
|
commands =
|
||||||
python -m build
|
python -m build
|
||||||
twine check dist/*
|
twine {posargs:check --strict} dist/*
|
||||||
|
passenv =
|
||||||
[testenv:clean]
|
TWINE_USERNAME
|
||||||
description = Clean up bytecode and build artifacts
|
TWINE_PASSWORD
|
||||||
deps = pyclean
|
TWINE_REPOSITORY_URL
|
||||||
commands =
|
|
||||||
pyclean {posargs:.}
|
|
||||||
rm -rf .tox/ build/ dist/ django_analytical.egg-info/ .coverage coverage.xml tests/coverage-report.xml tests/unittests-report.xml
|
|
||||||
allowlist_externals =
|
|
||||||
rm
|
|
||||||
|
|
||||||
[flake8]
|
|
||||||
exclude = .cache,.git,.tox,build,dist
|
|
||||||
max-line-length = 100
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue