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

[Backport release-22.11] poetry2nix: 1.38.0 -> 1.39.1 #206127

Merged
merged 1 commit into from
Jan 1, 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
2 changes: 1 addition & 1 deletion pkgs/development/tools/poetry2nix/poetry2nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
}:
let
# Poetry2nix version
version = "1.38.0";
version = "1.39.1";

inherit (poetryLib) isCompatible readTOML normalizePackageName normalizePackageSet;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ pythonPackages.callPackage
(
builtins.fetchGit ({
inherit (source) url;
submodules = true;
rev = source.resolved_reference or source.reference;
ref = sourceSpec.branch or (if sourceSpec ? tag then "refs/tags/${sourceSpec.tag}" else "HEAD");
} // (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2938,6 +2938,9 @@
"cometblue-lite": [
"setuptools"
],
"comm": [
"hatchling"
],
"commandparse": [
"setuptools"
],
Expand Down Expand Up @@ -9892,7 +9895,8 @@
"setuptools"
],
"packaging": [
"setuptools"
"setuptools",
"flit-core"
],
"packbits": [
"setuptools"
Expand Down Expand Up @@ -14254,7 +14258,9 @@
"setuptools"
],
"rapidfuzz": [
"setuptools"
"setuptools",
"packaging",
"scikit-build"
],
"rapidfuzz-capi": [
"setuptools"
Expand Down Expand Up @@ -14949,7 +14955,8 @@
"setuptools-scm"
],
"scikit-image": [
"cython"
"cython",
"setuptools"
],
"scikit-learn": [
"cython",
Expand Down Expand Up @@ -16893,6 +16900,9 @@
"trimesh": [
"setuptools"
],
"trino": [
"setuptools"
],
"trio": [
"setuptools"
],
Expand All @@ -16905,6 +16915,10 @@
"troposphere": [
"setuptools"
],
"trove-classifiers": [
"setuptools",
"calver"
],
"trueskill": [
"setuptools"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ lib.composeManyExtensions [
scrypto =
if isWheel then
(
super.cryptography.override { preferWheel = true; }
super.cryptography.overridePythonAttrs { preferWheel = true; }
) else super.cryptography;
in
scrypto.overridePythonAttrs
Expand Down Expand Up @@ -1324,9 +1324,10 @@ lib.composeManyExtensions [
open3d = super.open3d.overridePythonAttrs (old: {
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.ipywidgets ];
buildInputs = (old.buildInputs or [ ]) ++ [
pkgs.udev
pkgs.libusb1
] ++ (if lib.versionAtLeast super.open3d.version "0.16.0" then [
] ++ lib.optionals stdenv.isLinux [
pkgs.udev
] ++ lib.optionals (lib.versionAtLeast super.open3d.version "0.16.0") [
pkgs.mesa
(
pkgs.symlinkJoin {
Expand All @@ -1341,29 +1342,43 @@ lib.composeManyExtensions [
)
];
})
] else [ ]);
];

# Patch the dylib in the binary distribution to point to the nix build of libomp
preFixup = lib.optionalString (stdenv.isDarwin && lib.versionAtLeast super.open3d.version "0.16.0") ''
install_name_tool -change /opt/homebrew/opt/libomp/lib/libomp.dylib ${pkgs.llvmPackages.openmp}/lib/libomp.dylib $out/lib/python*/site-packages/open3d/cpu/pybind.cpython-*-darwin.so
'';

# TODO(Sem Mulder): Add overridable flags for CUDA/PyTorch/Tensorflow support.
autoPatchelfIgnoreMissingDeps = true;
});

# Overrides for building packages based on OpenCV
# These flags are inspired by the opencv 4.x package in nixpkgs
_opencv-python-override =
old: {
# Disable OpenCL on macOS
# Can't use cmakeFlags because cmake is called by setup.py
CMAKE_ARGS = lib.optionalString stdenv.isDarwin "-DWITH_OPENCL=OFF";

nativeBuildInputs = [ pkgs.cmake ] ++ old.nativeBuildInputs;
buildInputs = [ self.scikit-build ] ++ (old.buildInputs or [ ]);
buildInputs = [
self.scikit-build
] ++ lib.optionals stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
AVFoundation
Cocoa
CoreMedia
MediaToolbox
VideoDecodeAcceleration
]) ++ (old.buildInputs or [ ]);
dontUseCmakeConfigure = true;
};

opencv-python = super.opencv-python.overridePythonAttrs self._opencv-python-override;

opencv-python-headless = super.opencv-python.overridePythonAttrs self._opencv-python-override;

opencv-contrib-python = super.opencv-contrib-python.overridePythonAttrs (
old: {
nativeBuildInputs = [ pkgs.cmake ] ++ old.nativeBuildInputs;
buildInputs = [ self.scikit-build ] ++ (old.buildInputs or [ ]);
dontUseCmakeConfigure = true;
}
);
opencv-contrib-python = super.opencv-contrib-python.overridePythonAttrs self._opencv-python-override;

openexr = super.openexr.overridePythonAttrs (
old: {
Expand Down Expand Up @@ -1775,6 +1790,13 @@ lib.composeManyExtensions [
++ [ pkgs.freetds ];
});

pyopencl = super.pyopencl.overridePythonAttrs (
old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.numpy ];
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ pkgs.ocl-icd pkgs.opencl-headers ];
}
);

pyopenssl = super.pyopenssl.overridePythonAttrs (
old: {
buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.openssl ];
Expand Down Expand Up @@ -2705,6 +2727,10 @@ lib.composeManyExtensions [
'if True:'
'';
});

mkdocs = super.mkdocs.overridePythonAttrs (old: {
propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [ self.babel ];
});
}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,5 @@ poetry2nix.mkPoetryApplication {
meta = with lib; {
inherit (python.meta) platforms;
maintainers = with maintainers; [ adisbladis jakewaksbaum ];
knownVulnerabilities = [
"CVE-2022-42966" # cleo version in poetry.lock is vulnerable
];
};
}
Loading