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

Migrate from setup.py to pyproject.toml #197

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 0 additions & 6 deletions AUTHORS

This file was deleted.

1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include AUTHORS
include LICENSE
include CHANGELOG
include README.rst
Expand Down
11 changes: 11 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -281,3 +281,14 @@ If you want to contribute translations for ``LOCALE``, run:
django-admin makemessages --locale LOCALE

and edit the corresponding file in ``linkcheck/locale/LOCALE/LC_MESSAGES/django.po``.

Create new release
~~~~~~~~~~~~~~~~~~

1. Bump version in `pyproject.toml <./pyproject.toml>`_
2. Update `CHANGELOG <./CHANGELOG>`_
3. Create release commit: ``git commit --message "Release vX.Y.Z"``
4. Create git tag: ``git tag -a "X.Y.Z" -m "Release vX.Y.Z"``
5. Push the commit and tag to the repository: ``git push && git push --tags``
6. Build the source distribution: ``python -m build``
7. Publish the package to PyPI: ``twine upload dist/django-linkcheck-X.Y.Z*``
23 changes: 23 additions & 0 deletions linkcheck/build_meta.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import subprocess

from setuptools import build_meta as default
from setuptools.build_meta import * # noqa: F401, F403


def compile_translation_files():
print("Compile translation files")
subprocess.run(["django-admin", "compilemessages"], cwd="linkcheck")


def build_sdist(sdist_directory, config_settings=None):
compile_translation_files()
return default.build_sdist(sdist_directory, config_settings)


def build_wheel(wheel_directory, config_settings=None, metadata_directory=None):
compile_translation_files()
return default.build_wheel(
wheel_directory,
config_settings=config_settings,
metadata_directory=metadata_directory,
)
63 changes: 63 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[build-system]
requires = ["setuptools>=61.2"]
build-backend = "build_meta"
backend-path = ["linkcheck"]

[project]
name = "django-linkcheck"
version = "2.2.1"
authors = [
{name = "Andy Baker", email = "[email protected]"},
{name = "Fruits Chen", email = "[email protected]"},
{name = "Tim Graves", email = "[email protected]"},
{name = "Jannis Leidel", email = "[email protected]"},
{name = "Claude Paroz", email = "[email protected]"},
{name = "Timo Brembeck", email = "[email protected]"}
]
description = "A Django app that will analyze and report on links in any model that you register with it."
readme = "README.rst"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"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.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
]
license = {text = "BSD-3-Clause"}
requires-python = ">=3.8"
dependencies = [
"django>=3.2",
"requests",
]

[project.urls]
Homepage = "https://github.com/DjangoAdminHackers/django-linkcheck"
Issues = "https://github.com/DjangoAdminHackers/django-linkcheck/issues"
Changelog = "https://github.com/DjangoAdminHackers/django-linkcheck/blob/master/CHANGELOG"

[project.optional-dependencies]
dev = [
"build",
"flake8",
"isort",
"pre-commit",
]

[tool.setuptools]
include-package-data = true
license-files = ["LICENSE"]

[tool.setuptools.packages.find]
include = ["linkcheck*"]
50 changes: 0 additions & 50 deletions setup.py

This file was deleted.

Loading