Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup and update package #711

Merged
merged 2 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: test

on: [ push, pull_request ]
on: [ push ]

concurrency:
group: test-${{ github.head_ref }}
Expand All @@ -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 @@ -66,22 +63,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]
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
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,10 +25,11 @@ classifiers = [
"Topic :: Utilities",
]
dependencies = [
"Django>=4.1",
"Django>=4.2",
"beautifulsoup4>=4.8.0",
]
description = "Django extensions by Zostera"
description = "Bootstrap 4 for Django"
keywords = ["django", "bootstrap", "bootstrap4"]
license = {file = "LICENSE"}
name = "django-bootstrap4"
readme = "README.md"
Expand All @@ -45,6 +45,11 @@ Source = "https://github.com/zostera/django-bootstrap4"

[tool.ruff]
fix = false
line-length = 120
src = ["src"]
target-version = "py38"

[tool.ruff.lint]
fixable = [
"I001", # isort (sorting)
"F", # flake8
Expand All @@ -57,22 +62,19 @@ ignore = [
"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)
]
line-length = 120
select = [
"D", # pydocstyle
"E", # pycodestyle
"F", # flake8
"I", # isort
"UP", # pyupgrade
]
src = ["src"]
target-version = "py38"
unfixable = [
"F8", # names in flake8, such as defined but unused variables
]

[tool.ruff.isort]
known-first-party = ["bootstrap4", "app"]
[tool.ruff.lint.isort]
known-first-party = ["bootstrap3", "app"]
known-third-party = ["django"]

[tool.coverage.run]
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