Unverified Commit 508be1c4 authored by Pavol Rusnak's avatar Pavol Rusnak Committed by GitHub
Browse files

python3Packages.ray: add support for aarch64-linux (#378935)

parents fb12b199 33d6e619
Loading
Loading
Loading
Loading
+27 −8
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  buildPythonPackage,
  pythonOlder,
  pythonAtLeast,
@@ -71,15 +72,30 @@ buildPythonPackage rec {
  inherit pname version;
  format = "wheel";

  disabled = pythonOlder "3.10" || pythonAtLeast "3.13";
  disabled = pythonOlder "3.9" || pythonAtLeast "3.13";

  src =
    let
      pyShortVersion = "cp${builtins.replaceStrings [ "." ] [ "" ] python.pythonVersion}";
      binary-hashes = {
        cp310 = "sha256-OTLW2zqJgsUZbbCM9W4u0L9QuFaFCM/khr6N5jui2V0=";
        cp311 = "sha256-//XpzFpTgV07WGomHjS9D+8cMkss3tTJuOeQ4ePcOZc=";
        cp312 = "sha256-PXassHD6i9Tr2wEazfoiu4m9vps1+3iuxZgdt26sK2A=";
      platforms = {
        aarch64-linux = "manylinux2014_aarch64";
        x86_64-linux = "manylinux2014_x86_64";
      };
      # hashes retrieved via the following command
      # curl https://pypi.org/pypi/ray/${version}/json | jq -r '.urls[] | "\(.digests.sha256)  \(.filename)"'
      hashes = {
        aarch64-linux = {
          cp39 = "782f29c8d743304fb3b67ed825db6caf5e5bd9263d628a6ff67a61bccde9f176";
          cp310 = "fbb2cf4a86f4705faea6334356faa4dc7f454210e6eb085d63b7f1ae6e9c12e1";
          cp311 = "68c9cc50af0dfafa78e5047890018cf3115fae8702ab083ac78b59b349989d45";
          cp312 = "c9712ee4c52b7764b2ec9c693419ffde1313dd79cb186173dae6e25db44993de";
        };
        x86_64-linux = {
          cp39 = "fe837e717a642a648f6fa8cc285e3ccc6782d126b8af793a25903fa3ac8d5c22";
          cp310 = "3932d6db3a8982c5196db08cf56e2ed0bf50b8568508cfe486be8de63ba2d95d";
          cp311 = "fff5e9cc5a53815d3b586a261e34bd0fef1c324b2cded4c9b8e790e1e3dc3997";
          cp312 = "3d76acb070fa8bd4ebdb011acdfa22bb89bdbe9b35fb78aec5981db76eac2b60";
        };
      };
    in
    fetchPypi {
@@ -87,8 +103,8 @@ buildPythonPackage rec {
      dist = pyShortVersion;
      python = pyShortVersion;
      abi = pyShortVersion;
      platform = "manylinux2014_x86_64";
      hash = binary-hashes.${pyShortVersion} or { };
      platform = platforms.${stdenv.hostPlatform.system} or { };
      sha256 = hashes.${stdenv.hostPlatform.system}.${pyShortVersion} or { };
    };

  nativeBuildInputs = [
@@ -192,6 +208,9 @@ buildPythonPackage rec {
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ billhuang ];
    sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
    platforms = [ "x86_64-linux" ];
    platforms = [
      "aarch64-linux"
      "x86_64-linux"
    ];
  };
}