Simple packaging fix

--=-6tQG7FEKAZyWWN9kR8o8
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Ploum,

I'm the author of the "d=C3=A9p=C3=AAche" you commented on here:

https://linuxfr.org/news/l-installation-et-la-distribution-de-paquets-pytho=
n-1-4#comment-1940663

I skimmed at your problem. I admit I have not read all packaging-related
threads on this mailing list. If I understand correctly, you want
to keep using the (relatively non-standard) current setup of
Offpunk, namely a bunch of scripts at the root of the source tree.

You can't do that with Flit, because it's an opinionated tool
which insists that you do it the more standard way. So here's
a simple patch that does it with hatchling instead.

You might also want to review the dependency list in pyproject.toml.
I see "timg>=3D1.3.2", but the latest version of timg on PyPI
is 1.1.6.

Best,
Jean

From 90b3b2ab3700c57f76d3ae5760a4f49048bca70d Mon Sep 17 00:00:00 2001
From: Jean Abou Samra <jean@abou-samra.fr>
Date: Tue, 7 Nov 2023 23:16:43 +0100
Subject: [PATCH] Basic fix for packaging

Flit is not suitable for this project because it insists on packaging a
single package, while Ploum insists on keeping top-level scripts that
aren't inside a package. Use hatchling instead.

To test:

$ python -m venv temp-test-venv # may require "apt install python3-venv" or such
$ source temp-test-venv/bin/activate
$ pip install .[http]
$ offpunk
$ deactivate

To check the build artifacts:

$ python -m build # may require "apt install python3-build" or such
$ cd dist
$ tar -xvf offpunk-2.0b1.tar.gz # check files, this should contain everything
$ unzip offpunk-2.0b1-py3-none-any.whl # check files, this should contain only Python modules (plus a dist-info directory)
This commit is contained in:
Jean Abou Samra 2023-11-07 23:46:00 +01:00 committed by Ploum
parent 51dc856161
commit e1e25b9456
1 changed files with 11 additions and 4 deletions

View File

@ -1,6 +1,6 @@
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "offpunk"
@ -49,5 +49,12 @@ netcache = "netcache:main"
ansicat = "ansicat:main"
opnk = "opnk:main"
[tool.flit.sdist]
include = ["doc/", "man/", "CHANGELOG"]
[tool.hatch.version]
path = "offpunk.py" # read __version__
[tool.hatch.build.targets.wheel]
only-include = [
"ansicat.py", "cache_migration.py", "netcache.py",
"offblocklist.py", "offpunk.py", "offthemes.py",
"offutils.py", "opnk.py",
]