Skip to content

Commit 6a8918e

Browse files
authored
Merge pull request #1348 from ofek/modernize-metadata
Update package metadata
2 parents 560f298 + 19722e2 commit 6a8918e

File tree

11 files changed

+140
-98
lines changed

11 files changed

+140
-98
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,17 @@ jobs:
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install -U pip
27-
python -m pip install -U setuptools twine wheel
27+
python -m pip install -U build twine
2828
2929
- name: Build package
3030
run: |
31-
python setup.py --version
32-
python setup.py sdist --format=gztar bdist_wheel
31+
python -m build
3332
twine check dist/*
3433
3534
- name: Upload packages to Jazzband
3635
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
37-
uses: pypa/gh-action-pypi-publish@master
36+
uses: pypa/gh-action-pypi-publish@release/v1
3837
with:
3938
user: jazzband
4039
password: ${{ secrets.JAZZBAND_RELEASE_KEY }}
41-
repository_url: https://jazzband.co/projects/django-simple-history/upload
40+
repository-url: https://jazzband.co/projects/django-simple-history/upload

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
python-version: ${{ matrix.python-version }}
6666
cache: 'pip'
6767
cache-dependency-path: |
68-
setup.py
68+
pyproject.toml
6969
tox.ini
7070
requirements/*.txt
7171

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,19 @@ repos:
3535
- id: check-docstring-first
3636
- id: check-executables-have-shebangs
3737
- id: check-merge-conflict
38+
- id: check-toml
3839
- id: debug-statements
3940
- id: detect-private-key
4041

42+
- repo: https://github.com/tox-dev/pyproject-fmt
43+
rev: 2.1.3
44+
hooks:
45+
- id: pyproject-fmt
46+
- repo: https://github.com/abravalheri/validate-pyproject
47+
rev: v0.18
48+
hooks:
49+
- id: validate-pyproject
50+
4151
- repo: https://github.com/adrienverge/yamllint
4252
rev: v1.35.1
4353
hooks:

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ Authors
109109
- Nianpeng Li
110110
- Nick Träger
111111
- Noel James (`NoelJames <https://github.com/NoelJames>`_)
112+
- Ofek Lev (`ofek <https://github.com/ofek>`_)
112113
- Phillip Marshall
113114
- Prakash Venkatraman (`dopatraman <https://github.com/dopatraman>`_)
114115
- Rajesh Pappula

CHANGES.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ Unreleased
77
- Dropped support for Django 3.2, which reached end-of-life on 2024-04-01 (gh-1344)
88
- Removed the temporary requirement on ``asgiref>=3.6`` added in 3.5.0,
99
now that the minimum required Django version is 4.2 (gh-1344)
10+
- Migrated package building from using the deprecated ``setup.py`` to using
11+
``pyproject.toml`` (with Hatchling as build backend);
12+
``setup.py`` has consequently been removed (gh-1348)
13+
14+
.. Start of PyPI readme
1015
1116
3.6.0 (2024-05-26)
1217
------------------

MANIFEST.in

Lines changed: 0 additions & 6 deletions
This file was deleted.

Makefile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ clean: clean-build clean-pyc
44
rm -fr htmlcov/
55

66
clean-build:
7-
rm -fr build/
87
rm -fr dist/
9-
rm -fr *.egg-info
108

119
clean-pyc:
1210
find . -name '*.pyc' -exec rm -f {} +
@@ -27,9 +25,8 @@ documentation:
2725
tox -e docs
2826

2927
dist: clean
30-
pip install -U wheel
31-
python setup.py sdist
32-
python setup.py bdist_wheel
28+
pip install -U build
29+
python -m build
3330
for file in dist/* ; do gpg --detach-sign -a "$$file" ; done
3431
ls -l dist
3532

README.rst

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,44 @@
1-
django-simple-history
2-
=====================
1+
django-simple-history |pypi-version|
2+
====================================
33

4-
.. image:: https://github.com/jazzband/django-simple-history/actions/workflows/test.yml/badge.svg
4+
.. Start of PyPI readme
5+
6+
|jazzband| |build-status| |docs| |coverage| |maintainability| |code-style| |downloads|
7+
8+
.. |pypi-version| image:: https://img.shields.io/pypi/v/django-simple-history.svg
9+
:target: https://pypi.org/project/django-simple-history/
10+
:alt: PyPI Version
11+
12+
.. |jazzband| image:: https://jazzband.co/static/img/badge.svg
13+
:target: https://jazzband.co/
14+
:alt: Jazzband
15+
16+
.. |build-status| image:: https://github.com/jazzband/django-simple-history/actions/workflows/test.yml/badge.svg
517
:target: https://github.com/jazzband/django-simple-history/actions/workflows/test.yml
618
:alt: Build Status
719

8-
.. image:: https://readthedocs.org/projects/django-simple-history/badge/?version=latest
20+
.. |docs| image:: https://readthedocs.org/projects/django-simple-history/badge/?version=latest
921
:target: https://django-simple-history.readthedocs.io/en/latest/?badge=latest
1022
:alt: Documentation Status
1123

12-
.. image:: https://img.shields.io/codecov/c/github/jazzband/django-simple-history/master.svg
24+
.. |coverage| image:: https://img.shields.io/codecov/c/github/jazzband/django-simple-history/master.svg
1325
:target: https://app.codecov.io/github/jazzband/django-simple-history?branch=master
1426
:alt: Test Coverage
1527

16-
.. image:: https://img.shields.io/pypi/v/django-simple-history.svg
17-
:target: https://pypi.org/project/django-simple-history/
18-
:alt: PyPI Version
19-
20-
.. image:: https://api.codeclimate.com/v1/badges/66cfd94e2db991f2d28a/maintainability
28+
.. |maintainability| image:: https://api.codeclimate.com/v1/badges/66cfd94e2db991f2d28a/maintainability
2129
:target: https://codeclimate.com/github/jazzband/django-simple-history/maintainability
2230
:alt: Maintainability
2331

24-
.. image:: https://static.pepy.tech/badge/django-simple-history
25-
:target: https://pepy.tech/project/django-simple-history
26-
:alt: Downloads
27-
28-
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
32+
.. |code-style| image:: https://img.shields.io/badge/code%20style-black-000000.svg
2933
:target: https://github.com/psf/black
3034
:alt: Code Style
3135

32-
.. image:: https://jazzband.co/static/img/badge.svg
33-
:target: https://jazzband.co/
34-
:alt: Jazzband
36+
.. |downloads| image:: https://static.pepy.tech/badge/django-simple-history
37+
:target: https://pepy.tech/project/django-simple-history
38+
:alt: Downloads
3539

3640

37-
django-simple-history stores Django model state on every create/update/delete.
41+
``django-simple-history`` stores Django model state on every create/update/delete.
3842

3943
This app supports the following combinations of Django and Python:
4044

@@ -49,9 +53,9 @@ main 3.10, 3.11, 3.12, 3.13-dev
4953
Getting Help
5054
------------
5155

52-
Documentation is available at https://django-simple-history.readthedocs.io/
56+
Documentation is available at https://django-simple-history.readthedocs.io/en/stable/
5357

54-
Pull requests are welcome. Read the `CONTRIBUTING`_ file for tips on
58+
Pull requests are welcome. Read the `CONTRIBUTING`_ file for tips on
5559
submitting a pull request.
5660

5761
.. _CONTRIBUTING: https://github.com/jazzband/django-simple-history/blob/master/CONTRIBUTING.rst

pyproject.toml

Lines changed: 90 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,85 @@
1+
[build-system]
2+
build-backend = "hatchling.build"
3+
requires = [
4+
"hatch-fancy-pypi-readme",
5+
"hatch-vcs",
6+
"hatchling",
7+
]
8+
9+
[project]
10+
name = "django-simple-history"
11+
description = "Store model history and view/revert changes from admin site."
12+
maintainers = [
13+
{ name = "Trey Hunner" },
14+
]
15+
authors = [
16+
{ name = "Corey Bertram", email = "[email protected]" },
17+
]
18+
requires-python = ">=3.8"
19+
classifiers = [
20+
"Development Status :: 5 - Production/Stable",
21+
"Environment :: Web Environment",
22+
"Framework :: Django",
23+
"Framework :: Django :: 4.2",
24+
"Framework :: Django :: 5.0",
25+
"Intended Audience :: Developers",
26+
"License :: OSI Approved :: BSD License",
27+
"Programming Language :: Python",
28+
"Programming Language :: Python :: 3 :: Only",
29+
"Programming Language :: Python :: 3.8",
30+
"Programming Language :: Python :: 3.9",
31+
"Programming Language :: Python :: 3.10",
32+
"Programming Language :: Python :: 3.11",
33+
"Programming Language :: Python :: 3.12",
34+
# DEV: uncomment this when the `pyproject-fmt` pre-commit hook stops removing it
35+
#"Programming Language :: Python :: 3.13",
36+
]
37+
dynamic = [
38+
"readme",
39+
"version",
40+
]
41+
dependencies = [
42+
]
43+
urls.Changelog = "https://github.com/jazzband/django-simple-history/blob/master/CHANGES.rst"
44+
urls.Documentation = "https://django-simple-history.readthedocs.io/en/stable/"
45+
urls.Homepage = "https://github.com/jazzband/django-simple-history"
46+
urls.Source = "https://github.com/jazzband/django-simple-history"
47+
urls.Tracker = "https://github.com/jazzband/django-simple-history/issues"
48+
49+
[tool.hatch.version]
50+
source = "vcs"
51+
fallback-version = "0.0.0"
52+
53+
[tool.hatch.version.raw-options]
54+
version_scheme = "no-guess-dev"
55+
local_scheme = "node-and-date"
56+
57+
[tool.hatch.build.targets.wheel]
58+
# Jazzband's release process is limited to 2.2 metadata
59+
# - see https://github.com/jazzband/help/issues/360
60+
core-metadata-version = "2.2"
61+
packages = [
62+
"simple_history",
63+
]
64+
65+
[tool.hatch.build.targets.sdist]
66+
# Jazzband's release process is limited to 2.2 metadata
67+
# - see https://github.com/jazzband/help/issues/360
68+
core-metadata-version = "2.2"
69+
70+
[tool.hatch.metadata.hooks.fancy-pypi-readme]
71+
content-type = "text/x-rst"
72+
fragments = [
73+
{ path = "README.rst", start-after = ".. Start of PyPI readme\n\n" },
74+
{ text = "\n====\n\nChangelog\n=========\n\n" },
75+
{ path = "CHANGES.rst", start-after = ".. Start of PyPI readme\n\n" },
76+
]
77+
178
[tool.black]
279
line-length = 88
3-
target-version = ["py38"]
80+
target-version = [
81+
"py38",
82+
]
483

584
[tool.isort]
685
profile = "black"
@@ -9,12 +88,19 @@ py_version = "38"
988
[tool.coverage.run]
1089
parallel = true
1190
branch = true
12-
source = ["simple_history"]
91+
source = [
92+
"simple_history",
93+
]
1394

1495
[tool.coverage.paths]
15-
source = ["simple_history", ".tox/*/site-packages"]
96+
source = [
97+
"simple_history",
98+
".tox/*/site-packages",
99+
]
16100

17101
[tool.coverage.report]
18102
show_missing = true
19103
skip_covered = true
20-
omit = ["requirements/*"]
104+
omit = [
105+
"requirements/*",
106+
]

setup.py

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)