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

Switch repo to Django Commons #1429

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 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
128 changes: 105 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,122 @@
---
name: Release

on:
push:
tags:
- '*'
on: push

env:
# Change these for your project's URLs
PYPI_URL: https://pypi.org/p/django-simple-history
PYPI_TEST_URL: https://test.pypi.org/p/django-simple-history

jobs:

build:
if: github.repository == 'jazzband/django-simple-history'
name: Build distribution 📦
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
python-version: "3.x"
- name: Install pypa/build
run:
python3 -m pip install build --user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: ${{ env.PYPI_URL }}
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1.10

github-release:
name: >-
Sign the Python 🐍 distribution 📦 with Sigstore
and upload them to GitHub Release
needs:
- publish-to-pypi
runs-on: ubuntu-latest

permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'

publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to TestPyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U build twine
environment:
name: testpypi
url: ${{ env.PYPI_TEST_URL }}

- name: Build package
run: |
python -m build
twine check dist/*
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

- name: Upload packages to Jazzband
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1.10
with:
user: jazzband
password: ${{ secrets.JAZZBAND_RELEASE_KEY }}
repository-url: https://jazzband.co/projects/django-simple-history/upload
repository-url: https://test.pypi.org/legacy/
skip-existing: true
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Unreleased
- Added pagination to ``SimpleHistoryAdmin`` (gh-1277)
- Fixed issue with history button not working when viewing historical entries in the
admin (gh-527)
- Move repository to the Django Commons organization (gh-1391)

3.7.0 (2024-05-29)
------------------
Expand Down
45 changes: 1 addition & 44 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,3 @@
# Code of Conduct

As contributors and maintainers of the Jazzband projects, and in the interest of
fostering an open and welcoming community, we pledge to respect all people who
contribute through reporting issues, posting feature requests, updating documentation,
submitting pull requests or patches, and other activities.

We are committed to making participation in the Jazzband a harassment-free experience
for everyone, regardless of the level of experience, gender, gender identity and
expression, sexual orientation, disability, personal appearance, body size, race,
ethnicity, age, religion, or nationality.

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery
- Personal attacks
- Trolling or insulting/derogatory comments
- Public or private harassment
- Publishing other's private information, such as physical or electronic addresses,
without explicit permission
- Other unethical or unprofessional conduct

The Jazzband roadies have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are not
aligned to this Code of Conduct, or to ban temporarily or permanently any contributor
for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

By adopting this Code of Conduct, the roadies commit themselves to fairly and
consistently applying these principles to every aspect of managing the jazzband
projects. Roadies who do not follow or enforce the Code of Conduct may be permanently
removed from the Jazzband roadies.

This code of conduct applies both within project spaces and in public spaces when an
individual is representing the project or its community.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by
contacting the roadies at `[email protected]`. All complaints will be reviewed and
investigated and will result in a response that is deemed necessary and appropriate to
the circumstances. Roadies are obligated to maintain confidentiality with regard to the
reporter of an incident.

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version
1.3.0, available at [https://contributor-covenant.org/version/1/3/0/][version]

[homepage]: https://contributor-covenant.org
[version]: https://contributor-covenant.org/version/1/3/0/
The best-practices project utilizes the [Django Commons Code of Conduct](https://github.com/django-commons/membership/blob/main/CODE_OF_CONDUCT.md).
tim-schilling marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 1 addition & 5 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
Contributing to django-simple-history
=====================================

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

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>`_.
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>`_.

Pull Requests
-------------
Expand Down
18 changes: 7 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,26 @@ django-simple-history |pypi-version|

.. Start of PyPI readme

|jazzband| |build-status| |docs| |coverage| |maintainability| |code-style| |downloads|
|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
.. |build-status| image:: https://github.com/django-commons/django-simple-history/actions/workflows/test.yml/badge.svg
:target: https://github.com/django-commons/django-simple-history/actions/workflows/test.yml
:alt: Build Status

.. |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

.. |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
.. |coverage| image:: https://img.shields.io/codecov/c/github/django-commons/django-simple-history/master.svg
:target: https://app.codecov.io/github/django-commons/django-simple-history?branch=master
:alt: Test Coverage

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

.. |code-style| image:: https://img.shields.io/badge/code%20style-black-000000.svg
Expand Down Expand Up @@ -59,7 +55,7 @@ Documentation is available at https://django-simple-history.readthedocs.io/en/st
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
.. _CONTRIBUTING: https://github.com/django-commons/django-simple-history/blob/master/CONTRIBUTING.rst

License
-------
Expand Down
2 changes: 1 addition & 1 deletion docs/common_issues.rst
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ Usage with django-modeltranslation
----------------------------------

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


Pointing to the model
Expand Down
18 changes: 7 additions & 11 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
django-simple-history
=====================

.. 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
.. image:: https://github.com/django-commons/django-simple-history/actions/workflows/test.yml/badge.svg
:target: https://github.com/django-commons/django-simple-history/actions/workflows/test.yml
:alt: Build Status

.. 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
:target: https://app.codecov.io/github/jazzband/django-simple-history?branch=master
.. image:: https://img.shields.io/codecov/c/github/django-commons/django-simple-history/master.svg
:target: https://app.codecov.io/github/django-commons/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
:target: https://codeclimate.com/github/jazzband/django-simple-history/maintainability
:target: https://codeclimate.com/github/django-commons/django-simple-history/maintainability
:alt: Maintainability

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

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


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

Expand All @@ -50,8 +46,8 @@ main 3.10, 3.11, 3.12, 3.13
Contribute
----------

- Issue Tracker: https://github.com/jazzband/django-simple-history/issues
- Source Code: https://github.com/jazzband/django-simple-history
- Issue Tracker: https://github.com/django-commons/django-simple-history/issues
- Source Code: https://github.com/django-commons/django-simple-history

Pull requests are welcome.

Expand Down
16 changes: 4 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ dynamic = [
dependencies = [
"django>=4.2",
]
urls.Changelog = "https://github.com/jazzband/django-simple-history/blob/master/CHANGES.rst"
urls.Changelog = "https://github.com/django-commons/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"
urls.Homepage = "https://github.com/django-commons/django-simple-history"
urls.Source = "https://github.com/django-commons/django-simple-history"
urls.Tracker = "https://github.com/django-commons/django-simple-history/issues"

[tool.hatch.version]
source = "vcs"
Expand All @@ -54,18 +54,10 @@ 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"
# (Preview the generated readme by installing `hatch` and running
Expand Down
6 changes: 3 additions & 3 deletions simple_history/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ class HistoricalQuerySet(QuerySet):
Enables additional functionality when working with historical records.

For additional history on this topic, see:
- https://github.com/jazzband/django-simple-history/pull/229
- https://github.com/jazzband/django-simple-history/issues/354
- https://github.com/jazzband/django-simple-history/issues/397
- https://github.com/django-commons/django-simple-history/pull/229
- https://github.com/django-commons/django-simple-history/issues/354
- https://github.com/django-commons/django-simple-history/issues/397
"""

def __init__(self, *args, **kwargs):
Expand Down
6 changes: 3 additions & 3 deletions simple_history/registry_tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,15 @@ def test_registering_with_tracked_abstract_base(self):


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

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


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

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


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

def test__different_app(self):
appLabel = ModelWithHistoryInDifferentApp.history.model._meta.app_label
Expand Down
Loading
Loading