Update to 2.10.0 and switch to pyproject macros; Fixes: RHBZ#1747105

This commit is contained in:
Davide Cavalca 2022-12-30 08:45:01 -08:00
parent dc32b6e1c6
commit fedde9da3f
3 changed files with 31 additions and 32 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
/semantic_version-2.5.0.tar.gz
/semantic_version-2.6.0.tar.gz
/semantic_version-2.8.4.tar.gz
/python-semanticversion-2.10.0.tar.gz

View File

@ -1,71 +1,69 @@
%global pypi_name semantic_version
%global srcname python-semanticversion
Name: python-%{pypi_name}
Version: 2.8.4
Version: 2.10.0
Release: %autorelease
Summary: Library implementing the 'SemVer' scheme
License: BSD
URL: https://github.com/rbarrois/python-semanticversion
Source0: %{url}/archive/v%{version}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch
Source: %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz
%global _description \
This small python library provides a few tools to handle semantic versioning\
in Python.
BuildArch: noarch
BuildRequires: make
BuildRequires: python3-devel
BuildRequires: python3-pytest
BuildRequires: sed
%global _description %{expand:
This small python library provides a few tools to handle semantic versioning in
Python.}
%description %{_description}
%package -n python3-%{pypi_name}
Summary: %{summary}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
#BuildRequires: python3-django
%{?python_provide:%python_provide python3-%{pypi_name}}
%description -n python3-%{pypi_name} %{_description}
Python 3 version
%package doc
Summary: Documentation for python-%{pypi_name}
BuildRequires: python3-sphinx
BuildRequires: python3-sphinx_rtd_theme
%description doc
%{summary}.
%prep
%autosetup -n semantic_version-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
# documentation builds due to broken symlink
# https://github.com/rbarrois/python-semanticversion/issues/20
rm docs/credits.rst
%autosetup -p1 -n %{srcname}-%{version}
# Drop unnecessary dependency
sed -i '/zest\.releaser\[recommended\]/d' setup.cfg
%generate_buildrequires
%pyproject_buildrequires -x doc
%build
%py3_build
%pyproject_wheel
# generate html docs
sphinx-build-%{python3_version} docs html
make -C docs html
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}
rm -rf docs/_build/html/.{doctrees,buildinfo}
%install
%py3_install
%pyproject_install
%pyproject_save_files %{pypi_name}
%check
# Seems like it's just stuck in koji
#{__python3} setup.py test
%pytest
%files -n python3-%{pypi_name}
%files -n python3-%{pypi_name} -f %{pyproject_files}
%license LICENSE
%doc README.rst ChangeLog
%{python3_sitelib}/%{pypi_name}/
%{python3_sitelib}/%{pypi_name}-*.egg-info/
%doc README.rst ChangeLog CREDITS
%files doc
%license LICENSE
%doc html
%doc docs/_build/html
%changelog
%autochangelog

View File

@ -1 +1 @@
SHA512 (semantic_version-2.8.4.tar.gz) = 2ed9a8ae03384731865c0b160a9bc92f9c877b610a4ecf15c30969886f15e7cdf77cf384997f96126a8a77534e032c70f587c835fe288fe4ab3e9e2061cb6f47
SHA512 (python-semanticversion-2.10.0.tar.gz) = e060dd60db62663c6ebf21fdca33b2390d9bbad15fbdfa504221ab646426f09168caf00e79cee7ed4ef442c23fd587c9e421aa744990101ea626b58f4e320242