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

Update package metadata #1690

Merged
merged 3 commits into from
Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# TODO: move this to pyproject.toml when supported, see https://github.com/PyCQA/flake8/issues/234

[flake8]
extend-ignore = E203, E501
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,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 hatchling
- name: Build package
run: |
python setup.py --version
python setup.py sdist --format=gztar bdist_wheel
hatchling version
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 }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
${{ matrix.python-version }}-v1-${{ hashFiles('**/pyproject.toml') }}-${{ hashFiles('**/tox.ini') }}
restore-keys: |
${{ matrix.python-version }}-v1-
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
${{ matrix.python-version }}-v1-${{ hashFiles('**/pyproject.toml') }}-${{ hashFiles('**/tox.ini') }}
restore-keys: |
${{ matrix.python-version }}-v1-
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
${{ matrix.python-version }}-v1-${{ hashFiles('**/pyproject.toml') }}-${{ hashFiles('**/tox.ini') }}
restore-keys: |
${{ matrix.python-version }}-v1-
Expand Down Expand Up @@ -203,7 +203,7 @@ jobs:
# Use latest, so it understands all syntax.
python-version: "3.10"

- run: python -m pip install --upgrade coverage
- run: python -m pip install --upgrade coverage[toml]

- name: Download coverage data.
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -246,7 +246,7 @@ jobs:
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
${{ matrix.python-version }}-v1-${{ hashFiles('**/pyproject.toml') }}-${{ hashFiles('**/tox.ini') }}
restore-keys: |
${{ matrix.python-version }}-v1-
Expand Down
6 changes: 0 additions & 6 deletions MANIFEST.in

This file was deleted.

8 changes: 4 additions & 4 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ The release itself requires the following steps:

#. Update supported Python and Django versions:

- ``setup.cfg`` ``python_requires`` and ``install_requires`` options
- ``setup.cfg`` trove classifiers
- ``pyproject.toml`` options ``requires-python``, ``dependencies``,
and ``classifiers``
- ``README.rst``

Commit.
Expand All @@ -167,12 +167,12 @@ The release itself requires the following steps:
Commit.

#. Bump version numbers in ``docs/changes.rst``, ``docs/conf.py``,
``README.rst``, ``debug_toolbar/__init__.py`` and ``setup.cfg``.
``README.rst``, and ``debug_toolbar/__init__.py``.
Add the release date to ``docs/changes.rst``. Commit.

#. Tag the new version.

#. ``python setup.py sdist bdist_wheel upload``.
#. ``tox packaging``.
tim-schilling marked this conversation as resolved.
Show resolved Hide resolved

#. Push the commit and the tag.

Expand Down
74 changes: 74 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "django-debug-toolbar"
dynamic = ["version"]
description = "A configurable set of panels that display various debug information about the current request/response."
readme = "README.rst"
license = "BSD-3-Clause"
requires-python = ">=3.7"
authors = [
{ name = "Rob Hudson", email = "[email protected]" },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"Django >= 3.2.4",
"sqlparse >= 0.2.0",
]

[project.urls]
Download = "https://pypi.org/project/django-debug-toolbar/"
Homepage = "https://github.com/jazzband/django-debug-toolbar"

[tool.hatch.version]
path = "debug_toolbar/__init__.py"

[tool.hatch.build.targets.wheel]
packages = ["debug_toolbar"]

[tool.hatch.build.targets.sdist]
include = [
"/debug_toolbar",
"/CONTRIBUTING.md",
]

[tool.isort]
combine_as_imports = true
profile = "black"

[tool.coverage.run]
branch = true
parallel = true
source = ["debug_toolbar"]

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

[tool.coverage.report]
# Update coverage badge link in README.rst when fail_under changes
fail_under = 93
show_missing = true

[tool.coverage.html]
skip_covered = true
skip_empty = true
3 changes: 1 addition & 2 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Jinja2

# Testing

coverage
coverage[toml]
flake8
html5lib
isort
Expand All @@ -23,4 +23,3 @@ sphinxcontrib-spelling

pre-commit
transifex-client
wheel
72 changes: 0 additions & 72 deletions setup.cfg

This file was deleted.

20 changes: 19 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
#!/usr/bin/env python3

import sys

from setuptools import setup

setup()
sys.stderr.write(
"""\
===============================
Unsupported installation method
===============================
This project no longer supports installation with `python setup.py install`.
Please use `python -m pip install .` instead.
"""
)
sys.exit(1)

# The code below will never execute, however is required to
# display the "Used by" section on the GitHub repository.
#
# See: https://github.com/github/feedback/discussions/6456

setup(name="django-debug-toolbar")
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[tox]
isolated_build = true
envlist =
docs
packaging
Expand All @@ -14,7 +15,7 @@ deps =
postgis: psycopg2-binary
mysql: mysqlclient
djmain: https://github.com/django/django/archive/main.tar.gz
coverage
coverage[toml]
Jinja2
html5lib
pygments
Expand Down Expand Up @@ -76,12 +77,11 @@ deps =

[testenv:packaging]
commands =
python setup.py sdist bdist_wheel
python -m build
twine check --strict dist/*
deps =
readme_renderer
build
twine
wheel
skip_install = true

[gh-actions]
Expand Down