mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 19:21:04 +00:00
python311Packages.clip-anytorch: add patch for setuptools
This commit is contained in:
parent
10dc1b23fe
commit
bc2dda1bec
|
@ -2,22 +2,23 @@
|
|||
lib,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
|
||||
# dependencies
|
||||
fetchpatch,
|
||||
ftfy,
|
||||
packaging,
|
||||
pythonOlder,
|
||||
regex,
|
||||
tqdm,
|
||||
setuptools,
|
||||
torch,
|
||||
torchvision,
|
||||
|
||||
# tests
|
||||
pytestCheckHook,
|
||||
tqdm,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "clip-anytorch";
|
||||
version = "2.6.0";
|
||||
format = "setuptools";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.10";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "rom1504";
|
||||
|
@ -26,9 +27,21 @@ buildPythonPackage rec {
|
|||
hash = "sha256-4A8R9aEiOWC05uhMQslhVSkQ4hyjs6VsqkFi76miodY=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
patches = [
|
||||
# Import packaging to be compatible with setuptools==70.0.0, https://github.com/rom1504/CLIP/pull/10
|
||||
(fetchpatch {
|
||||
name = "setuptools-comp.patch";
|
||||
url = "https://github.com/rom1504/CLIP/pull/10/commits/8137d899035d889623f6b0a0a0faae88c549dc50.patch";
|
||||
hash = "sha256-CIcuDk4QH+0g8YEa6TbKGjIcKJQqFviymVH68sKmsyk=";
|
||||
})
|
||||
];
|
||||
|
||||
build-system = [ setuptools ];
|
||||
|
||||
dependencies = [
|
||||
ftfy
|
||||
regex
|
||||
packaging
|
||||
tqdm
|
||||
torch
|
||||
torchvision
|
||||
|
@ -36,15 +49,9 @@ buildPythonPackage rec {
|
|||
|
||||
pythonImportsCheck = [ "clip" ];
|
||||
|
||||
# all tests require network access
|
||||
# All tests require network access
|
||||
doCheck = false;
|
||||
|
||||
nativeCheckInputs = [ pytestCheckHook ];
|
||||
|
||||
preCheck = ''
|
||||
export HOME=$TMPDIR
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Contrastive Language-Image Pretraining";
|
||||
homepage = "https://github.com/rom1504/CLIP";
|
||||
|
|
Loading…
Reference in a new issue