buildPython*: remove pythonRecompileBytecodeHook as dependency

This hook was added to get reproducible bytecode. Because it was causing
issues it was disabled, but still kept as a dependency. Now the main
issue with bytecode reproducibility has been resolved by updating pip to
20.2.4, we remove this hook as a dependency.

If a package with Python code is not yet reproducible, one could add
this hook to `nativeBuildInputs`.
This commit is contained in:
Frederik Rietdijk 2020-11-07 15:36:46 +01:00 committed by Frederik Rietdijk
parent ca6e7454a4
commit 3fceafce1e
7 changed files with 2 additions and 25 deletions

View File

@ -17,7 +17,6 @@
, pythonCatchConflictsHook , pythonCatchConflictsHook
, pythonImportsCheckHook , pythonImportsCheckHook
, pythonNamespacesHook , pythonNamespacesHook
, pythonRecompileBytecodeHook
, pythonRemoveBinBytecodeHook , pythonRemoveBinBytecodeHook
, pythonRemoveTestsDirHook , pythonRemoveTestsDirHook
, setuptoolsBuildHook , setuptoolsBuildHook
@ -113,7 +112,6 @@ let
python python
wrapPython wrapPython
ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, flit, ...)? ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, flit, ...)?
pythonRecompileBytecodeHook # Remove when solved https://github.com/NixOS/nixpkgs/issues/81441
pythonRemoveTestsDirHook pythonRemoveTestsDirHook
] ++ lib.optionals catchConflicts [ ] ++ lib.optionals catchConflicts [
setuptools pythonCatchConflictsHook setuptools pythonCatchConflictsHook
@ -167,9 +165,6 @@ let
# Python packages built through cross-compilation are always for the host platform. # Python packages built through cross-compilation are always for the host platform.
disallowedReferences = lib.optionals (python.stdenv.hostPlatform != python.stdenv.buildPlatform) [ python.pythonForBuild ]; disallowedReferences = lib.optionals (python.stdenv.hostPlatform != python.stdenv.buildPlatform) [ python.pythonForBuild ];
# For now, revert recompilation of bytecode.
dontUsePythonRecompileBytecode = true;
meta = { meta = {
# default to python's platforms # default to python's platforms
platforms = python.meta.platforms; platforms = python.meta.platforms;

View File

@ -24,8 +24,6 @@ buildPythonPackage rec {
# Test failing due to upstream issue (https://bitbucket.org/amentajo/lib3to2/issues/50/testsuite-fails-with-new-python-35) # Test failing due to upstream issue (https://bitbucket.org/amentajo/lib3to2/issues/50/testsuite-fails-with-new-python-35)
doCheck = false; doCheck = false;
dontUsePythonRecompileBytecode = true;
meta = { meta = {
homepage = "https://bitbucket.org/amentajo/lib3to2"; homepage = "https://bitbucket.org/amentajo/lib3to2";
description = "Refactors valid 3.x syntax into valid 2.x syntax, if a syntactical conversion is possible"; description = "Refactors valid 3.x syntax into valid 2.x syntax, if a syntactical conversion is possible";

View File

@ -20,9 +20,6 @@ buildPythonPackage rec {
# errors with vendored libs # errors with vendored libs
doCheck = false; doCheck = false;
# has vendored python2 code
dontUsePythonRecompileBytecode = true;
meta = { meta = {
description = "Pythonic task execution"; description = "Pythonic task execution";
license = lib.licenses.bsd2; license = lib.licenses.bsd2;

View File

@ -5,7 +5,7 @@
, isPy3k , isPy3k
}: }:
buildPythonPackage (rec { buildPythonPackage rec {
pname = "linecache2"; pname = "linecache2";
version = "1.0.0"; version = "1.0.0";
@ -23,8 +23,4 @@ buildPythonPackage (rec {
homepage = "https://github.com/testing-cabal/linecache2"; homepage = "https://github.com/testing-cabal/linecache2";
license = licenses.psfl; license = licenses.psfl;
}; };
# TODO: move into main set, this was to avoid a rebuild }
} // stdenv.lib.optionalAttrs (!isPy3k ) {
# syntax error in tests. Tests are likely Python 3 only.
dontUsePythonRecompileBytecode = !isPy3k;
})

View File

@ -41,8 +41,4 @@ buildPythonPackage (rec {
any platform that supports the standard Python pty module. any platform that supports the standard Python pty module.
''; '';
}; };
# TODO: move into main set, this was to avoid a rebuild
} // lib.optionalAttrs (!isPy3k ) {
# syntax error in _async module, likely intended only for Python 3.
dontUsePythonRecompileBytecode = !isPy3k;
}) })

View File

@ -68,10 +68,6 @@ python3.pkgs.buildPythonApplication rec {
--replace "${python3}" "" --replace "${python3}" ""
''; '';
# find: ...-gtk-doc-1.32/lib/python3.8/site-packages: No such file or directory
# https://github.com/NixOS/nixpkgs/pull/90208#issuecomment-644051108
dontUsePythonRecompileBytecode = true;
passthru = { passthru = {
# Consumers are expected to copy the m4 files to their source tree, let them reuse the patch # Consumers are expected to copy the m4 files to their source tree, let them reuse the patch
respect_xml_catalog_files_var_patch = ./respect-xml-catalog-files-var.patch; respect_xml_catalog_files_var_patch = ./respect-xml-catalog-files-var.patch;

View File

@ -23,7 +23,6 @@ let
dontConfigure = true; dontConfigure = true;
dontBuild = true; dontBuild = true;
dontUsePythonRecompileBytecode = true;
passthru = { passthru = {
inherit (drv.passthru) withPlugins; inherit (drv.passthru) withPlugins;