Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update nixpkgs reference to version 24.11 in flake.nix files #1889

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
3 changes: 2 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ lib.makeScope pkgs.newScope (self: {
final: _prev:
{
mkPoetryDep = final.callPackage ./mk-poetry-dep.nix {
inherit lib python poetryLib pep508Env pyVersion;
inherit lib poetryLib pep508Env pyVersion;
python = py;
inherit pyproject-nix;
};

Expand Down
7 changes: 4 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

inputs = {
flake-utils.url = "github:numtide/flake-utils";
# Last working commit from nixos-small-unstable
nixpkgs.url = "github:NixOS/nixpkgs?rev=75e28c029ef2605f9841e0baa335d70065fe7ae2";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";

treefmt-nix.url = "github:numtide/treefmt-nix";
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
Expand Down
25 changes: 19 additions & 6 deletions hooks/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,18 @@ let
pythonInterpreter = pythonOnBuildForHost.interpreter;
pythonSitePackages = python.sitePackages;

nonOverlayedPython = (pkgs.python3.pythonOnBuildForHost or pkgs.python3.pythonForBuild).withPackages (ps: [ ps.tomlkit ]);
pythonFromPkgs = {
"3.6" = pkgs.python36;
"3.7" = pkgs.python37;
"3.8" = pkgs.python38;
"3.9" = pkgs.python39;
"3.10" = pkgs.python310;
"3.11" = pkgs.python311;
"3.12" = pkgs.python312;
"3.13" = pkgs.python313;
}.${lib.versions.majorMinor python.version};

nonOverlayedPython = (pythonFromPkgs.pythonOnBuildForHost or pythonFromPkgs.pythonForBuild).withPackages (ps: [ ps.tomlkit ps.pip ]);
makeRemoveSpecialDependenciesHook =
{ fields
, kind
Expand All @@ -24,8 +35,9 @@ let
substitutions = {
# NOTE: We have to use a non-overlayed Python here because otherwise we run into an infinite recursion
# because building of tomlkit and its dependencies also use these hooks.
pythonPath = nonOverlayedPython.pkgs.makePythonPath [ nonOverlayedPython ];
pythonInterpreter = nonOverlayedPython.interpreter;
# pythonPath = nonOverlayedPython.pkgs.makePythonPath [ nonOverlayedPython ];
inherit pythonSitePackages;
inherit pythonInterpreter;
inherit pyprojectPatchScript;
inherit fields;
inherit kind;
Expand Down Expand Up @@ -59,15 +71,16 @@ in
pipBuildHook =
callPackage
(
{ pip, wheel }:
{ wheel }:
makeSetupHook
({
name = "pip-build-hook.sh";
substitutions = {
inherit pythonInterpreter pythonSitePackages;
inherit pythonSitePackages;
inherit pythonInterpreter;
};
}
// (makeSetupHookArgs [ pip wheel ]))
// (makeSetupHookArgs [ nonOverlayedPython.pkgs.pip wheel ]))
./pip-build-hook.sh
)
{ };
Expand Down
49 changes: 38 additions & 11 deletions overrides/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,16 @@ lib.composeManyExtensions [
rm $out/bin/tensorboard
'';
};
pythonFromPkgs = {
"3.6" = pkgs.python36;
"3.7" = pkgs.python37;
"3.8" = pkgs.python38;
"3.9" = pkgs.python39;
"3.10" = pkgs.python310;
"3.11" = pkgs.python311;
"3.12" = pkgs.python312;
"3.13" = pkgs.python313;
}.${lib.versions.majorMinor prev.python.version};
in

{
Expand Down Expand Up @@ -179,9 +189,7 @@ lib.composeManyExtensions [
inherit (final) buildPythonPackage flit-core tomli;
};

wheel = bootstrappingBase.wheel.override {
inherit (final) buildPythonPackage flit-core;
};


inherit (bootstrappingBase) cython cython_0;
#### END bootstrapping pkgs
Expand Down Expand Up @@ -412,13 +420,13 @@ lib.composeManyExtensions [
# apply necessary patches in postInstall if the source is a wheel
postInstall = lib.optionalString (old.src.isWheel or false) ''
pushd "$out/${final.python.sitePackages}"
for patch in ${lib.concatMapStringsSep " " (p: "${p}") pkgs.python3.pkgs.cairocffi.patches}; do
for patch in ${lib.concatMapStringsSep " " (p: "${p}") pythonFromPkgs.pkgs.cairocffi.patches}; do
patch -p1 < "$patch"
done
popd
'';
} // lib.optionalAttrs (!(old.src.isWheel or false)) {
inherit (pkgs.python3.pkgs.cairocffi) patches;
inherit (pythonFromPkgs.pkgs.cairocffi) patches;
}
);

Expand Down Expand Up @@ -913,6 +921,17 @@ lib.composeManyExtensions [
(lib.optionals (final ? fastapi-cli) [ final.fastapi-cli ]);
});

uvicorn = prev.uvicorn.overridePythonAttrs (old: {
optional-dependencies.standard = [
prev.httptools
prev.python-dotenv
prev.pyyaml
prev.uvloop
prev.watchfiles
prev.websockets
];
});

fastecdsa = prev.fastecdsa.overridePythonAttrs (old: {
buildInputs = old.buildInputs or [ ] ++ [ pkgs.gmp.dev ];
});
Expand Down Expand Up @@ -1279,7 +1298,7 @@ lib.composeManyExtensions [

jira = prev.jira.overridePythonAttrs (
old: {
inherit (pkgs.python3Packages.jira) patches;
inherit (pythonFromPkgs.pkgs.jira) patches;
buildInputs = old.buildInputs or [ ] ++ [
final.pytestrunner
final.cryptography
Expand Down Expand Up @@ -1828,7 +1847,7 @@ lib.composeManyExtensions [
};
};
in
{
{
# fails to build with format=pyproject and setuptools >= 65
format =
if ((old.format or null) == "poetry2nix") then
Expand Down Expand Up @@ -2226,7 +2245,7 @@ lib.composeManyExtensions [
pillow = prev.pillow.overridePythonAttrs (
old:
let
preConfigure = (old.preConfigure or "") + pkgs.python3.pkgs.pillow.preConfigure;
preConfigure = (old.preConfigure or "") + pythonFromPkgs.pkgs.pillow.preConfigure;
in
{
nativeBuildInputs = old.nativeBuildInputs or [ ]
Expand Down Expand Up @@ -3812,7 +3831,7 @@ lib.composeManyExtensions [

# Fix library paths
postPatch = lib.optionalString (!(old.src.isWheel or false)) (old.postPatch or "" + ''
${pkgs.python3.interpreter} ${./shapely-rewrite.py} shapely/geos.py
${pythonFromPkgs.interpreter} ${./shapely-rewrite.py} shapely/geos.py
substituteInPlace pyproject.toml --replace-warn 'setuptools<64' 'setuptools'
'');
}
Expand Down Expand Up @@ -4037,7 +4056,7 @@ lib.composeManyExtensions [

vispy = prev.vispy.overrideAttrs (
_: {
inherit (pkgs.python3.pkgs.vispy) patches;
inherit (pythonFromPkgs.pkgs.vispy) patches;
}
);

Expand Down Expand Up @@ -4130,7 +4149,7 @@ lib.composeManyExtensions [

weasyprint = prev.weasyprint.overridePythonAttrs (
old: {
inherit (pkgs.python3.pkgs.weasyprint) patches;
inherit (pythonFromPkgs.pkgs.weasyprint) patches;
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ final.pytest-runner ];
buildInputs = old.buildInputs or [ ] ++ [ final.pytest-runner ];
}
Expand Down Expand Up @@ -4311,6 +4330,14 @@ lib.composeManyExtensions [
'';
});

wheel = prev.wheel.overridePythonAttrs (old: rec {
version = "0.45.1";
src = old.src.override (oldSrc: {
rev = "refs/tags/${version}";
hash = "sha256-tgueGEWByS5owdA5rhXGn3qh1Vtf0HGYC6+BHfrnGAs=";
});
});

marisa-trie = prev.marisa-trie.overridePythonAttrs (
old: {
buildInputs = old.buildInputs or [ ] ++ [ final.pytest-runner ];
Expand Down
3 changes: 1 addition & 2 deletions templates/app/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

inputs = {
flake-utils.url = "github:numtide/flake-utils";
# Last working commit from nixos-small-unstable
nixpkgs.url = "github:NixOS/nixpkgs?rev=75e28c029ef2605f9841e0baa335d70065fe7ae2";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
Expand Down
4 changes: 0 additions & 4 deletions tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ in
let
pkgs' = pkgs // {
inherit poetry2nix;

# At the time of writing 3.12 is causing issues.
python3 = pkgs.python311;
python = pkgs.python311;
};

poetry2nix = import ./.. { pkgs = pkgs'; };
Expand Down
Loading