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

Use PEP-599 platform definitions from pyproject.nix #1361

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -203,23 +203,6 @@ let
};
};

# Maps Nixpkgs CPU values to target machines known to be supported for manylinux* wheels.
# (a.k.a. `uname -m` output from CentOS 7)
#
# This is current as of manylinux2014 (PEP-0599), and is a superset of manylinux2010 / manylinux1.
# s390x is not supported in Nixpkgs, so we don't map it.
manyLinuxTargetMachines = {
x86_64 = "x86_64";
i686 = "i686";
aarch64 = "aarch64";
armv7l = "armv7l";
powerpc64 = "ppc64";
powerpc64le = "ppc64le";
};

# Machine tag for our target platform (if available)
getTargetMachine = stdenv: manyLinuxTargetMachines.${stdenv.targetPlatform.parsed.cpu.name} or null;

in
{
inherit
Expand All @@ -232,6 +215,5 @@ in
satisfiesSemver
cleanPythonSources
getPythonVersion
getTargetMachine
;
}
2 changes: 1 addition & 1 deletion mk-poetry-dep.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pythonPackages.callPackage
inherit (poetryLib) isCompatible getManyLinuxDeps fetchFromLegacy fetchFromPypi;

inherit (import ./pep425.nix {
inherit lib poetryLib python stdenv;
inherit lib python stdenv pyproject-nix;
}) selectWheel
;
fileCandidates =
Expand Down
4 changes: 2 additions & 2 deletions pep425.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ lib, stdenv, poetryLib, python, isLinux ? stdenv.isLinux }:
{ lib, stdenv, python, pyproject-nix, isLinux ? stdenv.isLinux }:
let
inherit (lib.strings) escapeRegex hasPrefix hasSuffix hasInfix splitString removeSuffix;
targetMachine = poetryLib.getTargetMachine stdenv;
targetMachine = pyproject-nix.pep599.manyLinuxTargetMachines.${stdenv.targetPlatform.parsed.cpu.name};

pythonVer =
let
Expand Down