new: port the python template bodies to manifests
CI / build (push) Failing after 2m55s
CI / test (push) Skipped
CI / snap (push) Skipped

This commit is contained in:
2026-09-18 15:20:22 +02:00
parent fa399f64b2
commit 0235ec6457
5 changed files with 80 additions and 62 deletions
+5
View File
@@ -0,0 +1,5 @@
"""Placeholder for {name}, generated by `pkh new`."""
def main() -> None:
print("Hello from {command}!")
+15 -7
View File
@@ -1,9 +1,13 @@
## The `python` template: a PEP 517 project built with pybuild. The logic
## half — the pyproject.toml/setup.py probe, the skeleton bodies and the
## Build-Depends/architecture resolution for existing projects (backend
## package, pyproject presence, C-extension hints) — lives in
## src/new/templates/python.rs; the lists below are the fresh-skeleton
## baseline it starts from.
## The `python` template: a PEP 517 project built with pybuild. The
## skeleton bodies below are static data on the fresh-skeleton baseline
## (the setuptools backend): the module directory and the console-script
## entry point are named by the `{module_name}` placeholder python.rs
## derives from the package name — dpkg names may carry `+`/`.` and may
## start with a digit, none of which a Python module name may. The logic
## half — the pyproject.toml/setup.py probe and the Build-Depends /
## architecture resolution for existing projects (backend package,
## pyproject presence, C-extension hints) — lives in
## src/new/templates/python.rs.
##
## Schema: see src/new/templates/mod.rs.
@@ -18,4 +22,8 @@ build_depends:
- python3-setuptools
architecture: all
rules_dh_line: "dh $@ --with python3 --buildsystem=pybuild"
files: []
files:
- path: pyproject.toml
template: pyproject.toml.tpl
- path: "{module_name}/__init__.py"
template: __init__.py.tpl
+12
View File
@@ -0,0 +1,12 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "{name}"
version = "{upstream_version}"
description = "{summary}"
requires-python = ">=3.8"
[project.scripts]
{command} = "{module_name}:main"