python310Packages.cython: Force regeneration of generated code in sdists

Lots of python packages seem to ship their source distributions with
generated code. In recent cython versions there is a way to force a
regeneration of these files and using it sounds generally sounds like a
good thing.

If it turns out, that this causes problems on individual packages,
setting `dontForceRegenCython` will prevent the regeneration.

Added in 3.0.0a11 and backported to 2.9.34, so both cython versions we
ship right now support this flag.
This commit is contained in:
Martin Weinelt 2023-04-02 21:30:33 +02:00
parent 6498700070
commit c8ece5516e
No known key found for this signature in database
GPG key ID: 87C1E9888F856759
2 changed files with 7 additions and 0 deletions

View file

@ -74,6 +74,10 @@ in buildPythonPackage rec {
doCheck = false;
# doCheck = !stdenv.isDarwin;
# force regeneration of generated code in source distributions
# https://github.com/cython/cython/issues/5089
setupHook = ./setup-hook.sh;
meta = {
changelog = "https://github.com/cython/cython/blob/${version}/CHANGES.rst";
description = "An optimising static compiler for both the Python programming language and the extended Cython programming language";

View file

@ -0,0 +1,3 @@
if [ -z "${dontForceRegenCython-}"]; then
export CYTHON_FORCE_REGEN=1
fi