!11 Use pyproject to compile package

From: @jxy_git 
Reviewed-by: @yangzhao_kl 
Signed-off-by: @yangzhao_kl
This commit is contained in:
openeuler-ci-bot 2023-04-27 02:43:25 +00:00 committed by Gitee
commit 2dd3c35d6a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 12 additions and 26 deletions

View File

@ -1,18 +0,0 @@
--- c/setup.py 1970-01-01 08:00:00.000000000 +0800
+++ a/setup.py 2022-10-28 14:58:41.729391467 +0800
@@ -0,0 +1,15 @@
+#!/usr/bin/env python
+# setup.py generated by flit for tools that don't yet use PEP 517
+
+from distutils.core import setup
+
+
+setup(name='threadpoolctl',
+ version='3.1.0',
+ description='threadpoolctl',
+ author='Thomas Moreau',
+ author_email='thomas.moreau.2010@gmail.com',
+ url='https://github.com/joblib/threadpoolctl',
+ py_modules=['threadpoolctl'],
+ python_requires='>=3.6',
+ )

View File

@ -3,14 +3,14 @@
Name: python-%{pypi_name}
Version: 3.1.0
Release: 2
Release: 3
Summary: Python helpers to limit the number of threads
License: BSD-3-Clause
URL: https://github.com/joblib/threadpoolctl/
Source0: https://files.pythonhosted.org/packages/1b/c7/3d85f8b3894ba7228d0c74e16e97a36a72b2cd2b0e0f8f89b5d435d11f71/threadpoolctl-3.1.0.tar.gz
Patch0: 0001-add-setup.py.patch
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: python3-pip python3-wheel python3-flit
%if %{with test}
BuildRequires: python3-pytest
@ -34,13 +34,16 @@ Summary: %{summary}
%prep
%autosetup -n %{pypi_name}-%{version} -p1
%patch0
%build
%py3_build
%pyproject_build
%install
%py3_install
%pyproject_install threadpoolctl==%{version}
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
%if %{with test}
%check
@ -50,11 +53,12 @@ py.test-%{python3_version}
%files -n python3-%{pypi_name}
%license LICENSE
%doc README.md CHANGES.md
%{python3_sitelib}/threadpoolctl.py
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
%{python3_sitelib}/__pycache__/%{pypi_name}.*
%{python3_sitelib}/*
%changelog
* Thu Apr 27 2023 jiangxinyu <jiangxinyu@kylinos.cn> - 3.1.0-3
- Use pyproject to compile package
* Thu Feb 16 2023 tanyulong <tanyulong@kylinos.cn> - 3.1.0-2
- enable check