summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-04-01 01:37:17 +0000
committerCoprDistGit <infra@openeuler.org>2024-04-01 01:37:17 +0000
commita22df70e3f431c5e350e2f850c44a5224b90e7c5 (patch)
treeebdf1c919b37dbadf37ca74e6e537aced3cbc1dc
parenteb98c748167ae62ced197838f12cd41d5646f8d4 (diff)
automatic import of torchvision
-rw-r--r--fix-illegal-char.patch11
-rw-r--r--torchvision.spec48
2 files changed, 34 insertions, 25 deletions
diff --git a/fix-illegal-char.patch b/fix-illegal-char.patch
new file mode 100644
index 0000000..5f31566
--- /dev/null
+++ b/fix-illegal-char.patch
@@ -0,0 +1,11 @@
+--- setup.py.orig 2024-04-01 09:17:40.063559466 +0800
++++ setup.py 2024-04-01 09:20:04.243166454 +0800
+@@ -63,7 +63,7 @@
+ ]
+
+ # 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 !=8.3.3"
+ pillow_req = "pillow-simd" if get_dist("pillow-simd") is not None else "pillow"
+ requirements.append(pillow_req + pillow_ver)
+
diff --git a/torchvision.spec b/torchvision.spec
index 2155d6a..c8bb8fb 100644
--- a/torchvision.spec
+++ b/torchvision.spec
@@ -1,61 +1,59 @@
%global _empty_manifest_terminate_build 0
%global _unpackaged_files_terminate_build 0
-%global lib_name vision
+%global pypi_name torchvision
-Name: torchvision
+Name: %{pypi_name}
Version: 0.17.2
Release: 1%{?dist}
Summary: %{name} is a torch ecosystem tools
License: BSD-3
URL: https://pytorch.org/vision
-Source0: https://github.com/pytorch/%{lib_name}/archive/refs/tags/v%{version}.tar.gz
+Source0: https://github.com/pytorch/vision/archive/refs/tags/v%{version}.tar.gz
+
+Patch0: fix-illegal-char.patch
+
+BuildArch: noarch
%description
datasets and models for the pytorch paper
-# pkg section 1
+# pkg 1
%package -n python3-%{name}
Summary: a model and datasets for pytorch
-Provides: python-%{name}
-BuildRequires: python3
BuildRequires: python3-devel
BuildRequires: python3-setuptools
-BuildRequires: python3-setuptools_scm
-BuildRequires: python3-rpm-macros
-BuildRequires: python3-pip
-BuildRequires: python3-wheel
-BuildRequires: python3-hatchling
BuildRequires: python3-pytorch
-# auto add requires
-%?python_enable_dependency_generator
-# add extra requires
Requires: python3-requests
-%description -n python3-%{name}
-datasets and models for the pytorch paper
+%description -n python3-%{pypi_name}
+datasets and models for the pytorch paper
-# pkg section 2
-%package help
+# pkg 2
+%package -n python3-%{pypi_name}-doc
Summary: doc for the %{name} lib.
-Provides: python-%{name}-doc
-%description help
+
+%description -n python3-%{pypi_name}-doc
description for helping using the torchvision lib
%prep
-%autosetup -p1 -n %{lib_name}-%{version}
+%autosetup -p1 -n vision-%{version}
+rm -rf %{pypi_name}.egg-info
+%patch0
+
%build
-%pyproject_build
+%py3_build
%install
-%pyproject_install
+%py3_install
-%files -n python3-%{name}
+%files -n python3-%{pypi_name}
%doc *.md
%license LICENSE
-%{python3_sitearch}/*
+%{python3_sitelib}/%{pypi_name}
+%{python3_sitearch}/%{name}
%changelog
* Sun Mar 31 2024 Super User