Unverified Commit d2e9be2b authored by Martin Weinelt's avatar Martin Weinelt
Browse files

buildPython*: throw on empty format

This is the ratchet that disallows introducing new python packages that
do not define a package format.
parent ae4a1a48
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -61,6 +61,10 @@
- `reaction` has been updated to version 2, which includes some breaking changes.
  For more information, [check the release article](https://blog.ppom.me/en-reaction-v2).

- The `buildPythonPackage` and `buildPythonApplication` functions now require
  an explicit `format` attribute. Previously the default format used setuptools
  and called `setup.py` from the source tree, which is deprecated.
  The modern alternative is to configure `pyproject = true` with `build-system = [ setuptools ]`.

### Deprecations {#sec-nixpkgs-release-25.11-lib-deprecations}

+4 −3
Original line number Diff line number Diff line
@@ -211,7 +211,7 @@ let
        else if format != null then
          format
        else
          "setuptools";
          throw "${name} does not configure a `format`. To build with setuptools as before, set `pyproject = true` and `build-system = [ setuptools ]`.`";

      withDistOutput = withDistOutput' format';

@@ -268,11 +268,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;