Make hatchling write us a _version.py when running the tests

Co-authored-by: Benoit Donneaux <benoit@leastauthority.com>
This commit is contained in:
Florian Sesser 2024-12-12 17:05:22 +00:00
parent 086f93432c
commit 4de3508904

View File

@ -132,7 +132,8 @@
[ tahoe-lafs ] ++ [ tahoe-lafs ] ++
tahoe-lafs.passthru.extras.i2p ++ tahoe-lafs.passthru.extras.i2p ++
tahoe-lafs.passthru.extras.tor ++ tahoe-lafs.passthru.extras.tor ++
tahoe-lafs.passthru.extras.unittest tahoe-lafs.passthru.extras.unittest ++
[ hatchling hatch-vcs ]
)).overrideAttrs (old: { )).overrideAttrs (old: {
# See the similar override in makeRuntimeEnv'. # See the similar override in makeRuntimeEnv'.
name = packageName pyVersion; name = packageName pyVersion;
@ -198,9 +199,11 @@
program = program =
let let
python = "${makeTestEnv pyVersion}/bin/python"; python = "${makeTestEnv pyVersion}/bin/python";
hatchling = "${makeTestEnv pyVersion}/bin/hatchling";
in in
writeScript "unit-tests" writeScript "unit-tests"
'' ''
${hatchling} build --hooks-only # Write _version.py
export TAHOE_LAFS_HYPOTHESIS_PROFILE=ci export TAHOE_LAFS_HYPOTHESIS_PROFILE=ci
export PYTHONPATH=$PWD/src export PYTHONPATH=$PWD/src
${python} -m twisted.trial "$@" ${python} -m twisted.trial "$@"