From 4dad929ba8bf44df087f63619509e29c688de949 Mon Sep 17 00:00:00 2001 From: Claudia Date: Sun, 25 Feb 2024 12:24:33 +0100 Subject: [PATCH] Work around missing Poetry package on Bullseye MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bullseye (and by extension, Byzantium) doesn’t carry the `python3-poetry-core` package. Migrate the build process to Flit v3.0.0, which is supported natively in Bullseye’s version of pybuild. Additional workarounds required for Flit v3.0.0: - Use old-style metadata (`tool.flit.metadata` section in `pyproject.toml`) - Restructure the `tool.poe.tasks` section in `pyproject.toml`, because Flit would error out when using nested keys outside of section headings, e.g. `tasks.cmd = "poe -v"`. --- debian/changelog | 6 ++ debian/control | 2 +- debian/patches/replace-poetry.patch | 148 ++++++++++++++++++++++++++++ debian/patches/series | 1 + debian/rules | 2 - 5 files changed, 156 insertions(+), 3 deletions(-) create mode 100644 debian/patches/replace-poetry.patch create mode 100644 debian/patches/series diff --git a/debian/changelog b/debian/changelog index cf3ced7..fdf52ef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +itchcraft (0.1.0~bpo11+1) UNRELEASED; urgency=medium + + * Work around missing Poetry package on Bullseye + + -- Claudia Pellegrino Thu, 18 Jul 2024 19:55:40 +0200 + itchcraft (0.1.0) UNRELEASED; urgency=medium * Initial release diff --git a/debian/control b/debian/control index 4fce8d4..c9a7a79 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: itchcraft Section: python Priority: optional Maintainer: Claudia Pellegrino -Build-Depends: debhelper-compat (= 13), dh-python, pybuild-plugin-pyproject, python3-all, python3-myst-parser, python3-poetry-core, python3-sphinx +Build-Depends: debhelper-compat (= 13), dh-python, flit, python3-all, python3-myst-parser, python3-sphinx Standards-Version: 4.5.1 Homepage: https://github.com/claui/itchcraft Vcs-Browser: https://github.com/claui/itchcraft diff --git a/debian/patches/replace-poetry.patch b/debian/patches/replace-poetry.patch new file mode 100644 index 0000000..c9266d9 --- /dev/null +++ b/debian/patches/replace-poetry.patch @@ -0,0 +1,148 @@ +From 44f3e1d60c27c2a7861c3950d961e8476de6f8ee Mon Sep 17 00:00:00 2001 +From: Claudia +Date: Sun, 25 Feb 2024 12:24:33 +0100 +Subject: [PATCH] Work around missing Poetry package on Bullseye +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Bullseye (and by extension, Byzantium) doesn’t carry the +`python3-poetry-core` package. + +Migrate the build process to Flit v3.0.0, which is supported natively +in Bullseye’s version of pybuild. + +Additional workarounds required for Flit v3.0.0: + +- Use old-style metadata (`tool.flit.metadata` section in + `pyproject.toml`) + +- Restructure the `tool.poe.tasks` section in `pyproject.toml`, because + Flit would error out when using nested keys outside of section + headings, e.g. `tasks.cmd = "poe -v"`. +--- +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -1,6 +1,48 @@ ++# Use Flit instead of Poetry as long as we need to support Debian 11, ++# which doesn’t provide Poetry. ++# ++# On top of that, Debian 11 only ships flit v3.0.0, which means we have ++# to use old-style metadata, too (`tool.flit.metadata` instead of ++# `project`, and `flit_core >=2` instead of `flit_core >=3.2`.) ++ + [build-system] +-requires = ["poetry-core>=1.9.0"] +-build-backend = "poetry.core.masonry.api" ++requires = ["flit_core >=2,<4"] ++build-backend = "flit_core.buildapi" ++ ++[tool.flit.metadata] ++module = "itchcraft" ++author = "Claudia Pellegrino" ++author-email = "clau@tiqua.de" ++description-file = "README.md" ++requires-python = ">=3.9" ++requires = [ ++ "colorama >=0.4.4", ++ "fire >=0.4.0", ++ "pyusb >= 1.0.0", ++ "tenacity >= 6.0.0" ++] ++classifiers = [ ++ "Development Status :: 3 - Alpha", ++ "License :: OSI Approved :: Apache Software License", ++ "Operating System :: POSIX :: Linux", ++ "Topic :: Utilities", ++] ++ ++[tool.flit.metadata.requires-extra] ++dev = [ ++ "autopep8 >=2.0.0", ++ "mypy >=1.8", ++ "myst-parser >=2.0.0", ++ "pdoc >=14.0", ++ "poethepoet >=0.24", ++ "pylint >=3.0", ++ "pytest >=6.0.2", ++ "sphinx >=7.1.2, <7.2.0", ++ "types-colorama >=0.4.4" ++] ++ ++[tool.flit.scripts] ++itchcraft = "itchcraft.cli:run" + + [tool.mypy] + check_untyped_defs = true +@@ -18,71 +60,6 @@ warn_redundant_casts = true + warn_return_any = true + warn_unused_ignores = true + +-[tool.poetry] +-name = "itchcraft" +-version = "0.1.0" +-description = "Alternative frontend for heat-based USB insect bite healers" +-readme = [ +- "README.md", +- "USAGE.md", +-] +-authors = [ +- "Claudia Pellegrino ", +-] +-license = "Apache-2.0" +-# See https://pypi.org/pypi?%3Aaction=list_classifiers +-classifiers = [ +- "Development Status :: 3 - Alpha", +- "Operating System :: MacOS", +- "Operating System :: POSIX :: Linux", +- "Topic :: Utilities", +-] +- +-[tool.poetry.dependencies] +-python = ">=3.9" +-colorama = "*" +-dataclass-wizard = ">=0.22" +-fire = "*" +-pyusb = "^1.2.1" +-tenacity = "^8.5.0" +- +-[tool.poetry.group.dev.dependencies] +-autopep8 = "*" +-mypy = ">=1.8" +-myst-parser = ">=2.0.0" +-pdoc = ">=14.0" +-poethepoet = ">=0.24" +-pylint = ">=3.0" +-pytest = "*" +-sphinx = ">=7.1.2,<7.2.0" +-types-colorama = "*" +- +-[tool.poetry.scripts] +-itchcraft = "itchcraft.cli:run" +- +-[tool.poe] +-verbosity = -1 +- +-[tool.poe.tasks] +-tasks.cmd = "poe -v" +-tasks.help = "List available tasks" +-cli.script = "itchcraft.cli:run" +-cli.help = "Run command line interface" +-doc.cmd = "sphinx-build -aqEW -b man doc/sphinx build/man" +-doc.help = "Generate documentation" +-hello.script = "itchcraft.cli:run('hello')" +-hello.help = "Run hello" +-html.cmd = "pdoc itchcraft !itchcraft.settings" +-html.help = "Browse HTML documentation" +-linter.cmd = "pylint --enable-all-extensions itchcraft" +-linter.help = "Check for style violations" +-man.cmd = "man build/man/itchcraft.1" +-man.help = "Open manual page" +-tests.cmd = "pytest" +-tests.help = "Run test suite" +-typecheck.cmd = "mypy" +-typecheck.help = "Run static type checker" +- + [tool.pyright] + reportUnsupportedDunderAll = "none" + diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..abd446e --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +replace-poetry.patch diff --git a/debian/rules b/debian/rules index 47db900..64246fc 100755 --- a/debian/rules +++ b/debian/rules @@ -8,8 +8,6 @@ export PYBUILD_NAME=itchcraft %: dh $@ --with python3 --buildsystem=pybuild -override_dh_auto_build: export http_proxy=127.0.0.1:9 -override_dh_auto_build: export https_proxy=127.0.0.1:9 override_dh_auto_build: dh_auto_build PYTHONPATH=. python3 -m sphinx -NW -b man doc/sphinx build/man