From 64cbdeddd2b0c39a335e0d10a83782aa7d2e92ed Mon Sep 17 00:00:00 2001 From: li-miaomiao_zhr Date: Tue, 12 Sep 2023 09:38:24 +0800 Subject: [PATCH] start self-test of software package --- python-black.spec | 47 +++++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/python-black.spec b/python-black.spec index f9ab754..2c9fec1 100644 --- a/python-black.spec +++ b/python-black.spec @@ -1,13 +1,10 @@ -%global _empty_manifest_terminate_build 0 -%global pypi_name black - -Name: python-%{pypi_name} +Name: black Version: 23.3.0 -Release: 5 +Release: 4 Summary: The uncompromising code formatter License: MIT URL: https://github.com/psf/black -Source0: %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz +Source: %{pypi_source black} BuildArch: noarch @@ -22,6 +19,18 @@ BuildRequires: python3-hatch-vcs BuildRequires: python3-hatchling BuildRequires: python3-hatch-fancy-pypi-readme +# for test +BuildRequires: python3-pytest +BuildRequires: python3-coverage +BuildRequires: python3-pre-commit +BuildRequires: python3-pytest-xdist +BuildRequires: python3-pytest-cov +BuildRequires: python3-coverage +BuildRequires: python3-tox +BuildRequires: python3-click +BuildRequires: python3-mypy-extensions +BuildRequires: python3-aiohttp + %global _description %{expand: Black is the uncompromising Python code formatter. By using it, you agree to cease control over minutiae of hand-formatting. In return, Black gives you @@ -31,15 +40,15 @@ You will save time and mental energy for more important matters.} %description %_description -%package -n python3-%{pypi_name} +%package -n python3-black Summary: %{summary} -%{?python_provide:%python_provide python3-%{pypi_name}} +Recommends: black+d = %{version}-%{release} -%description -n python3-%{pypi_name} %_description +%description -n python3-black %_description %prep -%autosetup -p1 -n %{pypi_name}-%{version} +%autosetup -n black-%{version} -p1 %build %pyproject_build @@ -52,24 +61,26 @@ for exe in black blackd; do ln -sr %{buildroot}%{_bindir}/${exe}{,-%{python3_version}} done -%files -n python3-%{pypi_name} +%check +%pytest + +%files -n black %license LICENSE %doc README.md %{_bindir}/black %{_bindir}/black-%{python3_version} %{_bindir}/blackd %{_bindir}/blackd-%{python3_version} -%{python3_sitelib}/_black_version.py %{python3_sitelib}/__pycache__/* -%{python3_sitelib}/black* +%{python3_sitelib}/black-%{version}.dist-info/* +%{python3_sitelib}/_black_version.py +%{python3_sitelib}/black/* +%{python3_sitelib}/blackd/* %{python3_sitelib}/blib2to3/* %changelog -* Mon Jul 10 2023 Dongxing Wang - 23.3.0-5 -- Add the black extra package file list - -* Fri Jul 7 2023 Dongxing Wang - 23.3.0-4 -- Fix the black package name +* Tue Sep 12 2023 li-miaomiao_zhr - 23.3.0-4 +- Start self-test of software package * Wed Jul 5 2023 li-miaomiao_zhr - 23.3.0-3 - Change the software packaging name to "python3 black" -- Gitee