Skip to content

Commit

Permalink
Adjust for renaming of pythonForBuild to pythonOnBuildForHost
Browse files Browse the repository at this point in the history
The upstream Nixpkgs renamed `pythonForBuild` to `pythonOnBuildForHost`
and made `pythonForBuild` emit warnings: NixOS/nixpkgs#265764.  Adjust
the poetry2nix code to avoid warnings with the new version, while still
keeping compatibility with the old one.
  • Loading branch information
sigprof committed Feb 1, 2024
1 parent e0b44e9 commit 8fb6db1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions hooks/default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{ python, stdenv, makeSetupHook, pkgs, lib }:
let
inherit (python) pythonForBuild;
inherit (pythonForBuild.pkgs) callPackage;
pythonInterpreter = pythonForBuild.interpreter;
pythonOnBuildForHost = python.pythonOnBuildForHost or python.pythonForBuild;
inherit (pythonOnBuildForHost.pkgs) callPackage;
pythonInterpreter = pythonOnBuildForHost.interpreter;
pythonSitePackages = python.sitePackages;

nonOverlayedPython = pkgs.python3.pythonForBuild.withPackages (ps: [ ps.tomlkit ]);
nonOverlayedPython = (pkgs.python3.pythonOnBuildForHost or pkgs.python3.pythonForBuild).withPackages (ps: [ ps.tomlkit ]);
makeRemoveSpecialDependenciesHook =
{ fields
, kind
Expand Down
8 changes: 4 additions & 4 deletions overrides/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ let
true;
intendedBuildSystem =
if attr.buildSystem == "cython" then
self.python.pythonForBuild.pkgs.cython
(self.python.pythonOnBuildForHost or self.python.pythonForBuild).pkgs.cython
else
self.${attr.buildSystem};
in
if fromIsValid && untilIsValid then intendedBuildSystem else null
else
if attr == "cython" then self.python.pythonForBuild.pkgs.cython else self.${attr};
if attr == "cython" then (self.python.pythonOnBuildForHost or self.python.pythonForBuild).pkgs.cython else self.${attr};
in
if (attr == "flit-core" || attr == "flit" || attr == "hatchling") && !self.isPy3k then drv
else if drv == null then null
Expand Down Expand Up @@ -101,7 +101,7 @@ lib.composeManyExtensions [
let
inherit (self.python) stdenv;
inherit (pkgs.buildPackages) pkg-config;
pyBuildPackages = self.python.pythonForBuild.pkgs;
pyBuildPackages = (self.python.pythonOnBuildForHost or self.python.pythonForBuild).pkgs;

selectQt5 = version:
let
Expand Down Expand Up @@ -129,7 +129,7 @@ lib.composeManyExtensions [
qtxmlpatterns
];

bootstrappingBase = pkgs.${self.python.pythonAttr}.pythonForBuild.pkgs;
bootstrappingBase = (pkgs.${self.python.pythonAttr}.pythonOnBuildForHost or pkgs.${self.python.pythonAttr}.pythonForBuild).pkgs;
in

{
Expand Down

0 comments on commit 8fb6db1

Please sign in to comment.