Unverified Commit 060e8eee authored by adisbladis's avatar adisbladis Committed by GitHub
Browse files

Merge pull request #224912 from adisbladis/poetry2nix-1_41_0

poetry2nix: 1.40.1 -> 1.41.0
parents ef5308c6 bc0e5c12
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
{ pkgs ? import <nixpkgs> { }
, lib ? pkgs.lib
, poetry ? null
, poetryLib ? import ./lib.nix { inherit lib pkgs; stdenv = pkgs.stdenv; }
}:
let
  # Poetry2nix version
  version = "1.40.1";
  version = "1.41.0";

  inherit (poetryLib) isCompatible readTOML normalizePackageName normalizePackageSet;

@@ -157,7 +156,7 @@ lib.makeScope pkgs.newScope (self: {
      };
      getFunctorFn = fn: if builtins.typeOf fn == "set" then fn.__functor else fn;

      poetryPkg = pkgs.callPackage ./pkgs/poetry { inherit python; };
      poetryPkg = pkgs.callPackage ./pkgs/poetry { inherit python; poetry2nix = self; };

      scripts = pyProject.tool.poetry.scripts or { };
      hasScripts = scripts != { };
@@ -506,7 +505,7 @@ lib.makeScope pkgs.newScope (self: {

    Can be overriden by calling defaultPoetryOverrides.overrideOverlay which takes an overlay function
  */
  defaultPoetryOverrides = self.mkDefaultPoetryOverrides (import ./overrides { inherit pkgs lib poetryLib; });
  defaultPoetryOverrides = self.mkDefaultPoetryOverrides (import ./overrides { inherit pkgs lib; });

  /*
    Convenience functions for specifying overlays with or without the poerty2nix default overrides
+1 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ if __name__ == "__main__":
    sys.path.extend(sys.argv[1:])

    try:
        with open("setup.py") as f:
        with open("setup.py", encoding="utf-8-sig") as f:
            tree = ast.parse(f.read())
    except FileNotFoundError:
        exit(0)
+55 −4
Original line number Diff line number Diff line
@@ -1245,6 +1245,9 @@
  "autobahn": [
    "setuptools"
  ],
  "autodoc": [
    "setuptools"
  ],
  "autoflake": [
    "hatchling"
  ],
@@ -3642,6 +3645,9 @@
  "databricks-sql-connector": [
    "poetry-core"
  ],
  "dataclass-wizard": [
    "setuptools"
  ],
  "dataclasses-json": [
    "setuptools"
  ],
@@ -6137,7 +6143,18 @@
    "setuptools"
  ],
  "gitlint": [
    "setuptools"
    {
      "buildSystem": "setuptools",
      "until": "0.19"
    },
    {
      "buildSystem": "hatchling",
      "from": "0.19"
    },
    {
      "buildSystem": "hatch-vcs",
      "from": "0.19"
    }
  ],
  "gitlint-core": [
    {
@@ -7946,7 +7963,13 @@
    "setuptools"
  ],
  "jupyter-ydoc": [
    "hatchling"
    {
      "buildSystem": "hatchling"
    },
    {
      "buildSystem": "hatch-nodejs-version",
      "from": "0.2.3"
    }
  ],
  "jupyterhub": [
    "setuptools"
@@ -8181,6 +8204,9 @@
  "kubernetes": [
    "setuptools"
  ],
  "kubernetes-stubs": [
    "poetry"
  ],
  "l18n": [
    "setuptools"
  ],
@@ -11600,6 +11626,9 @@
  "psycopg": [
    "setuptools"
  ],
  "psycopg-pool": [
    "setuptools"
  ],
  "psycopg2": [
    "setuptools"
  ],
@@ -12213,6 +12242,9 @@
  "pydroid-ipcam": [
    "setuptools"
  ],
  "pydruid": [
    "setuptools"
  ],
  "pydsdl": [
    "setuptools"
  ],
@@ -14381,7 +14413,8 @@
    "setuptools"
  ],
  "python-multipart": [
    "setuptools"
    "setuptools",
    "hatchling"
  ],
  "python-mystrom": [
    "setuptools"
@@ -16221,6 +16254,9 @@
  "simple-salesforce": [
    "setuptools"
  ],
  "simple-term-menu": [
    "setuptools"
  ],
  "simple-websocket-server": [
    "setuptools"
  ],
@@ -16832,6 +16868,9 @@
  "sqlmap": [
    "setuptools"
  ],
  "sqlmodel": [
    "poetry-core"
  ],
  "sqlobject": [
    "setuptools"
  ],
@@ -16976,7 +17015,7 @@
    "setuptools"
  ],
  "strawberry-graphql": [
    "poetry-core",
    "poetry",
    "setuptools"
  ],
  "streamdeck": [
@@ -18059,12 +18098,18 @@
  "types-cachetools": [
    "setuptools"
  ],
  "types-click": [
    "setuptools"
  ],
  "types-colorama": [
    "setuptools"
  ],
  "types-cryptography": [
    "setuptools"
  ],
  "types-dataclasses": [
    "setuptools"
  ],
  "types-dateutil": [
    "setuptools"
  ],
@@ -18098,6 +18143,12 @@
  "types-orjson": [
    "setuptools"
  ],
  "types-paramiko": [
    "setuptools"
  ],
  "types-pillow": [
    "setuptools"
  ],
  "types-pkg-resources": [
    "setuptools"
  ],
+25 −10
Original line number Diff line number Diff line
{ pkgs ? import <nixpkgs> { }
, lib ? pkgs.lib
, stdenv ? pkgs.stdenv
, poetryLib
}:

let
@@ -384,6 +382,8 @@ lib.composeManyExtensions [
            "38.0.4" = "sha256-BN0kOblUwgHj5QBf52RY2Jx0nBn03lwoN1O5PEohbwY=";
            "39.0.0" = "sha256-clorC0NtGukpE3DnZ84MSdGhJN+qC89DZPITZFuL01Q=";
            "39.0.2" = "sha256-Admz48/GS2t8diz611Ciin1HKQEyMDEwHxTpJ5tZ1ZA=";
            "40.0.0" = "sha256-/TBANavYria9YrBpMgjtFyqg5feBcloETcYJ8fdBgkI=";
            "40.0.1" = "sha256-gFfDTc2QWBWHBCycVH1dYlCsWQMVcRZfOBIau+njtDU=";
          }.${version} or (
            lib.warn "Unknown cryptography version: '${version}'. Please update getCargoHash." lib.fakeHash
          );
@@ -402,8 +402,11 @@ lib.composeManyExtensions [
                ++ lib.optionals (lib.versionAtLeast old.version "3.4") [ self.setuptools-rust ]
                ++ lib.optional (!self.isPyPy) pyBuildPackages.cffi
                ++ lib.optional (lib.versionAtLeast old.version "3.5" && !isWheel)
                (with pkgs.rustPlatform; [ cargoSetupHook rust.cargo rust.rustc ]);
                (with pkgs.rustPlatform; [ cargoSetupHook rust.cargo rust.rustc ])
                ++ [ pkg-config ]
              ;
              buildInputs = (old.buildInputs or [ ])
                ++ [ pkgs.libxcrypt ]
                ++ [ (if lib.versionAtLeast old.version "37" then pkgs.openssl_3 else pkgs.openssl_1_1) ]
                ++ lib.optionals stdenv.isDarwin [ pkgs.darwin.apple_sdk.frameworks.Security pkgs.libiconv ];
              propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [ self.cffi ];
@@ -709,6 +712,8 @@ lib.composeManyExtensions [
            "0.2.4" = "sha256-GdQJvVPsWgC1z7La9h11x2pRAP+L998yImhTFrFT5l8=";
            "0.2.5" = "sha256-vMXMxss77rmXSjoB53eE8XN2jXyIEf03WoQiDfvhDmw=";
            "0.2.6" = "sha256-l9W9+KDg/43mc0toEz1n1pqw+oQdiHdAxGlS+KLIGhw=";
            "0.3.0" = "sha256-icBjtW8fZjT3mLo43nKWdirMz6GZIy/RghEO95pHJEU=";
            "0.3.1" = "sha256-EKK+RxkJ//fY43EjvN1Fry7mn2ZLIaNlTyKPJRxyKZs=";
          }.${version};
          sha256 = getRepoHash super.granian.version;
        in
@@ -782,7 +787,7 @@ lib.composeManyExtensions [
              ;
              propagatedBuildInputs =
                (old.propagatedBuildInputs or [ ])
                ++ lib.optionals mpiSupport [ self.mpi4py self.openssh ]
                ++ lib.optionals mpiSupport [ self.mpi4py pkgs.openssh ]
              ;
              preBuild = if mpiSupport then "export CC=${mpi}/bin/mpicc" else "";
              HDF5_DIR = "${pkgs.hdf5}";
@@ -1095,9 +1100,9 @@ lib.composeManyExtensions [
            else if (lib.versionOlder old.version "0.28.0" && lib.versionAtLeast old.version "0.27.0") then
              pkgs.llvmPackages_7.llvm
            else if (lib.versionOlder old.version "0.27.0" && lib.versionAtLeast old.version "0.23.0") then
              pkgs.llvmPackages_6.llvm
              pkgs.llvmPackages_6.llvm or throw "LLVM6 has been removed from nixpkgs; upgrade llvmlite or use older nixpkgs"
            else if (lib.versionOlder old.version "0.23.0" && lib.versionAtLeast old.version "0.21.0") then
              pkgs.llvmPackages_5.llvm
              pkgs.llvmPackages_5.llvm or throw "LLVM5 has been removed from nixpkgs; upgrade llvmlite or use older nixpkgs"
            else
              pkgs.llvm; # Likely to fail.
        in
@@ -1516,6 +1521,7 @@ lib.composeManyExtensions [
            "3.8.5" = "sha256-JtUCJ3TP9EKGcddeyW1e/72k21uKneq9SnZJeLvn9Os=";
            "3.8.6" = "sha256-8T//q6nQoZhh8oJWDCeQf3gYRew58dXAaxkYELY4CJM=";
            "3.8.7" = "sha256-JBO8nl0sC+XIn17vI7hC8+nA1HYI9jfvZrl9nCE3k1s=";
            "3.8.8" = "sha256-AK4HtqPKg2O2FeLHCbY9o+N1BV4QFMNaHVE1NaFYHa4=";
          }.${version} or (
            lib.warn "Unknown orjson version: '${version}'. Please update getCargoHash." lib.fakeHash
          );
@@ -2594,6 +2600,7 @@ lib.composeManyExtensions [
        let
          # Watchfiles does not include Cargo.lock in tarball released on PyPi for versions up to 0.17.0
          getRepoHash = version: {
            "0.19.0" = "sha256-NmmeoaIfFMNKCcjH6tPnkpflkN35bKlT76MqF9W8LBc=";
            "0.18.1" = "sha256-XEhu6M1hFi3/gAKZcei7KJSrIhhlZhlvZvbfyA6VLR4=";
            "0.18.0" = "sha256-biGGn0YAUbSO1hCJ4kU0ZWlqlXl/HRrBS3iIA3myRI8=";
            "0.17.0" = "1swpf265h9qq30cx55iy6jjirba3wml16wzb68k527ynrxr7hvqx";
@@ -2858,14 +2865,22 @@ lib.composeManyExtensions [
        '';
      });

      pyyaml-include = super.pyyaml-include.overridePythonAttrs (old: {
        SETUPTOOLS_SCM_PRETEND_VERSION = old.version;
      });

      selinux = super.selinux.overridePythonAttrs (old: {
        buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools-scm-git-archive ];
      });

      setuptools-scm = super.setuptools-scm.overridePythonAttrs (old: {
        setupHook = pkgs.writeText "setuptools-scm-setup-hook.sh" ''
          poetry2nix-setuptools-scm-hook() {
              if [ -z "''${dontPretendSetuptoolsSCMVersion-}" ]; then
                export SETUPTOOLS_SCM_PRETEND_VERSION="$version"
              fi
          }

          preBuildHooks+=(poetry2nix-setuptools-scm-hook)
        '';
      });

      uwsgi = super.uwsgi.overridePythonAttrs
        (old:
          {
+12 −3
Original line number Diff line number Diff line
@@ -19,10 +19,19 @@ let
  toWheelAttrs = str:
    let
      entries' = splitString "-" str;
      el = builtins.length entries';
      entryAt = builtins.elemAt entries';

      # Hack: Remove version "suffixes" like 2.11.4-1
      # Some wheels have build tag with more than one digit
      # like openvino-2022.1.0-7019-cp36-cp36m-manylinux_2_27_x86_64.whl
      entries = builtins.filter (x: builtins.match "[0-9]*" x == null) entries';
      entries =
        if el == 6 then [
          (entryAt 0) # name
          (entryAt 1) # version
          # build tag is skipped
          (entryAt (el - 3)) # python version
          (entryAt (el - 2)) # abi
          (entryAt (el - 1)) # platform
        ] else entries';
      p = removeSuffix ".whl" (builtins.elemAt entries 4);
    in
    {
Loading