Skip to content

Commit

Permalink
Cleanup and update package (#969)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyve authored Apr 18, 2024
1 parent a0a48b3 commit 577d7a4
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 27 deletions.
28 changes: 21 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -64,22 +61,39 @@ jobs:

docs:
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: 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'
Expand Down
16 changes: 16 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -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]
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
20 changes: 11 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=64", "setuptools_scm>=8"]
requires = ["setuptools>=64"]

[project]
authors = [
Expand All @@ -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",
Expand All @@ -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"
Expand All @@ -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"]
Expand Down
4 changes: 3 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 4 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 577d7a4

Please sign in to comment.