From bdda7b0a538857f34a413076e06c3a4353efc70a Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Sun, 10 Sep 2023 00:55:30 +0200 Subject: [PATCH] python3Packages.flitBuildHook: remove --- doc/languages-frameworks/python.section.md | 1 - nixos/doc/manual/release-notes/rl-2311.section.md | 2 ++ .../interpreters/python/hooks/default.nix | 9 --------- .../interpreters/python/hooks/flit-build-hook.sh | 15 --------------- .../interpreters/python/mk-python-derivation.nix | 6 +----- .../python/python2/mk-python-derivation.nix | 6 ++---- 6 files changed, 5 insertions(+), 34 deletions(-) delete mode 100644 pkgs/development/interpreters/python/hooks/flit-build-hook.sh diff --git a/doc/languages-frameworks/python.section.md b/doc/languages-frameworks/python.section.md index ca0513fbde83..818edff64c24 100644 --- a/doc/languages-frameworks/python.section.md +++ b/doc/languages-frameworks/python.section.md @@ -459,7 +459,6 @@ are used in `buildPythonPackage`. with the `eggInstallHook` - `eggBuildHook` to skip building for eggs. - `eggInstallHook` to install eggs. -- `flitBuildHook` to build a wheel using `flit`. - `pipBuildHook` to build a wheel using `pip` and PEP 517. Note a build system (e.g. `setuptools` or `flit`) should still be added as `nativeBuildInput`. - `pypaBuildHook` to build a wheel using diff --git a/nixos/doc/manual/release-notes/rl-2311.section.md b/nixos/doc/manual/release-notes/rl-2311.section.md index baf3b4d90220..457311f1fcb8 100644 --- a/nixos/doc/manual/release-notes/rl-2311.section.md +++ b/nixos/doc/manual/release-notes/rl-2311.section.md @@ -336,4 +336,6 @@ The module update takes care of the new config syntax and the data itself (user can automatically format the root device by setting `virtualisation.fileSystems."/".autoFormat = true;`. +- `python3.pkgs.flitBuildHook` has been removed. Use `flit-core` and `format = "pyproject"` instead. + - The `electron` packages now places its application files in `$out/libexec/electron` instead of `$out/lib/electron`. Packages using electron-builder will fail to build and need to be adjusted by changing `lib` to `libexec`. diff --git a/pkgs/development/interpreters/python/hooks/default.nix b/pkgs/development/interpreters/python/hooks/default.nix index 306c33a91fdd..700276e77af1 100644 --- a/pkgs/development/interpreters/python/hooks/default.nix +++ b/pkgs/development/interpreters/python/hooks/default.nix @@ -45,15 +45,6 @@ in { propagatedBuildInputs = [ ]; } ./egg-unpack-hook.sh) {}; - flitBuildHook = callPackage ({ makePythonHook, flit }: - makePythonHook { - name = "flit-build-hook"; - propagatedBuildInputs = [ flit ]; - substitutions = { - inherit pythonInterpreter; - }; - } ./flit-build-hook.sh) {}; - pipBuildHook = callPackage ({ makePythonHook, pip, wheel }: makePythonHook { name = "pip-build-hook.sh"; diff --git a/pkgs/development/interpreters/python/hooks/flit-build-hook.sh b/pkgs/development/interpreters/python/hooks/flit-build-hook.sh deleted file mode 100644 index 45893aae00f4..000000000000 --- a/pkgs/development/interpreters/python/hooks/flit-build-hook.sh +++ /dev/null @@ -1,15 +0,0 @@ -# Setup hook for flit -echo "Sourcing flit-build-hook" - -flitBuildPhase () { - echo "Executing flitBuildPhase" - runHook preBuild - @pythonInterpreter@ -m flit build --format wheel - runHook postBuild - echo "Finished executing flitBuildPhase" -} - -if [ -z "${dontUseFlitBuild-}" ] && [ -z "${buildPhase-}" ]; then - echo "Using flitBuildPhase" - buildPhase=flitBuildPhase -fi diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index e9c783116b60..fbacf6bb2337 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -11,7 +11,6 @@ , namePrefix , update-python-libraries , setuptools -, flitBuildHook , pypaBuildHook , pypaInstallHook , pythonCatchConflictsHook @@ -90,7 +89,6 @@ # Several package formats are supported. # "setuptools" : Install a common setuptools/distutils based package. This builds a wheel. # "wheel" : Install from a pre-compiled wheel. -# "flit" : Install a flit package. This builds a wheel. # "pyproject": Install a package using a ``pyproject.toml`` file (PEP517). This builds a wheel. # "egg": Install a package from an egg. # "other" : Provide your own buildPhase and installPhase. @@ -122,7 +120,7 @@ let else "setuptools"; - withDistOutput = lib.elem format' ["pyproject" "setuptools" "flit" "wheel"]; + withDistOutput = lib.elem format' ["pyproject" "setuptools" "wheel"]; name_ = name; @@ -222,8 +220,6 @@ let unzip ] ++ lib.optionals (format' == "setuptools") [ setuptoolsBuildHook - ] ++ lib.optionals (format' == "flit") [ - flitBuildHook ] ++ lib.optionals (format' == "pyproject") [( if isBootstrapPackage then pypaBuildHook.override { diff --git a/pkgs/development/interpreters/python/python2/mk-python-derivation.nix b/pkgs/development/interpreters/python/python2/mk-python-derivation.nix index e5f9c00b2fb2..d42e4e85c102 100644 --- a/pkgs/development/interpreters/python/python2/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/python2/mk-python-derivation.nix @@ -98,12 +98,10 @@ , ... } @ attrs: -assert lib.assertMsg (format != "flit") "flit is not a supported Python 2 format"; - let inherit (python) stdenv; - withDistOutput = lib.elem format ["pyproject" "setuptools" "flit" "wheel"]; + withDistOutput = lib.elem format ["pyproject" "setuptools" "wheel"]; name_ = name; @@ -171,7 +169,7 @@ let nativeBuildInputs = [ python wrapPython - ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, flit, ...)? + ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, ...)? pythonRemoveTestsDirHook ] ++ lib.optionals catchConflicts [ pythonCatchConflictsHook