diff --git a/doc/languages-frameworks/python.section.md b/doc/languages-frameworks/python.section.md index c80cdc9ad1486..ca6cd8fdaea2f 100644 --- a/doc/languages-frameworks/python.section.md +++ b/doc/languages-frameworks/python.section.md @@ -566,7 +566,7 @@ are used in [`buildPythonPackage`](#buildpythonpackage-function). - `pythonRelaxDepsHook` will relax Python dependencies restrictions for the package. See [example usage](#using-pythonrelaxdepshook). - `pythonRemoveBinBytecode` to remove bytecode from the `/bin` folder. -- `setuptoolsBuildHook` to build a wheel using `setuptools`. +- `setuptoolsBuildHook` executes`setup.py` directly, which is deprecated. Use the `pypaBuildHook` instead. - `sphinxHook` to build documentation and manpages using Sphinx. - `venvShellHook` to source a Python 3 `venv` at the `venvDir` location. A `venv` is created if it does not yet exist. `postVenvCreation` can be used to diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index b5aa006ba2124..dce678a9a844e 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -278,11 +278,12 @@ let isSetuptoolsDependency = isSetuptoolsDependency' (attrs.pname or null); + name = namePrefix + attrs.name or "${finalAttrs.pname}-${finalAttrs.version}"; + in (cleanAttrs attrs) // { - - name = namePrefix + attrs.name or "${finalAttrs.pname}-${finalAttrs.version}"; + inherit name; inherit catchConflicts; @@ -314,7 +315,7 @@ let unzip ] ++ optionals (format' == "setuptools") [ - setuptoolsBuildHook + (lib.warn "${name} uses the deprecated setuptools format. Remove `format` and configure `pyproject = true` and `build-system = [ setuptools ]` instead." setuptoolsBuildHook) ] ++ optionals (format' == "pyproject") [ (