From ac4b1a91b0ad526ae478a815b599d208cc1eeb15 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Sun, 28 Jan 2024 09:23:32 +0000 Subject: automatic import of torchvision --- .gitignore | 1 + 0001-fix-error-in-build.patch | 32 +++++++++++++++++++++++ sources | 1 + torchvision.spec | 59 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 93 insertions(+) create mode 100644 0001-fix-error-in-build.patch create mode 100644 sources create mode 100644 torchvision.spec diff --git a/.gitignore b/.gitignore index e69de29..28a4dc4 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/v0.16.2.zip diff --git a/0001-fix-error-in-build.patch b/0001-fix-error-in-build.patch new file mode 100644 index 0000000..786fed5 --- /dev/null +++ b/0001-fix-error-in-build.patch @@ -0,0 +1,32 @@ +From 94c517ab4a3c5a6331b0cd54c4c5489bda6f22c8 Mon Sep 17 00:00:00 2001 +From: binsz <274620705z@gmail.com> +Date: Sun, 28 Jan 2024 17:13:33 +0800 +Subject: [PATCH] Specify Excluded Pillow Versions + +Signed-off-by: binsz <274620705z@gmail.com> + +This commit explicitly specifies the versions of Pillow that should +be excluded due to the issue described in https://github.com/pytorch/vision/issues/4934. +Previously, all 8.3.* versions were excluded, but this commit updates the exclusion to specifically list versions 8.3.0, 8.3.1, and 8.3.2. +This change fix the error in build `Illegal char '*' (0x2a) in: 8.3.*` + +--- + setup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index ce67413..6b376c2 100644 +--- a/setup.py ++++ b/setup.py +@@ -64,7 +64,7 @@ requirements = [ + ] + + # Excluding 8.3.* because of https://github.com/pytorch/vision/issues/4934 +-pillow_ver = " >= 5.3.0, !=8.3.*" ++pillow_ver = " >= 5.3.0, !=8.3.0, !=8.3.1, !=8.3.2" + pillow_req = "pillow-simd" if get_dist("pillow-simd") is not None else "pillow" + requirements.append(pillow_req + pillow_ver) + +-- +2.41.0 + diff --git a/sources b/sources new file mode 100644 index 0000000..9261164 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +ab2050b894fa0226489c7665c6bcf4b2 v0.16.2.zip diff --git a/torchvision.spec b/torchvision.spec new file mode 100644 index 0000000..cf72dd3 --- /dev/null +++ b/torchvision.spec @@ -0,0 +1,59 @@ +%global _empty_manifest_terminate_build 0 +Name: torchvision +Version: 0.16.2 +Release: 1 +Summary: Datasets, Transforms and Models specific to Computer Vision +License: BSD-3-Clause +URL: https://pytorch.org/vision +Source0: https://github.com/pytorch/vision/archive/refs/tags/v%{version}.zip + +Patch0: 0001-fix-error-in-build.patch + +Requires: python3-torch +Requires: python3-numpy +Requires: python3-pillow +Requires: python3-requests +Requires: python3-scipy +Requires: python3-sympy + +%description +The torchvision package consists of popular datasets, model architectures, +and common image transformations for computer vision. + +%package -n python3-torchvision +Summary: Datasets, Transforms and Models specific to Computer Vision +Provides: python-torchvision +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-setuptools_scm +BuildRequires: python3-pbr +BuildRequires: python3-pip +BuildRequires: python3-wheel +BuildRequires: python3-hatchling + +BuildRequires: ffmpeg +BuildRequires: ffmpeg-devel ffmpeg-libs +BuildRequires: ninja-build +BuildRequires: cmake + +%description -n python3-torchvision +The torchvision package consists of popular datasets, model architectures, +and common image transformations for computer vision. + +%prep +%autosetup -p1 -n vision-%{version} + +%build +%pyproject_build + +%install +%pyproject_install + +%files -n python3-torchvision +%doc *.md +%license LICENSE +%{python3_sitearch}/* + +%changelog +* Sun Jan 28 2024 Binshuo Zu <274620705z@gmail.com> - 0.16.2-1 +- Package init -- cgit v1.2.3