Skip to content

Commit bc9909f

Browse files
Switch repo to Django Commons (#1429)
* Switch to Django Common's code of conduct * Switch to Django Commons release workflow This uses the PyPI GitHub trusted publisher integration. * Update references to Django Commons. * Update release process to latest version of Django Commons best practices. --------- Co-authored-by: Anders <6058745+ddabble@users.noreply.github.com>
1 parent 9fb7c5c commit bc9909f

File tree

13 files changed

+114
-114
lines changed

13 files changed

+114
-114
lines changed

.github/workflows/release.yml

Lines changed: 82 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,102 @@
11
---
2-
name: Release
2+
name: Publish Python 🐍 distribution 📦 to PyPI
33

44
on:
55
push:
66
tags:
7+
# Order matters, the last rule that applies to a tag
8+
# is the one that takes effect:
9+
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-including-and-excluding-branches-and-tags
710
- '*'
11+
# There should be no dev tags created, but to be safe,
12+
# let's not publish them.
13+
- '!*.dev*'
14+
15+
env:
16+
PYPI_URL: https://pypi.org/p/django-simple-history
817

918
jobs:
19+
1020
build:
11-
if: github.repository == 'jazzband/django-simple-history'
21+
name: Build distribution 📦
1222
runs-on: ubuntu-latest
1323

1424
steps:
1525
- uses: actions/checkout@v4
16-
with:
17-
fetch-depth: 0
18-
1926
- name: Set up Python
2027
uses: actions/setup-python@v5
2128
with:
22-
python-version: 3.x
29+
python-version: "3.x"
30+
- name: Install pypa/build
31+
run:
32+
python3 -m pip install build --user
33+
- name: Build a binary wheel and a source tarball
34+
run: python3 -m build
35+
- name: Store the distribution packages
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: python-package-distributions
39+
path: dist/
40+
41+
publish-to-pypi:
42+
name: >-
43+
Publish Python 🐍 distribution 📦 to PyPI
44+
needs:
45+
- build
46+
runs-on: ubuntu-latest
47+
environment:
48+
name: pypi
49+
url: ${{ env.PYPI_URL }}
50+
permissions:
51+
id-token: write # IMPORTANT: mandatory for trusted publishing
52+
steps:
53+
- name: Download all the dists
54+
uses: actions/download-artifact@v4
55+
with:
56+
name: python-package-distributions
57+
path: dist/
58+
- name: Publish distribution 📦 to PyPI
59+
uses: pypa/gh-action-pypi-publish@release/v1.12
2360

24-
- name: Install dependencies
25-
run: |
26-
python -m pip install -U pip
27-
python -m pip install -U build twine
61+
github-release:
62+
name: >-
63+
Sign the Python 🐍 distribution 📦 with Sigstore
64+
and upload them to GitHub Release
65+
needs:
66+
- publish-to-pypi
67+
runs-on: ubuntu-latest
2868

29-
- name: Build package
30-
run: |
31-
python -m build
32-
twine check dist/*
69+
permissions:
70+
contents: write # IMPORTANT: mandatory for making GitHub Releases
71+
id-token: write # IMPORTANT: mandatory for sigstore
3372

34-
- name: Upload packages to Jazzband
35-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
36-
uses: pypa/gh-action-pypi-publish@release/v1
73+
steps:
74+
- name: Download all the dists
75+
uses: actions/download-artifact@v4
76+
with:
77+
name: python-package-distributions
78+
path: dist/
79+
- name: Sign the dists with Sigstore
80+
uses: sigstore/gh-action-sigstore-python@v3.0.0
3781
with:
38-
user: jazzband
39-
password: ${{ secrets.JAZZBAND_RELEASE_KEY }}
40-
repository-url: https://jazzband.co/projects/django-simple-history/upload
82+
inputs: >-
83+
./dist/*.tar.gz
84+
./dist/*.whl
85+
- name: Create GitHub Release
86+
env:
87+
GITHUB_TOKEN: ${{ github.token }}
88+
run: >-
89+
gh release create
90+
'${{ github.ref_name }}'
91+
--repo '${{ github.repository }}'
92+
--notes ""
93+
- name: Upload artifact signatures to GitHub Release
94+
env:
95+
GITHUB_TOKEN: ${{ github.token }}
96+
# Upload to GitHub Release using the `gh` CLI.
97+
# `dist/` contains the built packages, and the
98+
# sigstore-produced signatures and certificates.
99+
run: >-
100+
gh release upload
101+
'${{ github.ref_name }}' dist/**
102+
--repo '${{ github.repository }}'

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Unreleased
55
----------
66

77
- Tests are no longer bundled in released wheels (gh-1478)
8+
- Move repository to the Django Commons organization (gh-1391)
89

910
3.9.0 (2025-01-26)
1011
------------------

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,3 @@
11
# Code of Conduct
22

3-
As contributors and maintainers of the Jazzband projects, and in the interest of
4-
fostering an open and welcoming community, we pledge to respect all people who
5-
contribute through reporting issues, posting feature requests, updating documentation,
6-
submitting pull requests or patches, and other activities.
7-
8-
We are committed to making participation in the Jazzband a harassment-free experience
9-
for everyone, regardless of the level of experience, gender, gender identity and
10-
expression, sexual orientation, disability, personal appearance, body size, race,
11-
ethnicity, age, religion, or nationality.
12-
13-
Examples of unacceptable behavior by participants include:
14-
15-
- The use of sexualized language or imagery
16-
- Personal attacks
17-
- Trolling or insulting/derogatory comments
18-
- Public or private harassment
19-
- Publishing other's private information, such as physical or electronic addresses,
20-
without explicit permission
21-
- Other unethical or unprofessional conduct
22-
23-
The Jazzband roadies have the right and responsibility to remove, edit, or reject
24-
comments, commits, code, wiki edits, issues, and other contributions that are not
25-
aligned to this Code of Conduct, or to ban temporarily or permanently any contributor
26-
for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
27-
28-
By adopting this Code of Conduct, the roadies commit themselves to fairly and
29-
consistently applying these principles to every aspect of managing the jazzband
30-
projects. Roadies who do not follow or enforce the Code of Conduct may be permanently
31-
removed from the Jazzband roadies.
32-
33-
This code of conduct applies both within project spaces and in public spaces when an
34-
individual is representing the project or its community.
35-
36-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by
37-
contacting the roadies at `roadies@jazzband.co`. All complaints will be reviewed and
38-
investigated and will result in a response that is deemed necessary and appropriate to
39-
the circumstances. Roadies are obligated to maintain confidentiality with regard to the
40-
reporter of an incident.
41-
42-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version
43-
1.3.0, available at [https://contributor-covenant.org/version/1/3/0/][version]
44-
45-
[homepage]: https://contributor-covenant.org
46-
[version]: https://contributor-covenant.org/version/1/3/0/
3+
The `django-simple-history` project utilizes the [Django Commons Code of Conduct](https://github.com/django-commons/membership/blob/main/CODE_OF_CONDUCT.md).

CONTRIBUTING.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
Contributing to django-simple-history
22
=====================================
33

4-
.. image:: https://jazzband.co/static/img/jazzband.svg
5-
:target: https://jazzband.co/
6-
:alt: Jazzband
7-
8-
This is a `Jazzband <https://jazzband.co>`_ project. By contributing you agree to abide by the `Contributor Code of Conduct <https://jazzband.co/about/conduct>`_ and follow the `guidelines <https://jazzband.co/about/guidelines>`_.
4+
By contributing you agree to abide by the `Contributor Code of Conduct <https://github.com/django-commons/django-simple-history/blob/master/CODE_OF_CONDUCT.md>`_.
95

106
Pull Requests
117
-------------

README.rst

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,26 @@ django-simple-history |pypi-version|
33

44
.. Start of PyPI readme
55
6-
|jazzband| |build-status| |docs| |coverage| |maintainability| |code-style| |downloads|
6+
|build-status| |docs| |coverage| |maintainability| |code-style| |downloads|
77

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

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
17-
:target: https://github.com/jazzband/django-simple-history/actions/workflows/test.yml
12+
.. |build-status| image:: https://github.com/django-commons/django-simple-history/actions/workflows/test.yml/badge.svg
13+
:target: https://github.com/django-commons/django-simple-history/actions/workflows/test.yml
1814
:alt: Build Status
1915

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

24-
.. |coverage| image:: https://img.shields.io/codecov/c/github/jazzband/django-simple-history/master.svg
25-
:target: https://app.codecov.io/github/jazzband/django-simple-history?branch=master
20+
.. |coverage| image:: https://img.shields.io/codecov/c/github/django-commons/django-simple-history/master.svg
21+
:target: https://app.codecov.io/github/django-commons/django-simple-history?branch=master
2622
:alt: Test Coverage
2723

2824
.. |maintainability| image:: https://api.codeclimate.com/v1/badges/66cfd94e2db991f2d28a/maintainability
29-
:target: https://codeclimate.com/github/jazzband/django-simple-history/maintainability
25+
:target: https://codeclimate.com/github/django-commons/django-simple-history/maintainability
3026
:alt: Maintainability
3127

3228
.. |code-style| image:: https://img.shields.io/badge/code%20style-black-000000.svg
@@ -60,7 +56,7 @@ Documentation is available at https://django-simple-history.readthedocs.io/en/st
6056
Pull requests are welcome. Read the `CONTRIBUTING`_ file for tips on
6157
submitting a pull request.
6258

63-
.. _CONTRIBUTING: https://github.com/jazzband/django-simple-history/blob/master/CONTRIBUTING.rst
59+
.. _CONTRIBUTING: https://github.com/django-commons/django-simple-history/blob/master/CONTRIBUTING.rst
6460

6561
License
6662
-------

docs/common_issues.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ Usage with django-modeltranslation
248248
----------------------------------
249249

250250
If you have ``django-modeltranslation`` installed, you will need to use the ``register()``
251-
method to model translation, as described `here <https://github.com/jazzband/django-simple-history/issues/209#issuecomment-181676111>`__.
251+
method to model translation, as described `here <https://github.com/django-commons/django-simple-history/issues/209#issuecomment-181676111>`__.
252252

253253

254254
Pointing to the model

docs/index.rst

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
django-simple-history
22
=====================
33

4-
.. image:: https://github.com/jazzband/django-simple-history/actions/workflows/test.yml/badge.svg
5-
:target: https://github.com/jazzband/django-simple-history/actions/workflows/test.yml
4+
.. image:: https://github.com/django-commons/django-simple-history/actions/workflows/test.yml/badge.svg
5+
:target: https://github.com/django-commons/django-simple-history/actions/workflows/test.yml
66
:alt: Build Status
77

88
.. image:: https://readthedocs.org/projects/django-simple-history/badge/?version=latest
99
:target: https://django-simple-history.readthedocs.io/en/latest/?badge=latest
1010
:alt: Documentation Status
1111

12-
.. image:: https://img.shields.io/codecov/c/github/jazzband/django-simple-history/master.svg
13-
:target: https://app.codecov.io/github/jazzband/django-simple-history?branch=master
12+
.. image:: https://img.shields.io/codecov/c/github/django-commons/django-simple-history/master.svg
13+
:target: https://app.codecov.io/github/django-commons/django-simple-history?branch=master
1414
:alt: Test Coverage
1515

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

2020
.. image:: https://api.codeclimate.com/v1/badges/66cfd94e2db991f2d28a/maintainability
21-
:target: https://codeclimate.com/github/jazzband/django-simple-history/maintainability
21+
:target: https://codeclimate.com/github/django-commons/django-simple-history/maintainability
2222
:alt: Maintainability
2323

2424
.. image:: https://static.pepy.tech/badge/django-simple-history
@@ -29,10 +29,6 @@ django-simple-history
2929
:target: https://github.com/psf/black
3030
:alt: Code Style
3131

32-
.. image:: https://jazzband.co/static/img/badge.svg
33-
:target: https://jazzband.co/
34-
:alt: Jazzband
35-
3632

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

@@ -51,8 +47,8 @@ main 3.12, 3.13
5147
Contribute
5248
----------
5349

54-
- Issue Tracker: https://github.com/jazzband/django-simple-history/issues
55-
- Source Code: https://github.com/jazzband/django-simple-history
50+
- Issue Tracker: https://github.com/django-commons/django-simple-history/issues
51+
- Source Code: https://github.com/django-commons/django-simple-history
5652

5753
Pull requests are welcome.
5854

pyproject.toml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ dynamic = [
4141
dependencies = [
4242
"django>=4.2",
4343
]
44-
urls.Changelog = "https://github.com/jazzband/django-simple-history/blob/master/CHANGES.rst"
44+
urls.Changelog = "https://github.com/django-commons/django-simple-history/blob/master/CHANGES.rst"
4545
urls.Documentation = "https://django-simple-history.readthedocs.io/en/stable/"
46-
urls.Homepage = "https://github.com/jazzband/django-simple-history"
47-
urls.Source = "https://github.com/jazzband/django-simple-history"
48-
urls.Tracker = "https://github.com/jazzband/django-simple-history/issues"
46+
urls.Homepage = "https://github.com/django-commons/django-simple-history"
47+
urls.Source = "https://github.com/django-commons/django-simple-history"
48+
urls.Tracker = "https://github.com/django-commons/django-simple-history/issues"
4949

5050
[tool.hatch.version]
5151
source = "vcs"
@@ -56,9 +56,6 @@ version_scheme = "no-guess-dev"
5656
local_scheme = "node-and-date"
5757

5858
[tool.hatch.build.targets.wheel]
59-
# Jazzband's release process is limited to 2.2 metadata
60-
# - see https://github.com/jazzband/help/issues/360
61-
core-metadata-version = "2.2"
6259
packages = [
6360
"simple_history",
6461
]
@@ -67,11 +64,6 @@ exclude = [
6764
"simple_history/tests",
6865
]
6966

70-
[tool.hatch.build.targets.sdist]
71-
# Jazzband's release process is limited to 2.2 metadata
72-
# - see https://github.com/jazzband/help/issues/360
73-
core-metadata-version = "2.2"
74-
7567
[tool.hatch.metadata.hooks.fancy-pypi-readme]
7668
content-type = "text/x-rst"
7769
# (Preview the generated readme by installing `hatch` and running

simple_history/manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ class HistoricalQuerySet(QuerySet):
1818
Enables additional functionality when working with historical records.
1919
2020
For additional history on this topic, see:
21-
- https://github.com/jazzband/django-simple-history/pull/229
22-
- https://github.com/jazzband/django-simple-history/issues/354
23-
- https://github.com/jazzband/django-simple-history/issues/397
21+
- https://github.com/django-commons/django-simple-history/pull/229
22+
- https://github.com/django-commons/django-simple-history/issues/354
23+
- https://github.com/django-commons/django-simple-history/issues/397
2424
"""
2525

2626
def __init__(self, *args, **kwargs):

simple_history/registry_tests/tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,15 @@ def test_registering_with_tracked_abstract_base(self):
199199

200200

201201
class TestCustomAttrForeignKey(TestCase):
202-
"""https://github.com/jazzband/django-simple-history/issues/431"""
202+
"""https://github.com/django-commons/django-simple-history/issues/431"""
203203

204204
def test_custom_attr(self):
205205
field = ModelWithCustomAttrForeignKey.history.model._meta.get_field("poll")
206206
self.assertEqual(field.attr_name, "custom_poll")
207207

208208

209209
class TestCustomAttrOneToOneField(TestCase):
210-
"""https://github.com/jazzband/django-simple-history/issues/870"""
210+
"""https://github.com/django-commons/django-simple-history/issues/870"""
211211

212212
def test_custom_attr(self):
213213
field = ModelWithCustomAttrOneToOneField.history.model._meta.get_field("poll")
@@ -228,7 +228,7 @@ def test_migrate_command(self):
228228

229229

230230
class TestModelWithHistoryInDifferentApp(TestCase):
231-
"""https://github.com/jazzband/django-simple-history/issues/485"""
231+
"""https://github.com/django-commons/django-simple-history/issues/485"""
232232

233233
def test__different_app(self):
234234
appLabel = ModelWithHistoryInDifferentApp.history.model._meta.app_label

simple_history/tests/tests/test_middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def test_bucket_member_is_set_on_create_view_when_logged_in(self):
154154
@override_settings(DEBUG_PROPAGATE_EXCEPTIONS=True)
155155
@mock.patch("simple_history.tests.view.MockableView.get")
156156
def test_request_attr_is_deleted_after_each_response(self, func_mock):
157-
"""https://github.com/jazzband/django-simple-history/issues/1189"""
157+
"""https://github.com/django-commons/django-simple-history/issues/1189"""
158158

159159
def assert_has_request_attr(has_attr: bool):
160160
self.assertEqual(hasattr(HistoricalRecords.context, "request"), has_attr)

0 commit comments

Comments
 (0)