Skip to content

Commit 6a60a24

Browse files
timobrembeckclaudep
authored andcommitted
Migrate from setup.py to pyproject.toml
1 parent fce77ee commit 6a60a24

File tree

6 files changed

+97
-57
lines changed

6 files changed

+97
-57
lines changed

AUTHORS

Lines changed: 0 additions & 6 deletions
This file was deleted.

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
include AUTHORS
21
include LICENSE
32
include CHANGELOG
43
include README.rst

README.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,3 +281,14 @@ If you want to contribute translations for ``LOCALE``, run:
281281
django-admin makemessages --locale LOCALE
282282
283283
and edit the corresponding file in ``linkcheck/locale/LOCALE/LC_MESSAGES/django.po``.
284+
285+
Create new release
286+
~~~~~~~~~~~~~~~~~~
287+
288+
1. Bump version in `pyproject.toml <./pyproject.toml>`_
289+
2. Update `CHANGELOG <./CHANGELOG>`_
290+
3. Create release commit: ``git commit --message "Release vX.Y.Z"``
291+
4. Create git tag: ``git tag -a "X.Y.Z" -m "Release vX.Y.Z"``
292+
5. Push the commit and tag to the repository: ``git push && git push --tags``
293+
6. Build the source distribution: ``python -m build``
294+
7. Publish the package to PyPI: ``twine upload dist/django-linkcheck-X.Y.Z*``

linkcheck/build_meta.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import subprocess
2+
3+
from setuptools import build_meta as default
4+
from setuptools.build_meta import * # noqa: F401, F403
5+
6+
7+
def compile_translation_files():
8+
print("Compile translation files")
9+
subprocess.run(["django-admin", "compilemessages"], cwd="linkcheck")
10+
11+
12+
def build_sdist(sdist_directory, config_settings=None):
13+
compile_translation_files()
14+
return default.build_sdist(sdist_directory, config_settings)
15+
16+
17+
def build_wheel(wheel_directory, config_settings=None, metadata_directory=None):
18+
compile_translation_files()
19+
return default.build_wheel(
20+
wheel_directory,
21+
config_settings=config_settings,
22+
metadata_directory=metadata_directory,
23+
)

pyproject.toml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
[build-system]
2+
requires = ["setuptools>=61.2"]
3+
build-backend = "build_meta"
4+
backend-path = ["linkcheck"]
5+
6+
[project]
7+
name = "django-linkcheck"
8+
version = "2.2.1"
9+
authors = [
10+
{name = "Andy Baker", email = "andy@andybak.net"},
11+
{name = "Fruits Chen", email = "fruitschen@gmail.com"},
12+
{name = "Tim Graves", email = "gravesit@gmail.com"},
13+
{name = "Jannis Leidel", email = "jannis@leidel.info"},
14+
{name = "Claude Paroz", email = "claude@2xlibre.net"},
15+
{name = "Timo Brembeck", email = "opensource@timo.brembeck.email"}
16+
]
17+
description = "A Django app that will analyze and report on links in any model that you register with it."
18+
readme = "README.rst"
19+
classifiers = [
20+
"Development Status :: 5 - Production/Stable",
21+
"Environment :: Web Environment",
22+
"Intended Audience :: Developers",
23+
"License :: OSI Approved :: BSD License",
24+
"Operating System :: OS Independent",
25+
"Programming Language :: Python",
26+
"Programming Language :: Python :: 3",
27+
"Programming Language :: Python :: 3 :: Only",
28+
"Programming Language :: Python :: 3.8",
29+
"Programming Language :: Python :: 3.9",
30+
"Programming Language :: Python :: 3.10",
31+
"Programming Language :: Python :: 3.11",
32+
"Programming Language :: Python :: 3.12",
33+
"Framework :: Django",
34+
"Framework :: Django :: 3.2",
35+
"Framework :: Django :: 4.1",
36+
"Framework :: Django :: 4.2",
37+
]
38+
license = {text = "BSD-3-Clause"}
39+
requires-python = ">=3.8"
40+
dependencies = [
41+
"django>=3.2",
42+
"requests",
43+
]
44+
45+
[project.urls]
46+
Homepage = "https://github.com/DjangoAdminHackers/django-linkcheck"
47+
Issues = "https://github.com/DjangoAdminHackers/django-linkcheck/issues"
48+
Changelog = "https://github.com/DjangoAdminHackers/django-linkcheck/blob/master/CHANGELOG"
49+
50+
[project.optional-dependencies]
51+
dev = [
52+
"build",
53+
"flake8",
54+
"isort",
55+
"pre-commit",
56+
]
57+
58+
[tool.setuptools]
59+
include-package-data = true
60+
license-files = ["LICENSE"]
61+
62+
[tool.setuptools.packages.find]
63+
include = ["linkcheck*"]

setup.py

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)