mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 00:12:56 +00:00
Merge pull request #240439 from adisbladis/poetry2nix-1_42_0
poetry2nix: 1.41.0 -> 1.42.0
This commit is contained in:
commit
0e6af000c4
@ -4,7 +4,7 @@
|
||||
}:
|
||||
let
|
||||
# Poetry2nix version
|
||||
version = "1.41.0";
|
||||
version = "1.42.1";
|
||||
|
||||
inherit (poetryLib) isCompatible readTOML normalizePackageName normalizePackageSet;
|
||||
|
||||
@ -17,7 +17,7 @@ let
|
||||
toPluginAble = (import ./plugins.nix { inherit pkgs lib; }).toPluginAble;
|
||||
|
||||
# List of known build systems that are passed through from nixpkgs unmodified
|
||||
knownBuildSystems = lib.importJSON ./known-build-systems.json;
|
||||
knownBuildSystems = builtins.fromJSON (builtins.readFile ./known-build-systems.json);
|
||||
nixpkgsBuildSystems = lib.subtractLists [ "poetry" "poetry-core" ] knownBuildSystems;
|
||||
|
||||
mkInputAttrs =
|
||||
@ -324,6 +324,7 @@ lib.makeScope pkgs.newScope (self: {
|
||||
, editablePackageSources ? { }
|
||||
, extraPackages ? ps: [ ]
|
||||
, groups ? [ "dev" ]
|
||||
, checkGroups ? [ "dev" ]
|
||||
, extras ? [ "*" ]
|
||||
}:
|
||||
let
|
||||
@ -357,7 +358,7 @@ lib.makeScope pkgs.newScope (self: {
|
||||
excludedEditablePackageNames;
|
||||
|
||||
poetryPython = self.mkPoetryPackages {
|
||||
inherit pyproject poetrylock overrides python pwd preferWheels pyProject groups extras;
|
||||
inherit pyproject poetrylock overrides python pwd preferWheels pyProject groups checkGroups extras;
|
||||
editablePackageSources = editablePackageSources';
|
||||
};
|
||||
|
||||
|
@ -78,7 +78,7 @@ response = urllib.request.urlopen(req, context=context)
|
||||
index = response.read()
|
||||
|
||||
parser = Pep503()
|
||||
parser.feed(str(index))
|
||||
parser.feed(str(index, "utf-8"))
|
||||
if package_filename not in parser.sources:
|
||||
print(
|
||||
"The file %s has not be found in the index %s" % (package_filename, index_url)
|
||||
|
@ -161,6 +161,7 @@ let
|
||||
outputHashAlgo = "sha256";
|
||||
outputHash = hash;
|
||||
NETRC = netrc_file;
|
||||
passthru.isWheel = lib.strings.hasSuffix "whl" file;
|
||||
} ''
|
||||
python ${./fetch_from_legacy.py} ${url} ${pname} ${file}
|
||||
mv ${file} $out
|
||||
|
@ -174,14 +174,16 @@ 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");
|
||||
} // (
|
||||
lib.optionalAttrs ((sourceSpec ? rev) && (lib.versionAtLeast builtins.nixVersion "2.4")) {
|
||||
allRefs = true;
|
||||
}
|
||||
))
|
||||
}) // (
|
||||
lib.optionalAttrs (lib.versionAtLeast builtins.nixVersion "2.4") {
|
||||
submodules = true;
|
||||
})
|
||||
)
|
||||
)
|
||||
else if isWheelUrl then
|
||||
builtins.fetchurl
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -76,7 +76,7 @@ lib.composeManyExtensions [
|
||||
(drv: attr: addBuildSystem {
|
||||
inherit drv self attr;
|
||||
})
|
||||
super.${attr}
|
||||
(super.${attr} or null)
|
||||
systems)
|
||||
buildSystems)
|
||||
|
||||
@ -211,8 +211,7 @@ lib.composeManyExtensions [
|
||||
[ pkgs.darwin.apple_sdk.frameworks.Security pkgs.libiconv ];
|
||||
nativeBuildInputs = with pkgs;
|
||||
(old.nativeBuildInputs or [ ])
|
||||
++ lib.optionals (lib.versionAtLeast old.version "4")
|
||||
[ rustc cargo rustPlatform.cargoSetupHook self.setuptools-rust ];
|
||||
++ lib.optionals (lib.versionAtLeast old.version "4") [ rustc cargo pkgs.rustPlatform.cargoSetupHook self.setuptools-rust ];
|
||||
} // lib.optionalAttrs (lib.versionAtLeast old.version "4") {
|
||||
cargoDeps =
|
||||
pkgs.rustPlatform.fetchCargoTarball
|
||||
@ -384,6 +383,8 @@ lib.composeManyExtensions [
|
||||
"39.0.2" = "sha256-Admz48/GS2t8diz611Ciin1HKQEyMDEwHxTpJ5tZ1ZA=";
|
||||
"40.0.0" = "sha256-/TBANavYria9YrBpMgjtFyqg5feBcloETcYJ8fdBgkI=";
|
||||
"40.0.1" = "sha256-gFfDTc2QWBWHBCycVH1dYlCsWQMVcRZfOBIau+njtDU=";
|
||||
"40.0.2" = "sha256-cV4GTfbVYanElXOVmynvrru2wJuWvnT1Z1tQKXdkbg0=";
|
||||
"41.0.1" = "sha256-38q81vRf8QHR8lFRM2KbH7Ng5nY7nmtWRMoPWS9VO/U=";
|
||||
}.${version} or (
|
||||
lib.warn "Unknown cryptography version: '${version}'. Please update getCargoHash." lib.fakeHash
|
||||
);
|
||||
@ -401,8 +402,7 @@ lib.composeManyExtensions [
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ])
|
||||
++ 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 cargo rustc ])
|
||||
++ lib.optional (lib.versionAtLeast old.version "3.5" && !isWheel) [ pkgs.rustPlatform.cargoSetupHook pkgs.cargo pkgs.rustc ]
|
||||
++ [ pkg-config ]
|
||||
;
|
||||
buildInputs = (old.buildInputs or [ ])
|
||||
@ -431,6 +431,11 @@ lib.composeManyExtensions [
|
||||
'';
|
||||
});
|
||||
|
||||
cysystemd = super.cysystemd.overridePythonAttrs (old: {
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.systemd ];
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.pkg-config ];
|
||||
});
|
||||
|
||||
daphne = super.daphne.overridePythonAttrs (old: {
|
||||
postPatch = ''
|
||||
substituteInPlace setup.py --replace 'setup_requires=["pytest-runner"],' ""
|
||||
@ -580,6 +585,8 @@ lib.composeManyExtensions [
|
||||
|
||||
duckdb = super.duckdb.overridePythonAttrs (old: {
|
||||
postPatch = lib.optionalString (!(old.src.isWheel or false)) ''
|
||||
cd tools/pythonpkg
|
||||
|
||||
substituteInPlace setup.py \
|
||||
--replace 'multiprocessing.cpu_count()' "$NIX_BUILD_CORES" \
|
||||
--replace 'setuptools_scm<7.0.0' 'setuptools_scm'
|
||||
@ -595,11 +602,13 @@ lib.composeManyExtensions [
|
||||
'';
|
||||
};
|
||||
|
||||
eth-keyfile = super.eth-keyfile.overridePythonAttrs {
|
||||
eth-keyfile = super.eth-keyfile.overridePythonAttrs (old: {
|
||||
preConfigure = ''
|
||||
substituteInPlace setup.py --replace \'setuptools-markdown\' ""
|
||||
'';
|
||||
};
|
||||
|
||||
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ];
|
||||
});
|
||||
|
||||
eth-keys = super.eth-keys.overridePythonAttrs {
|
||||
preConfigure = ''
|
||||
@ -607,15 +616,8 @@ lib.composeManyExtensions [
|
||||
'';
|
||||
};
|
||||
|
||||
# remove eth-hash dependency because eth-hash also depends on eth-utils causing a cycle.
|
||||
eth-utils = super.eth-utils.overridePythonAttrs (old: {
|
||||
propagatedBuildInputs =
|
||||
builtins.filter (i: i.pname != "eth-hash") old.propagatedBuildInputs;
|
||||
preConfigure = ''
|
||||
${old.preConfigure or ""}
|
||||
sed -i '/eth-hash/d' setup.py
|
||||
'';
|
||||
});
|
||||
# FIXME: this is a workaround for https://github.com/nix-community/poetry2nix/issues/1161
|
||||
eth-utils = super.eth-utils.override { preferWheel = true; };
|
||||
|
||||
evdev = super.evdev.overridePythonAttrs (old: {
|
||||
preConfigure = ''
|
||||
@ -984,14 +986,21 @@ lib.composeManyExtensions [
|
||||
];
|
||||
});
|
||||
|
||||
jsondiff = super.jsondiff.overridePythonAttrs (
|
||||
old: {
|
||||
preBuild = (old.preBuild or "") + ''
|
||||
substituteInPlace setup.py \
|
||||
--replace "'jsondiff=jsondiff.cli:main_deprecated'," ""
|
||||
'';
|
||||
}
|
||||
);
|
||||
jsondiff =
|
||||
if lib.versionOlder "2.0.0"
|
||||
then
|
||||
super.jsondiff.overridePythonAttrs
|
||||
(
|
||||
old: {
|
||||
preBuild = lib.optionalString (!(old.src.isWheel or false)) (
|
||||
(old.preBuild or "") + ''
|
||||
substituteInPlace setup.py \
|
||||
--replace "'jsondiff=jsondiff.cli:main_deprecated'," ""
|
||||
''
|
||||
);
|
||||
}
|
||||
)
|
||||
else super.jsondiff;
|
||||
|
||||
jsonslicer = super.jsonslicer.overridePythonAttrs (old: {
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.pkgconfig ];
|
||||
@ -1085,29 +1094,38 @@ lib.composeManyExtensions [
|
||||
}
|
||||
);
|
||||
|
||||
llama-cpp-python = super.llama-cpp-python.overridePythonAttrs (
|
||||
old: {
|
||||
buildInputs = with pkgs; lib.optionals stdenv.isDarwin [
|
||||
darwin.apple_sdk.frameworks.Accelerate
|
||||
];
|
||||
nativeBuildInputs = [ pkgs.cmake ] ++ (old.nativeBuildInputs or [ ]);
|
||||
preBuild = ''
|
||||
cd "$OLDPWD"
|
||||
'';
|
||||
}
|
||||
);
|
||||
|
||||
llvmlite = super.llvmlite.overridePythonAttrs (
|
||||
old:
|
||||
let
|
||||
llvm =
|
||||
if lib.versionAtLeast old.version "0.37.0" then
|
||||
pkgs.llvmPackages_11.llvm
|
||||
else if (lib.versionOlder old.version "0.37.0" && lib.versionAtLeast old.version "0.34.0") then
|
||||
pkgs.llvmPackages_10.llvm
|
||||
else if (lib.versionOlder old.version "0.34.0" && lib.versionAtLeast old.version "0.33.0") then
|
||||
pkgs.llvmPackages_9.llvm
|
||||
else if (lib.versionOlder old.version "0.33.0" && lib.versionAtLeast old.version "0.29.0") then
|
||||
pkgs.llvmPackages_8.llvm
|
||||
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 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 or throw "LLVM5 has been removed from nixpkgs; upgrade llvmlite or use older nixpkgs"
|
||||
else
|
||||
pkgs.llvm; # Likely to fail.
|
||||
# see https://github.com/numba/llvmlite#compatibility
|
||||
llvm_version = toString (
|
||||
if lib.versionAtLeast old.version "0.40.0" then 14
|
||||
else if lib.versionAtLeast old.version "0.37.0" then 11
|
||||
else if lib.versionAtLeast old.version "0.34.0" && !stdenv.buildPlatform.isAarch64 then 10
|
||||
else if lib.versionAtLeast old.version "0.33.0" then 9
|
||||
else if lib.versionAtLeast old.version "0.29.0" then 8
|
||||
else if lib.versionAtLeast old.version "0.27.0" then 7
|
||||
else if lib.versionAtLeast old.version "0.23.0" then 6
|
||||
else if lib.versionAtLeast old.version "0.21.0" then 5
|
||||
else 4
|
||||
);
|
||||
llvm = pkgs."llvmPackages_${llvm_version}".llvm or (throw "LLVM${llvm_version} has been removed from nixpkgs; upgrade llvmlite or use older nixpkgs");
|
||||
in
|
||||
{
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.llvm ];
|
||||
inherit llvm;
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.llvmlite.llvm ];
|
||||
|
||||
# Disable static linking
|
||||
# https://github.com/numba/llvmlite/issues/93
|
||||
@ -1146,6 +1164,17 @@ lib.composeManyExtensions [
|
||||
}
|
||||
);
|
||||
|
||||
markdown-it-py = super.markdown-it-py.overridePythonAttrs (
|
||||
old: {
|
||||
propagatedBuildInputs = builtins.filter (i: i.pname != "mdit-py-plugins") old.propagatedBuildInputs;
|
||||
preConfigure = lib.optionalString (!(old.src.isWheel or false)) (
|
||||
(old.preConfigure or "") + ''
|
||||
substituteInPlace pyproject.toml --replace 'plugins = ["mdit-py-plugins"]' 'plugins = []'
|
||||
''
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
markupsafe = super.markupsafe.overridePythonAttrs (
|
||||
old: {
|
||||
src = old.src.override { pname = builtins.replaceStrings [ "markupsafe" ] [ "MarkupSafe" ] old.pname; };
|
||||
@ -1285,6 +1314,14 @@ lib.composeManyExtensions [
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools self.setuptools-scm self.setuptools-scm-git-archive ];
|
||||
});
|
||||
|
||||
munch = super.munch.overridePythonAttrs (
|
||||
old: {
|
||||
# Latest version of pypi imports pkg_resources at runtime, so setuptools is needed at runtime. :(
|
||||
# They fixed this last year but never released a new version.
|
||||
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ];
|
||||
}
|
||||
);
|
||||
|
||||
mpi4py = super.mpi4py.overridePythonAttrs (
|
||||
old:
|
||||
let
|
||||
@ -1317,22 +1354,30 @@ lib.composeManyExtensions [
|
||||
);
|
||||
|
||||
mypy = super.mypy.overridePythonAttrs (
|
||||
old: {
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [
|
||||
self.types-typed-ast
|
||||
self.types-setuptools
|
||||
]
|
||||
++ lib.optional (lib.strings.versionAtLeast old.version "0.990") self.types-psutil
|
||||
;
|
||||
old:
|
||||
let
|
||||
# Compile mypy with mypyc, which makes mypy about 4 times faster. The compiled
|
||||
# version is also the default in the wheels on Pypi that include binaries.
|
||||
# is64bit: unfortunately the build would exhaust all possible memory on i686-linux.
|
||||
MYPY_USE_MYPYC = stdenv.buildPlatform.is64bit;
|
||||
|
||||
envAttrs =
|
||||
if old ? env
|
||||
then { env = old.env // { inherit MYPY_USE_MYPYC; }; }
|
||||
else { inherit MYPY_USE_MYPYC; };
|
||||
in
|
||||
{
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [
|
||||
self.types-typed-ast
|
||||
self.types-setuptools
|
||||
]
|
||||
++ lib.optional (lib.strings.versionAtLeast old.version "0.990") self.types-psutil
|
||||
;
|
||||
|
||||
# when testing reduce optimisation level to drastically reduce build time
|
||||
# (default is 3)
|
||||
# MYPYC_OPT_LEVEL = 1;
|
||||
} // lib.optionalAttrs (old.format != "wheel") {
|
||||
} // envAttrs // lib.optionalAttrs (old.format != "wheel") {
|
||||
# FIXME: Remove patch after upstream has decided the proper solution.
|
||||
# https://github.com/python/mypy/pull/11143
|
||||
patches = (old.patches or [ ]) ++ lib.optionals ((lib.strings.versionAtLeast old.version "0.900") && lib.strings.versionOlder old.version "0.940") [
|
||||
@ -1421,6 +1466,37 @@ lib.composeManyExtensions [
|
||||
}
|
||||
);
|
||||
|
||||
# The following are dependencies of torch >= 2.0.0.
|
||||
# torch doesn't officially support system CUDA, unless you build it yourself.
|
||||
nvidia-cudnn-cu11 = super.nvidia-cudnn-cu11.overridePythonAttrs (attrs: {
|
||||
autoPatchelfIgnoreMissingDeps = true;
|
||||
# (Bytecode collision happens with nvidia-cuda-nvrtc-cu11.)
|
||||
postFixup = ''
|
||||
rm -r $out/${self.python.sitePackages}/nvidia/{__pycache__,__init__.py}
|
||||
'';
|
||||
propagatedBuildInputs = attrs.propagatedBuildInputs or [ ] ++ [
|
||||
self.nvidia-cublas-cu11
|
||||
];
|
||||
});
|
||||
|
||||
nvidia-cuda-nvrtc-cu11 = super.nvidia-cuda-nvrtc-cu11.overridePythonAttrs (_: {
|
||||
# (Bytecode collision happens with nvidia-cudnn-cu11.)
|
||||
postFixup = ''
|
||||
rm -r $out/${self.python.sitePackages}/nvidia/{__pycache__,__init__.py}
|
||||
'';
|
||||
});
|
||||
|
||||
nvidia-cusolver-cu11 = super.nvidia-cusolver-cu11.overridePythonAttrs (attrs: {
|
||||
autoPatchelfIgnoreMissingDeps = true;
|
||||
# (Bytecode collision happens with nvidia-cusolver-cu11.)
|
||||
postFixup = ''
|
||||
rm -r $out/${self.python.sitePackages}/nvidia/{__pycache__,__init__.py}
|
||||
'';
|
||||
propagatedBuildInputs = attrs.propagatedBuildInputs or [ ] ++ [
|
||||
self.nvidia-cublas-cu11
|
||||
];
|
||||
});
|
||||
|
||||
omegaconf = super.omegaconf.overridePythonAttrs (
|
||||
old: {
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.jdk ];
|
||||
@ -1473,6 +1549,7 @@ lib.composeManyExtensions [
|
||||
buildInputs = [
|
||||
self.scikit-build
|
||||
] ++ lib.optionals stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
|
||||
Accelerate
|
||||
AVFoundation
|
||||
Cocoa
|
||||
CoreMedia
|
||||
@ -1522,11 +1599,12 @@ lib.composeManyExtensions [
|
||||
"3.8.6" = "sha256-8T//q6nQoZhh8oJWDCeQf3gYRew58dXAaxkYELY4CJM=";
|
||||
"3.8.7" = "sha256-JBO8nl0sC+XIn17vI7hC8+nA1HYI9jfvZrl9nCE3k1s=";
|
||||
"3.8.8" = "sha256-AK4HtqPKg2O2FeLHCbY9o+N1BV4QFMNaHVE1NaFYHa4=";
|
||||
"3.8.10" = "sha256-AcrTEHv7GYtGe4fXYsM24ElrzfhnOxLYlaon1ZrlD4A=";
|
||||
}.${version} or (
|
||||
lib.warn "Unknown orjson version: '${version}'. Please update getCargoHash." lib.fakeHash
|
||||
);
|
||||
in
|
||||
super.orjson.overridePythonAttrs (old: {
|
||||
super.orjson.overridePythonAttrs (old: if old.src.isWheel or false then { } else {
|
||||
cargoDeps = pkgs.rustPlatform.fetchCargoTarball {
|
||||
inherit (old) src;
|
||||
name = "${old.pname}-${old.version}";
|
||||
@ -1576,6 +1654,10 @@ lib.composeManyExtensions [
|
||||
'';
|
||||
});
|
||||
|
||||
pao = super.pao.overridePythonAttrs (old: {
|
||||
propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [ self.pyutilib ];
|
||||
});
|
||||
|
||||
paramiko = super.paramiko.overridePythonAttrs (old: {
|
||||
doCheck = false; # requires networking
|
||||
});
|
||||
@ -1754,6 +1836,10 @@ lib.composeManyExtensions [
|
||||
pkgs.cmake
|
||||
];
|
||||
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [
|
||||
_arrow-cpp
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
export PYARROW_PARALLEL=$NIX_BUILD_CORES
|
||||
'';
|
||||
@ -1901,6 +1987,10 @@ lib.composeManyExtensions [
|
||||
}
|
||||
);
|
||||
|
||||
pynetbox = super.pynetbox.overridePythonAttrs (old: {
|
||||
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ];
|
||||
});
|
||||
|
||||
pynput = super.pynput.overridePythonAttrs (old: {
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ])
|
||||
++ [ self.sphinx ];
|
||||
@ -2007,6 +2097,7 @@ lib.composeManyExtensions [
|
||||
'';
|
||||
});
|
||||
|
||||
|
||||
pytoml = super.pytoml.overridePythonAttrs (
|
||||
old: {
|
||||
doCheck = false;
|
||||
@ -2148,6 +2239,16 @@ lib.composeManyExtensions [
|
||||
}
|
||||
);
|
||||
|
||||
python-pam = super.python-pam.overridePythonAttrs (
|
||||
old: {
|
||||
postPatch = ''
|
||||
substituteInPlace src/pam/__internals.py \
|
||||
--replace 'find_library("pam")' '"${pkgs.pam}/lib/libpam.so"' \
|
||||
--replace 'find_library("pam_misc")' '"${pkgs.pam}/lib/libpam_misc.so"'
|
||||
'';
|
||||
}
|
||||
);
|
||||
|
||||
python-snappy = super.python-snappy.overridePythonAttrs (
|
||||
old: {
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.snappy ];
|
||||
@ -2492,61 +2593,33 @@ lib.composeManyExtensions [
|
||||
preferWheel = true;
|
||||
};
|
||||
|
||||
torch = lib.makeOverridable
|
||||
({ enableCuda ? false
|
||||
, cudatoolkit ? pkgs.cudatoolkit_10_1
|
||||
, pkg ? super.torch
|
||||
}: pkg.overrideAttrs (old:
|
||||
{
|
||||
preConfigure =
|
||||
if (!enableCuda) then ''
|
||||
export USE_CUDA=0
|
||||
'' else ''
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${cudatoolkit}/targets/x86_64-linux/lib"
|
||||
'';
|
||||
preFixup = lib.optionalString (!enableCuda) ''
|
||||
# For some reason pytorch retains a reference to libcuda even if it
|
||||
# is explicitly disabled with USE_CUDA=0.
|
||||
find $out -name "*.so" -exec ${pkgs.patchelf}/bin/patchelf --remove-needed libcuda.so.1 {} \;
|
||||
'';
|
||||
buildInputs =
|
||||
(old.buildInputs or [ ])
|
||||
++ [ self.typing-extensions ]
|
||||
++ lib.optionals enableCuda [
|
||||
pkgs.linuxPackages.nvidia_x11
|
||||
pkgs.nccl.dev
|
||||
pkgs.nccl.out
|
||||
];
|
||||
propagatedBuildInputs = [
|
||||
self.numpy
|
||||
self.future
|
||||
self.typing-extensions
|
||||
];
|
||||
})
|
||||
)
|
||||
{ };
|
||||
torch = super.torch.overridePythonAttrs (old: {
|
||||
# torch has an auto-magical way to locate the cuda libraries from site-packages.
|
||||
autoPatchelfIgnoreMissingDeps = true;
|
||||
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [
|
||||
self.numpy
|
||||
];
|
||||
});
|
||||
|
||||
torchvision = lib.makeOverridable
|
||||
({ enableCuda ? false
|
||||
, cudatoolkit ? pkgs.cudatoolkit_10_1
|
||||
, pkg ? super.torchvision
|
||||
}: pkg.overrideAttrs (old: {
|
||||
torchvision = super.torchvision.overridePythonAttrs (old: {
|
||||
autoPatchelfIgnoreMissingDeps = true;
|
||||
|
||||
# without that autoPatchelfHook will fail because cudatoolkit is not in LD_LIBRARY_PATH
|
||||
autoPatchelfIgnoreMissingDeps = true;
|
||||
buildInputs = (old.buildInputs or [ ])
|
||||
++ [ self.torch ]
|
||||
++ lib.optionals enableCuda [
|
||||
cudatoolkit
|
||||
];
|
||||
preConfigure =
|
||||
if (enableCuda) then ''
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${self.torch}/${self.python.sitePackages}/torch/lib:${lib.makeLibraryPath [ cudatoolkit "${cudatoolkit}" ]}"
|
||||
'' else ''
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${self.torch}/${self.python.sitePackages}/torch/lib"
|
||||
'';
|
||||
}))
|
||||
{ };
|
||||
# (no patchelf on darwin, since no elves there.)
|
||||
preFixup = lib.optionals (!stdenv.isDarwin) ''
|
||||
addAutoPatchelfSearchPath "${self.torch}/${self.python.sitePackages}/torch/lib"
|
||||
'';
|
||||
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [
|
||||
self.torch
|
||||
];
|
||||
});
|
||||
|
||||
# Circular dependency between triton and torch (see https://github.com/openai/triton/issues/1374)
|
||||
# You can remove this once triton publishes a new stable build and torch takes it.
|
||||
triton = super.triton.overridePythonAttrs (old: {
|
||||
propagatedBuildInputs = builtins.filter (e: e.pname != "torch") old.propagatedBuildInputs;
|
||||
pipInstallFlags = [ "--no-deps" ];
|
||||
});
|
||||
|
||||
typed_ast = super.typed-ast.overridePythonAttrs (old: {
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
|
||||
@ -2959,6 +3032,11 @@ lib.composeManyExtensions [
|
||||
}
|
||||
);
|
||||
|
||||
flake8-mutable = super.flake8-mutable.overridePythonAttrs
|
||||
(old: { buildInputs = old.buildInputs or [ ] ++ [ self.pytest-runner ]; });
|
||||
pydantic = super.pydantic.overridePythonAttrs
|
||||
(old: { buildInputs = old.buildInputs or [ ] ++ [ pkgs.libxcrypt ]; });
|
||||
|
||||
y-py = super.y-py.override {
|
||||
preferWheel = true;
|
||||
};
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "poetry"
|
||||
version = "1.4.2"
|
||||
version = "1.3.2"
|
||||
description = "Python dependency management and packaging made easy."
|
||||
authors = [
|
||||
"Sébastien Eustace <sebastien@eustace.io>",
|
||||
@ -47,27 +47,23 @@ generate-setup-file = false
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.7"
|
||||
|
||||
poetry-core = "1.5.2"
|
||||
poetry-plugin-export = "^1.3.0"
|
||||
poetry-core = "1.4.0"
|
||||
poetry-plugin-export = "^1.2.0"
|
||||
"backports.cached-property" = { version = "^1.0.2", python = "<3.8" }
|
||||
build = "^0.10.0"
|
||||
cachecontrol = { version = "^0.12.9", extras = ["filecache"] }
|
||||
cleo = "^2.0.0"
|
||||
crashtest = "^0.4.1"
|
||||
dulwich = "^0.21.2"
|
||||
dulwich = "^0.20.46"
|
||||
filelock = "^3.8.0"
|
||||
html5lib = "^1.0"
|
||||
importlib-metadata = { version = ">=4.4", python = "<3.10" }
|
||||
installer = "^0.7.0"
|
||||
importlib-metadata = { version = "^4.4", python = "<3.10" }
|
||||
jsonschema = "^4.10.0"
|
||||
keyring = "^23.9.0"
|
||||
lockfile = "^0.12.2"
|
||||
# packaging uses calver, so version is unclamped
|
||||
packaging = ">=20.4"
|
||||
pexpect = "^4.7.0"
|
||||
pkginfo = "^1.9.4"
|
||||
pkginfo = "^1.5"
|
||||
platformdirs = "^2.5.2"
|
||||
pyproject-hooks = "^1.0.0"
|
||||
requests = "^2.18"
|
||||
requests-toolbelt = ">=0.9.1,<0.11.0"
|
||||
shellingham = "^1.5"
|
||||
@ -78,9 +74,9 @@ tomlkit = ">=0.11.1,<1.0.0,!=0.11.2,!=0.11.3"
|
||||
trove-classifiers = ">=2022.5.19"
|
||||
# exclude 20.4.5 - 20.4.6 due to https://github.com/pypa/pip/issues/9953
|
||||
virtualenv = [
|
||||
{ version = "^20.4.3,!=20.4.5,!=20.4.6" },
|
||||
{ version = "^20.4.3,!=20.4.5,!=20.4.6", markers = "sys_platform != 'win32' or python_version != '3.9'" },
|
||||
# see https://github.com/python-poetry/poetry/pull/6950 for details
|
||||
{ version = "<20.16.6", markers = "sys_platform == 'win32' and python_version == '3.9'" },
|
||||
{ version = "^20.4.3,!=20.4.5,!=20.4.6,<20.16.6", markers = "sys_platform == 'win32' and python_version == '3.9'" },
|
||||
]
|
||||
xattr = { version = "^0.10.0", markers = "sys_platform == 'darwin'" }
|
||||
urllib3 = "^1.26.0"
|
||||
@ -91,22 +87,18 @@ pre-commit = "^2.6"
|
||||
[tool.poetry.group.test.dependencies]
|
||||
# Cachy frozen to test backwards compatibility for `poetry.utils.cache`.
|
||||
cachy = "0.3.0"
|
||||
deepdiff = [
|
||||
{ version = "^6.2" },
|
||||
# avoid orjson, which is required by deepdiff 6.2.3, on FreeBSD
|
||||
# because it requires a rust compiler
|
||||
{ version = "<6.2.3", markers = "platform_system == 'FreeBSD'"},
|
||||
]
|
||||
deepdiff = "^5.0"
|
||||
flatdict = "^4.0.1"
|
||||
httpretty = "^1.0"
|
||||
pytest = "^7.1"
|
||||
pytest-cov = "^4.0"
|
||||
pytest-mock = "^3.9"
|
||||
pytest-randomly = "^3.12"
|
||||
pytest-xdist = { version = "^3.1", extras = ["psutil"] }
|
||||
pytest-xdist = { version = "^2.5", extras = ["psutil"] }
|
||||
zipp = { version = "^3.4", python = "<3.8" }
|
||||
|
||||
[tool.poetry.group.typing.dependencies]
|
||||
mypy = ">=1.0"
|
||||
mypy = ">=0.990"
|
||||
types-html5lib = ">=1.1.9"
|
||||
types-jsonschema = ">=4.9.0"
|
||||
types-requests = ">=2.28.8"
|
||||
@ -169,22 +161,25 @@ enable_error_code = [
|
||||
# warning.
|
||||
[[tool.mypy.overrides]]
|
||||
module = [
|
||||
'poetry.console.commands.self.show.plugins',
|
||||
'poetry.plugins.plugin_manager',
|
||||
'poetry.repositories.installed_repository',
|
||||
'poetry.utils.env',
|
||||
'poetry.console.commands.self.show.plugins',
|
||||
'poetry.installation.executor',
|
||||
'poetry.mixology.version_solver',
|
||||
'poetry.plugins.plugin_manager',
|
||||
'poetry.repositories.installed_repository',
|
||||
'poetry.utils.env',
|
||||
]
|
||||
warn_unused_ignores = false
|
||||
|
||||
[[tool.mypy.overrides]]
|
||||
module = [
|
||||
'cachecontrol.*',
|
||||
'lockfile.*',
|
||||
'pexpect.*',
|
||||
'requests_toolbelt.*',
|
||||
'shellingham.*',
|
||||
'virtualenv.*',
|
||||
'xattr.*',
|
||||
'cachecontrol.*',
|
||||
'lockfile.*',
|
||||
'pexpect.*',
|
||||
'pkginfo.*',
|
||||
'requests_toolbelt.*',
|
||||
'shellingham.*',
|
||||
'virtualenv.*',
|
||||
'xattr.*',
|
||||
]
|
||||
ignore_missing_imports = true
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"owner": "python-poetry",
|
||||
"repo": "poetry",
|
||||
"rev": "1.4.2",
|
||||
"sha256": "0n3fjgn6lcsqld83ljr6wca107cpnq9xbqrwi5kwvy1rj0am0902",
|
||||
"rev": "1.3.0",
|
||||
"sha256": "16ng59ykm7zkjizmwb482y0hawpjjr5mvl0ahjd790xzxcc2bbbv",
|
||||
"fetchSubmodules": true
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user