From 3c0f15b1ebca21cab357f9191f8413a23fd2ffeb Mon Sep 17 00:00:00 2001 From: Jing Zhang Date: Sat, 15 Apr 2023 16:22:54 +0800 Subject: [PATCH] Refact spec Signed-off-by: Jing Zhang --- pyproject-rpm-macros.spec | 74 ++++++++++---------------- pyproject_buildrequires_testcases.yaml | 5 +- 2 files changed, 33 insertions(+), 46 deletions(-) diff --git a/pyproject-rpm-macros.spec b/pyproject-rpm-macros.spec index 22f893c..2b99621 100644 --- a/pyproject-rpm-macros.spec +++ b/pyproject-rpm-macros.spec @@ -1,23 +1,14 @@ -%define anolis_release 1 -Name: pyproject-rpm-macros -Summary: RPM macros for PEP 517 Python packages -License: MIT - +%define anolis_release 2 %bcond_without tests -# The idea is to follow the spirit of semver -# Given version X.Y.Z: -# Increment X and reset Y.Z when there is a *major* incompatibility -# Increment Y and reset Z when new macros or features are added -# Increment Z when this is a bugfix or a cosmetic change -# Dropping support for EOL Fedoras is *not* considered a breaking change +Name: pyproject-rpm-macros Version: 1.0.0 Release: %{anolis_release}%{?dist} - -# Macro files +Summary: RPM macros for PEP 517 Python packages +License: MIT +URL: https://src.fedoraproject.org/rpms/pyproject-rpm-macros Source001: macros.pyproject - -# Implementation files +#Implementation files: Source101: pyproject_buildrequires.py Source102: pyproject_save_files.py Source103: pyproject_convert.py @@ -25,13 +16,13 @@ Source104: pyproject_preprocess_record.py Source105: pyproject_construct_toxenv.py Source106: pyproject_requirements_txt.py -# Tests +#For Tests: Source201: test_pyproject_buildrequires.py Source202: test_pyproject_save_files.py Source203: test_pyproject_requirements_txt.py Source204: compare_mandata.py -# Test data +#For test data Source301: pyproject_buildrequires_testcases.yaml Source302: pyproject_save_files_test_data.yaml Source303: test_RECORD @@ -40,29 +31,16 @@ Source303: test_RECORD Source901: README.md Source902: LICENSE -URL: https://src.fedoraproject.org/rpms/pyproject-rpm-macros - BuildArch: noarch %if %{with tests} -BuildRequires: python3dist(pytest) -BuildRequires: python3dist(pyyaml) -BuildRequires: python3dist(packaging) -BuildRequires: python3dist(pip) -BuildRequires: python3dist(setuptools) -BuildRequires: python3dist(toml) -BuildRequires: python3dist(tox-current-env) >= 0.0.6 -BuildRequires: python3dist(wheel) +BuildRequires: python3dist(pytest) python3dist(pyyaml) python3dist(packaging) +BuildRequires: python3dist(pip) python3dist(setuptools) python3dist(toml) +BuildRequires: python3dist(tox-current-env) >= 0.0.6 python3dist(wheel) %endif -# We build on top of those: -Requires: python-rpm-macros -Requires: python-srpm-macros -Requires: python3-rpm-macros - -# We use the following tools outside of coreutils -Requires: /usr/bin/find -Requires: /usr/bin/sed +Requires: python-rpm-macros python-srpm-macros python3-rpm-macros +Requires: /usr/bin/find /usr/bin/sed %description These macros allow projects that follow the Python packaging specifications @@ -78,15 +56,19 @@ They work for: These macros replace %%py3_build and %%py3_install, which only work with setup.py. +%package doc +Summary: Documentation files for %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description doc +The %{name}-doc package contains documentation files for %{name}. %prep -# Not strictly necessary but allows working on file names instead -# of source numbers in install section -%setup -c -T -cp -p %{sources} . +%autosetup -n %{name}-%{version} -c -T +install -m 0644 -p %{sources} . %build -# nothing to do, sources are not buildable %install mkdir -p %{buildroot}%{_rpmmacrodir} @@ -101,15 +83,14 @@ install -m 644 pyproject_requirements_txt.py %{buildroot}%{_rpmconfigdir}/anolis %if %{with tests} %check -export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856356 +export HOSTNAME="rpmbuild" %{python3} -m pytest -vv --doctest-modules - -# brp-compress is provided as an argument to get the right directory macro expansion %{python3} compare_mandata.py -f %{_rpmconfigdir}/brp-compress %endif %files +%license LICENSE %{_rpmmacrodir}/macros.pyproject %{_rpmconfigdir}/anolis/pyproject_buildrequires.py %{_rpmconfigdir}/anolis/pyproject_convert.py @@ -118,9 +99,12 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856 %{_rpmconfigdir}/anolis/pyproject_construct_toxenv.py %{_rpmconfigdir}/anolis/pyproject_requirements_txt.py +%files doc %doc README.md -%license LICENSE %changelog -* Thu Mar 02 2022 Chunmei Xu - 1.0.0-1 +* Sat Apr 15 2023 Jing Zhang - 1.0.0-2 +- Refact spec + +* Thu Mar 03 2022 Chunmei Xu - 1.0.0-1 - upstream version 1.0.0 diff --git a/pyproject_buildrequires_testcases.yaml b/pyproject_buildrequires_testcases.yaml index 5e4b5e5..ec464d8 100644 --- a/pyproject_buildrequires_testcases.yaml +++ b/pyproject_buildrequires_testcases.yaml @@ -387,6 +387,7 @@ Tox dependencies: python3dist(wheel) python3dist(wheel) python3dist(tox-current-env) >= 0.0.6 + python3dist(tox) python3dist(toxdep1) python3dist(toxdep2) python3dist(inst) @@ -429,6 +430,7 @@ Tox extras: python3dist(wheel) python3dist(wheel) python3dist(tox-current-env) >= 0.0.6 + python3dist(tox) python3dist(toxdep) python3dist(inst) python3dist(dep11) > 11.0 @@ -473,6 +475,7 @@ Tox provision unsatisfied: python3dist(tox) >= 3.999 python3dist(setuptools) > 40.0 python3dist(wheel) > 2.0 + python3dist(tox) >= 3.999 result: 0 Tox provision satisfied: @@ -504,8 +507,8 @@ Tox provision satisfied: python3dist(wheel) python3dist(wheel) python3dist(tox-current-env) >= 0.0.6 - python3dist(tox) >= 3.5 python3dist(setuptools) > 40.0 + python3dist(tox) >= 3.5 python3dist(toxdep1) python3dist(toxdep2) python3dist(inst) -- Gitee