From 3fceafce1eaa82c36a21153efbf7c1ee87af7b0e Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 7 Nov 2020 15:36:46 +0100 Subject: [PATCH] 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`. --- .../interpreters/python/mk-python-derivation.nix | 5 ----- pkgs/development/python-modules/3to2/default.nix | 2 -- pkgs/development/python-modules/invoke/default.nix | 3 --- pkgs/development/python-modules/linecache2/default.nix | 8 ++------ pkgs/development/python-modules/pexpect/default.nix | 4 ---- pkgs/development/tools/documentation/gtk-doc/default.nix | 4 ---- pkgs/development/tools/poetry2nix/poetry2nix/plugins.nix | 1 - 7 files changed, 2 insertions(+), 25 deletions(-) diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index c3be76790eb..c85a5939055 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -17,7 +17,6 @@ , pythonCatchConflictsHook , pythonImportsCheckHook , pythonNamespacesHook -, pythonRecompileBytecodeHook , pythonRemoveBinBytecodeHook , pythonRemoveTestsDirHook , setuptoolsBuildHook @@ -113,7 +112,6 @@ let python wrapPython ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, flit, ...)? - pythonRecompileBytecodeHook # Remove when solved https://github.com/NixOS/nixpkgs/issues/81441 pythonRemoveTestsDirHook ] ++ lib.optionals catchConflicts [ setuptools pythonCatchConflictsHook @@ -167,9 +165,6 @@ let # Python packages built through cross-compilation are always for the host platform. disallowedReferences = lib.optionals (python.stdenv.hostPlatform != python.stdenv.buildPlatform) [ python.pythonForBuild ]; - # For now, revert recompilation of bytecode. - dontUsePythonRecompileBytecode = true; - meta = { # default to python's platforms platforms = python.meta.platforms; diff --git a/pkgs/development/python-modules/3to2/default.nix b/pkgs/development/python-modules/3to2/default.nix index 8870388c284..ff64a6d1a47 100644 --- a/pkgs/development/python-modules/3to2/default.nix +++ b/pkgs/development/python-modules/3to2/default.nix @@ -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) doCheck = false; - dontUsePythonRecompileBytecode = true; - meta = { homepage = "https://bitbucket.org/amentajo/lib3to2"; description = "Refactors valid 3.x syntax into valid 2.x syntax, if a syntactical conversion is possible"; diff --git a/pkgs/development/python-modules/invoke/default.nix b/pkgs/development/python-modules/invoke/default.nix index 7189727cf3a..45f3ee7a04d 100644 --- a/pkgs/development/python-modules/invoke/default.nix +++ b/pkgs/development/python-modules/invoke/default.nix @@ -20,9 +20,6 @@ buildPythonPackage rec { # errors with vendored libs doCheck = false; - # has vendored python2 code - dontUsePythonRecompileBytecode = true; - meta = { description = "Pythonic task execution"; license = lib.licenses.bsd2; diff --git a/pkgs/development/python-modules/linecache2/default.nix b/pkgs/development/python-modules/linecache2/default.nix index a2c7080e270..ba2525155d3 100644 --- a/pkgs/development/python-modules/linecache2/default.nix +++ b/pkgs/development/python-modules/linecache2/default.nix @@ -5,7 +5,7 @@ , isPy3k }: -buildPythonPackage (rec { +buildPythonPackage rec { pname = "linecache2"; version = "1.0.0"; @@ -23,8 +23,4 @@ buildPythonPackage (rec { homepage = "https://github.com/testing-cabal/linecache2"; 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; -}) +} diff --git a/pkgs/development/python-modules/pexpect/default.nix b/pkgs/development/python-modules/pexpect/default.nix index aead62913c7..60655708bea 100644 --- a/pkgs/development/python-modules/pexpect/default.nix +++ b/pkgs/development/python-modules/pexpect/default.nix @@ -41,8 +41,4 @@ buildPythonPackage (rec { 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; }) diff --git a/pkgs/development/tools/documentation/gtk-doc/default.nix b/pkgs/development/tools/documentation/gtk-doc/default.nix index d7779540f97..4645c63e71d 100644 --- a/pkgs/development/tools/documentation/gtk-doc/default.nix +++ b/pkgs/development/tools/documentation/gtk-doc/default.nix @@ -68,10 +68,6 @@ python3.pkgs.buildPythonApplication rec { --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 = { # 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; diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/plugins.nix b/pkgs/development/tools/poetry2nix/poetry2nix/plugins.nix index b5e807c6e2d..e7125c2ff57 100644 --- a/pkgs/development/tools/poetry2nix/poetry2nix/plugins.nix +++ b/pkgs/development/tools/poetry2nix/poetry2nix/plugins.nix @@ -23,7 +23,6 @@ let dontConfigure = true; dontBuild = true; - dontUsePythonRecompileBytecode = true; passthru = { inherit (drv.passthru) withPlugins;