Skip to content

Commit

Permalink
Simplify tox, cleanup pyproject.toml, add coverage to test (#911)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyve committed Dec 21, 2023
1 parent d647f29 commit 0d09aaa
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 23 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ jobs:
- run: python -m pip install -e .
- run: coverage run manage.py test
- run: python -m pip install -U coveralls
- run: coverage combine
- name: Upload coveralls (parallel)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ VERSION := $(shell python -c "import bootstrap3;print(bootstrap3.__version__)")

.PHONY: test
test:
python manage.py test
coverage run manage.py test
coverage report

.PHONY: tests
tests:
Expand Down
10 changes: 2 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@

import tomllib

module = importlib.import_module('bootstrap3')

with open("../pyproject.toml", "rb") as f:
pyproject = tomllib.load(f)

project = pyproject["project"]["name"]
conf = {"module": project.replace("-", "_")}

try:
conf.update(pyproject["tool"]["sphinx"]["x-conf"])
except KeyError:
pass

module = importlib.import_module(conf["module"])
release = module.__version__
version = ".".join(release.split(".")[:2])
author = ", ".join(author["name"] for author in pyproject["project"]["authors"])
Expand Down
6 changes: 1 addition & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,11 @@ known-third-party = ["django"]

[tool.coverage.run]
branch = true
parallel = true
source = ["src"]
source = ["src", "tests"]

[tool.coverage.paths]
package = ["src/bootstrap3", "*/django_bootstrap3/src/bootstrap3"]

[tool.coverage.report]
show_missing = true
skip_covered = true

[tool.sphinx.x-conf]
module = "bootstrap3"
15 changes: 7 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,22 @@ setenv =
PYTHONPATH={toxinidir}
PYTHONWARNINGS=all
commands =
coverage run --source=src manage.py test {posargs}
python manage.py test {posargs}
deps =
3.2: Django==3.2.*
4.0: Django==4.0.*
4.1: Django==4.1.*
4.2: Django==4.2.*
5.0: Django==5.0.*
main: https://github.com/django/django/archive/main.tar.gz
coverage
-r{toxinidir}/requirements-test.txt

[testenv:ruff]
basepython = python3.11
allowlist_externals = ruff
deps = ruff
commands = ruff .

[testenv:docs]
basepython = python3.11
allowlist_externals = make
Expand All @@ -43,9 +48,3 @@ commands =
make docs
deps =
-r{toxinidir}/docs/requirements.txt

[testenv:lint]
basepython = python3.11
allowlist_externals = ruff
deps = ruff
commands = ruff .

0 comments on commit 0d09aaa

Please sign in to comment.