diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ee131569..b32946cd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,15 +15,12 @@ jobs: tests_matrix: runs-on: ubuntu-latest + needs: [ ruff ] strategy: matrix: python-version: [3.8, 3.9, "3.10", 3.11, 3.12] - django-version: [4.1, 4.2, 5.0, "main"] + django-version: [4.2, 5.0, "main"] exclude: - # Django 4.1 - - python-version: 3.12 - django-version: 4.1 - # Django 4.2 - python-version: 3.12 django-version: 4.2 @@ -64,6 +61,7 @@ jobs: docs: runs-on: ubuntu-latest + needs: [ tests_matrix ] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -71,15 +69,31 @@ jobs: python-version: "3.11" cache: 'pip' cache-dependency-path: docs/requirements.txt - - name: Install and build + - name: Build documentation run: | python -m pip install -r docs/requirements.txt make docs + build: + runs-on: ubuntu-latest + needs: [ tests_matrix ] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + cache: 'pip' + cache-dependency-path: requirements-dev.txt + - name: Build package + run: | + python -m pip install -r requirements-dev.txt + make build + + tests: if: always() runs-on: ubuntu-latest - needs: [ tests_matrix, ruff, docs ] + needs: [ tests_matrix, ruff, docs, build ] steps: - name: Check tests matrix status if: needs.tests_matrix.result != 'success' diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..748fbcbf --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,16 @@ +include LICENSE +include MANIFEST.in +include *.yaml +include pyproject.toml +include *.md +include *.py +include *.txt +include Makefile +include tox.ini +include docs/*.rst docs/*.txt docs/*.py docs/Makefile +graft src +graft tests +graft example +prune docs/_build +exclude example/db.sqlite3 +global-exclude *.py[cod] diff --git a/Makefile b/Makefile index 5fdc9a70..64725355 100644 --- a/Makefile +++ b/Makefile @@ -12,11 +12,11 @@ tests: .PHONY: reformat reformat: ruff format . - ruff check . --fix + ruff --fix . .PHONY: lint lint: - ruff check . + ruff . .PHONY: docs docs: clean @@ -45,12 +45,15 @@ else endif .PHONY: build -build: docs +build: python -m build + twine check dist/* + check-manifest + pyroma . + check-wheel-contents dist .PHONY: publish -publish: porcelain branch build - twine check dist/* +publish: porcelain branch docs build twine upload dist/* git tag -a v${VERSION} -m "Release ${VERSION}" git push origin --tags diff --git a/pyproject.toml b/pyproject.toml index 4d19c6f3..74c035d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] build-backend = "setuptools.build_meta" -requires = ["setuptools>=64", "setuptools_scm>=8"] +requires = ["setuptools>=64"] [project] authors = [ @@ -10,7 +10,6 @@ classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", - "Framework :: Django :: 4.1", "Framework :: Django :: 4.2", "Framework :: Django :: 5.0", "Intended Audience :: Developers", @@ -26,9 +25,10 @@ classifiers = [ "Topic :: Utilities", ] dependencies = [ - "Django>=4.1", + "Django>=4.2", ] description = "Bootstrap 3 for Django" +keywords = ["django", "bootstrap", "bootstrap3"] license = {file = "LICENSE"} name = "django-bootstrap3" readme = "README.md" @@ -45,30 +45,32 @@ Source = "https://github.com/zostera/django-bootstrap3" [tool.ruff] fix = false line-length = 120 -lint.fixable = [ +src = ["src"] +target-version = "py38" + +[tool.ruff.lint] +fixable = [ "I001", # isort (sorting) "F", # flake8 "D", # docformatter "UP", # pyupgrade ] -lint.ignore = [ +ignore = [ "D1", # D1: Missing docstring error codes (because not every function and class has a docstring) "D203", # D203: 1 blank line required before class docstring (conflicts with D211 and should be disabled, see https://github.com/PyCQA/pydocstyle/pull/91) "D212", # D212: Multi-line docstring summary should start at the first line "D301", # D301: Use r”“” if any backslashes in a docstring (unclear how else to handle backslashes in docstrings) ] -lint.select = [ +select = [ "D", # pydocstyle "E", # pycodestyle "F", # flake8 "I", # isort "UP", # pyupgrade ] -lint.unfixable = [ +unfixable = [ "F8", # names in flake8, such as defined but unused variables ] -src = ["src"] -target-version = "py38" [tool.ruff.lint.isort] known-first-party = ["bootstrap3", "app"] diff --git a/requirements-dev.txt b/requirements-dev.txt index 4b0815ab..25a27c28 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,4 +3,6 @@ twine==5.0.0 build==1.2.1 setuptools==69.5.1 -setuptools-scm==8.0.4 +check-manifest==0.49 +pyroma==4.2 +check-wheel-contents==0.6.0 diff --git a/tox.ini b/tox.ini index d9ae827a..5673c0b8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,17 +1,16 @@ [tox] args_are_paths = false envlist = - py38-{4.1,4.2}, - py39-{4.1,4.2}, - py310-{4.1,4.2,5.0,main}, - py311-{4.1,4.2,5.0,main}, + py38-{4.2}, + py39-{4.2}, + py310-{4.2,5.0,main}, + py311-{4.2,5.0,main}, py312-{4.2,5.0,main}, docs, lint, [testenv] basepython = - py37: python3.7 py38: python3.8 py39: python3.9 py310: python3.10