# HG changeset patch # User Conrad Hoffmann # Date 1730118085 -3600 # Mon Oct 28 13:21:25 2024 +0100 # Node ID e05f4ba81dcaad9cc7988f350b12f45ddaa407c9 # Parent d53d0501deac0b70fdec4f61cc1b84aed876b8ef Preparations for PEP440 support Currrently, builds for patches are broken because the version numbers generated for them are not valid according to PEP 440 [1]. This has to be solved in several steps, in coordination with the packaging code. Procedure will be the same as for core.sr.ht: https://git.sr.ht/~sircmpwn/core.sr.ht/commit/57ee3427 The only difference is that the extra build step (running `make`) will remain in `setup.py` (as there is no generic mechanism for this in `pyproject.toml`). This just means the build process will still always have to be performed with setuptools as backend. [1] https://peps.python.org/pep-0440 Unlike all other sr.ht modules, this one lives in a Mercurial repo. Hence, this patch does not include the .git_archival.txt and .gitattributes files. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,60 @@ +[build-system] +requires = ["setuptools", "setuptools_scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "hgsrht" +dynamic = ["version"] +description = "hg.sr.ht website" +readme = "README.md" +authors = [{name = "Ludovic Chabant", email = "ludovic@chabant.com"}] +dependencies = [ + "srht", + "scmsrht", + "python-hglib", + "unidiff", +] +license.text = "AGPL-3.0-only" + +[project.urls] +repository = "https://hg.sr.ht/~sircmpwn/hg.sr.ht" + +[tool.setuptools] +# This defaults to true, but we explicitly specify what we want included in the +# package via packages and tool.setuptools.package-data below. +include-package-data = false +packages = [ + "hgsrht", + "hgsrht.alembic", + "hgsrht.alembic.versions", + "hgsrht.blueprints", + "hgsrht.blueprints.api", + "hgsrht.hgext", + "hgsrht.hgrcs", + "hgsrht.static", + "hgsrht.static.icons", + "hgsrht.templates", + "hgsrht.templates.macros", + "hgsrht.templates.partials", + "hgsrht.types", +] +script-files = [ + "hgsrht-clonebundles", + "hgsrht-hook-changegroup", + "hgsrht-initdb", + "hgsrht-install-ext", + "hgsrht-migrate", + "hgsrht-periodic", + "hgsrht-shell", + "hgsrht-upgraderepos" +] +[tool.setuptools.package-data] +"hgsrht" = ['default_query.graphql', 'schema.graphqls'] +"hgsrht.hgrcs" = ['*'] +"hgsrht.templates" = ['*.html'] +"hgsrht.templates.macros" = ['*.html'] +"hgsrht.templates.partials" = ['*.html'] +"hgsrht.static" = ['*'] +"hgsrht.static.icons" = ['*'] + +[tool.setuptools_scm]