Skip to content

Commit

Permalink
Merge pull request jazzband#1348 from ofek/modernize-metadata
Browse files Browse the repository at this point in the history
Update package metadata
  • Loading branch information
ddabble authored May 29, 2024
2 parents 560f298 + 19722e2 commit 6a8918e
Show file tree
Hide file tree
Showing 11 changed files with 140 additions and 98 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,17 @@ jobs:
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U setuptools twine wheel
python -m pip install -U build twine
- name: Build package
run: |
python setup.py --version
python setup.py sdist --format=gztar bdist_wheel
python -m build
twine check dist/*
- name: Upload packages to Jazzband
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: jazzband
password: ${{ secrets.JAZZBAND_RELEASE_KEY }}
repository_url: https://jazzband.co/projects/django-simple-history/upload
repository-url: https://jazzband.co/projects/django-simple-history/upload
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
setup.py
pyproject.toml
tox.ini
requirements/*.txt
Expand Down
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,19 @@ repos:
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-toml
- id: debug-statements
- id: detect-private-key

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 2.1.3
hooks:
- id: pyproject-fmt
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.18
hooks:
- id: validate-pyproject

- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
Expand Down
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ Authors
- Nianpeng Li
- Nick Träger
- Noel James (`NoelJames <https://github.com/NoelJames>`_)
- Ofek Lev (`ofek <https://github.com/ofek>`_)
- Phillip Marshall
- Prakash Venkatraman (`dopatraman <https://github.com/dopatraman>`_)
- Rajesh Pappula
Expand Down
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ Unreleased
- Dropped support for Django 3.2, which reached end-of-life on 2024-04-01 (gh-1344)
- Removed the temporary requirement on ``asgiref>=3.6`` added in 3.5.0,
now that the minimum required Django version is 4.2 (gh-1344)
- Migrated package building from using the deprecated ``setup.py`` to using
``pyproject.toml`` (with Hatchling as build backend);
``setup.py`` has consequently been removed (gh-1348)

.. Start of PyPI readme
3.6.0 (2024-05-26)
------------------
Expand Down
6 changes: 0 additions & 6 deletions MANIFEST.in

This file was deleted.

7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ clean: clean-build clean-pyc
rm -fr htmlcov/

clean-build:
rm -fr build/
rm -fr dist/
rm -fr *.egg-info

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

dist: clean
pip install -U wheel
python setup.py sdist
python setup.py bdist_wheel
pip install -U build
python -m build
for file in dist/* ; do gpg --detach-sign -a "$$file" ; done
ls -l dist

Expand Down
46 changes: 25 additions & 21 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,40 +1,44 @@
django-simple-history
=====================
django-simple-history |pypi-version|
====================================

.. image:: https://github.com/jazzband/django-simple-history/actions/workflows/test.yml/badge.svg
.. Start of PyPI readme
|jazzband| |build-status| |docs| |coverage| |maintainability| |code-style| |downloads|

.. |pypi-version| image:: https://img.shields.io/pypi/v/django-simple-history.svg
:target: https://pypi.org/project/django-simple-history/
:alt: PyPI Version

.. |jazzband| image:: https://jazzband.co/static/img/badge.svg
:target: https://jazzband.co/
:alt: Jazzband

.. |build-status| image:: https://github.com/jazzband/django-simple-history/actions/workflows/test.yml/badge.svg
:target: https://github.com/jazzband/django-simple-history/actions/workflows/test.yml
:alt: Build Status

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

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

.. image:: https://img.shields.io/pypi/v/django-simple-history.svg
:target: https://pypi.org/project/django-simple-history/
:alt: PyPI Version

.. image:: https://api.codeclimate.com/v1/badges/66cfd94e2db991f2d28a/maintainability
.. |maintainability| image:: https://api.codeclimate.com/v1/badges/66cfd94e2db991f2d28a/maintainability
:target: https://codeclimate.com/github/jazzband/django-simple-history/maintainability
:alt: Maintainability

.. image:: https://static.pepy.tech/badge/django-simple-history
:target: https://pepy.tech/project/django-simple-history
:alt: Downloads

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
.. |code-style| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: Code Style

.. image:: https://jazzband.co/static/img/badge.svg
:target: https://jazzband.co/
:alt: Jazzband
.. |downloads| image:: https://static.pepy.tech/badge/django-simple-history
:target: https://pepy.tech/project/django-simple-history
:alt: Downloads


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

This app supports the following combinations of Django and Python:

Expand All @@ -49,9 +53,9 @@ main 3.10, 3.11, 3.12, 3.13-dev
Getting Help
------------

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

Pull requests are welcome. Read the `CONTRIBUTING`_ file for tips on
Pull requests are welcome. Read the `CONTRIBUTING`_ file for tips on
submitting a pull request.

.. _CONTRIBUTING: https://github.com/jazzband/django-simple-history/blob/master/CONTRIBUTING.rst
Expand Down
94 changes: 90 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,85 @@
[build-system]
build-backend = "hatchling.build"
requires = [
"hatch-fancy-pypi-readme",
"hatch-vcs",
"hatchling",
]

[project]
name = "django-simple-history"
description = "Store model history and view/revert changes from admin site."
maintainers = [
{ name = "Trey Hunner" },
]
authors = [
{ name = "Corey Bertram", email = "[email protected]" },
]
requires-python = ">=3.8"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
# DEV: uncomment this when the `pyproject-fmt` pre-commit hook stops removing it
#"Programming Language :: Python :: 3.13",
]
dynamic = [
"readme",
"version",
]
dependencies = [
]
urls.Changelog = "https://github.com/jazzband/django-simple-history/blob/master/CHANGES.rst"
urls.Documentation = "https://django-simple-history.readthedocs.io/en/stable/"
urls.Homepage = "https://github.com/jazzband/django-simple-history"
urls.Source = "https://github.com/jazzband/django-simple-history"
urls.Tracker = "https://github.com/jazzband/django-simple-history/issues"

[tool.hatch.version]
source = "vcs"
fallback-version = "0.0.0"

[tool.hatch.version.raw-options]
version_scheme = "no-guess-dev"
local_scheme = "node-and-date"

[tool.hatch.build.targets.wheel]
# Jazzband's release process is limited to 2.2 metadata
# - see https://github.com/jazzband/help/issues/360
core-metadata-version = "2.2"
packages = [
"simple_history",
]

[tool.hatch.build.targets.sdist]
# Jazzband's release process is limited to 2.2 metadata
# - see https://github.com/jazzband/help/issues/360
core-metadata-version = "2.2"

[tool.hatch.metadata.hooks.fancy-pypi-readme]
content-type = "text/x-rst"
fragments = [
{ path = "README.rst", start-after = ".. Start of PyPI readme\n\n" },
{ text = "\n====\n\nChangelog\n=========\n\n" },
{ path = "CHANGES.rst", start-after = ".. Start of PyPI readme\n\n" },
]

[tool.black]
line-length = 88
target-version = ["py38"]
target-version = [
"py38",
]

[tool.isort]
profile = "black"
Expand All @@ -9,12 +88,19 @@ py_version = "38"
[tool.coverage.run]
parallel = true
branch = true
source = ["simple_history"]
source = [
"simple_history",
]

[tool.coverage.paths]
source = ["simple_history", ".tox/*/site-packages"]
source = [
"simple_history",
".tox/*/site-packages",
]

[tool.coverage.report]
show_missing = true
skip_covered = true
omit = ["requirements/*"]
omit = [
"requirements/*",
]
54 changes: 0 additions & 54 deletions setup.py

This file was deleted.

4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ commands =
[testenv:format]
deps = -rrequirements/lint.txt
commands =
isort docs simple_history runtests.py setup.py
black docs simple_history runtests.py setup.py
isort docs simple_history runtests.py
black docs simple_history runtests.py
flake8 simple_history

[testenv:lint]
Expand Down

0 comments on commit 6a8918e

Please sign in to comment.