Adapting to the pyproject.toml compilation mode

This commit is contained in:
caodongxia 2023-04-28 10:37:20 +08:00
parent dfeba1fdf4
commit 2d5f799103
2 changed files with 10 additions and 93 deletions

View File

@ -1,88 +0,0 @@
From ee8a0b6009f7aa8bef36b2d11f441020a5784016 Mon Sep 17 00:00:00 2001
From: liqiuyu123 <liqiuyu@kylinos.cn>
Date: Thu, 4 Aug 2022 14:35:58 +0800
Subject: [PATCH] add setup.py
---
setup.py | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 71 insertions(+)
create mode 100644 setup.py
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..e88d95f
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,69 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2021 Vinay Sajip.
+# Licensed to the Python Software Foundation under a contributor agreement.
+# See LICENSE.txt and CONTRIBUTORS.txt.
+#
+
+import distutils.core
+from os.path import join, dirname
+
+import distlib
+
+
+class TestCommand(distutils.core.Command):
+ user_options = []
+
+ def run(self):
+ import sys
+
+ sys.path.append(join(dirname(__file__), 'tests'))
+ import test_all
+ sys.exit(test_all.main())
+
+ def initialize_options(self):
+ pass
+
+ def finalize_options(self):
+ pass
+
+
+distutils.core.setup(
+ name='distlib',
+ version=distlib.__version__,
+ author='Vinay Sajip',
+ author_email='vinay_sajip@red-dove.com',
+ url='https://bitbucket.org/pypa/distlib',
+ download_url=('https://bitbucket.org/pypa/distlib/downloads/'
+ 'distlib-' + distlib.__version__ + '.zip'),
+ description='Distribution utilities',
+ long_description=('Low-level components of distutils2/packaging, '
+ 'augmented with higher-level APIs for making packaging easier.'),
+ license='Python license',
+ classifiers=[
+ 'Development Status :: 5 - Production/Stable',
+ 'Environment :: Console',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: Python Software Foundation License',
+ 'Operating System :: OS Independent',
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
+ 'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.10',
+ 'Programming Language :: Python :: 3.11',
+ 'Topic :: Software Development',
+ ],
+ platforms='any',
+ packages=[
+ 'distlib'
+ ],
+ include_package_data = True,
+ cmdclass={
+ 'test': TestCommand,
+ },
+)
--
2.37.0.windows.1

View File

@ -1,12 +1,11 @@
%global _empty_manifest_terminate_build 0 %global _empty_manifest_terminate_build 0
Name: python-distlib Name: python-distlib
Version: 0.3.6 Version: 0.3.6
Release: 1 Release: 2
Summary: A library of packaging functionality Summary: A library of packaging functionality
License: Python-2.0 License: Python-2.0
URL: https://github.com/pypa/distlib URL: https://github.com/pypa/distlib
Source0: https://files.pythonhosted.org/packages/58/07/815476ae605bcc5f95c87a62b95e74a1bce0878bc7a3119bc2bf4178f175/distlib-0.3.6.tar.gz Source0: https://files.pythonhosted.org/packages/58/07/815476ae605bcc5f95c87a62b95e74a1bce0878bc7a3119bc2bf4178f175/distlib-0.3.6.tar.gz
Patch0: 0001-add-setup.py.patch
BuildArch: noarch BuildArch: noarch
%description %description
@ -17,6 +16,8 @@ basis for third-party packaging tools.
Summary: A library of packaging functionality Summary: A library of packaging functionality
Provides: python-distlib = %{version}-%{release} Provides: python-distlib = %{version}-%{release}
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3-pip
BuildRequires: python3-wheel
BuildRequires: python3-setuptools BuildRequires: python3-setuptools
%description -n python3-distlib %description -n python3-distlib
A library of packaging functionality which is intended to be used as the A library of packaging functionality which is intended to be used as the
@ -30,13 +31,13 @@ A library of packaging functionality which is intended to be used as the
basis for third-party packaging tools. basis for third-party packaging tools.
%prep %prep
%autosetup -n distlib-%{version} %autosetup -n distlib-%{version} -p1
%build %build
%py3_build %pyproject_build
%install %install
%py3_install %pyproject_install distlib==%{version}
install -d -m755 %{buildroot}/%{_pkgdocdir} install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
@ -68,11 +69,15 @@ mv %{buildroot}/doclist.lst .
%files -n python3-distlib -f filelist.lst %files -n python3-distlib -f filelist.lst
%dir %{python3_sitelib}/* %dir %{python3_sitelib}/*
%{python3_sitelib}/distlib
%files help -f doclist.lst %files help -f doclist.lst
%{_docdir}/* %{_docdir}/*
%changelog %changelog
* Thu Apr 27 2023 caodongxia <caodongxia@h-partners.com> - 0.3.6-2
- Adapting to the pyproject.toml compilation mode
* Fri Dec 02 2022 wangjunqi <wangjunqi@kylinos.cn> - 0.3.6-1 * Fri Dec 02 2022 wangjunqi <wangjunqi@kylinos.cn> - 0.3.6-1
- Update package to version 0.3.6 - Update package to version 0.3.6