summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-04-13 17:02:02 +0000
committerCoprDistGit <infra@openeuler.org>2024-04-13 17:02:02 +0000
commit7c3c0d25de494c96647ca5fce2c35bbe82591adc (patch)
tree7deebac4b2c250332b9f2d71b95ae2c72f1eafa5
parentcbe2d5630575b7a6663f0a650ac5d77f021761c6 (diff)
automatic import of python-text
-rw-r--r--.gitignore1
-rw-r--r--0001-disable-git-submodule.patch25
-rw-r--r--python-torchtext.spec70
-rw-r--r--sources1
4 files changed, 97 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..91831fd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/python-text-0.18.0.tar.gz
diff --git a/0001-disable-git-submodule.patch b/0001-disable-git-submodule.patch
new file mode 100644
index 0000000..738deae
--- /dev/null
+++ b/0001-disable-git-submodule.patch
@@ -0,0 +1,25 @@
+From cc1e51d36c800e80d6286a8db23136e14859f83e Mon Sep 17 00:00:00 2001
+From: menmazqj <1316818279@qq.com>
+Date: Sat, 13 Apr 2024 22:37:47 +0800
+Subject: [PATCH] disable git submodule
+
+---
+ setup.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index 01810aa5c..43d703152 100644
+--- a/setup.py
++++ b/setup.py
+@@ -89,7 +89,7 @@ class clean(distutils.command.clean.clean):
+ shutil.rmtree(str(path), ignore_errors=True)
+
+
+-_init_submodule()
++#_init_submodule()
+ setup_info = dict(
+ # Metadata
+ name="torchtext",
+--
+2.41.0
+
diff --git a/python-torchtext.spec b/python-torchtext.spec
new file mode 100644
index 0000000..d5d2e14
--- /dev/null
+++ b/python-torchtext.spec
@@ -0,0 +1,70 @@
+%global _empty_manifest_terminate_build 0
+%global pypi_name text
+%global source_name text
+
+Name: python-%{pypi_name}
+Version: 0.18.0
+Release: 1%{?dist}
+Summary: torchtext package for Python3
+URL: https://pytorch.org/text/stable/index.html
+Source0: https://github.com/pytorch/text/archive/refs/tags/v0.16.2.tar.gz#/%{name}-%{version}.tar.gz
+
+Patch0: 0001-disable-git-submodule.patch
+License: BSD 3-Clause
+
+Requires: python3-multipledispatch
+Requires: python3-tqdm
+Requires: python3-requests
+Requires: python3-pytorch_package_dep
+Requires: python3-numpy
+Requires: python3-torchdata_package_dep
+Requires: python3-scipy
+Requires: python3-pyro-ppl >= 1.8.4
+Requires: python3-gpytorch >= 1.11
+Requires: python3-linear_operator == 0.5.1
+
+%description
+The torchtext package consists of data processing utilities and popular datasets for natural language.
+
+%package -n python3-%{pypi_name}
+Summary: Botorch package for Python3
+Provides: python-%{pypi_name}
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-setuptools_scm
+BuildRequires: python3-pip
+BuildRequires: python3-wheel
+BuildRequires: python3-hatchling
+BuildRequires: python3-pytorch >= 1.13.1
+
+%description -n python3-%{pypi_name}
+
+%package help
+Summary: Development documents and examples for torchtext
+Provides: python3-%{pypi_name}-doc
+%description help
+documents of torchtext package for python3
+
+%prep
+%autosetup -p1 -n %{source_name}-%{version}
+tar -xzvf %{_sourcedir}/re2.tar.gz -C %{_sourcedir} && mv %{_sourcedir}/re2 ./third_party/
+tar -xzvf %{_sourcedir}/abseil-cpp.tar.gz -C %{_sourcedir} && mv %{_sourcedir}/abseil-cpp ./third_party/re2/
+tar -xzvf %{_sourcedir}/sentencepiece.tar.gz -C %{_sourcedir} && mv %{_sourcedir}/sentencepiece ./third_party/
+tar -xzvf %{_sourcedir}/utf8proc.tar.gz -C %{_sourcedir} && mv %{_sourcedir}/utf8proc ./third_party/
+tar -xzvf %{_sourcedir}/double-conversion.tar.gz -C %{_sourcedir} && mv %{_sourcedir}/double-conversion ./third_party/
+
+%build
+%py3_build
+
+%install
+%py3_install
+
+%files -n python3-%{pypi_name}
+%doc *.md
+%license LICENSE
+%{python3_sitelib}/*
+
+
+%changelog
+* Mon Jan 22 2024 menma <1316818279@qq.com> - 0.9.5-1
+- Package init
diff --git a/sources b/sources
new file mode 100644
index 0000000..18d66d7
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+48920978522d8358a0f9c568928550a7 python-text-0.18.0.tar.gz