Remove obsolete cruft from the specfile, follow the packaging guidelines

- spell Python in summary with capital P
 - use HTTPS URL
 - use %pypi_source
 - remove a note about Python 2 from the description, there is no Python 2
 - %python_provide is redundant and deprecated
 - the Obsoletes for python2-sqlalchemy is not needed
 - %pytest is shorter and tests the installed module
 - listing %{python3_sitearch}/* in %files is forbidden
 - move python3-sqlalchemy %package above python-doc to be able to reuse %{summary}
This commit is contained in:
Miro Hrončok 2022-06-18 11:40:00 +02:00
parent f7ad5c6345
commit 597abac0f9
1 changed files with 14 additions and 19 deletions

View File

@ -20,11 +20,11 @@ Version: 1.4.39
# cope with pre-release versions containing tildes # cope with pre-release versions containing tildes
%global srcversion %{lua: srcversion, num = rpm.expand("%{version}"):gsub("~", ""); print(srcversion);} %global srcversion %{lua: srcversion, num = rpm.expand("%{version}"):gsub("~", ""); print(srcversion);}
Release: 2%{?dist} Release: 2%{?dist}
Summary: Modular and flexible ORM library for python Summary: Modular and flexible ORM library for Python
License: MIT License: MIT
URL: http://www.sqlalchemy.org/ URL: https://www.sqlalchemy.org/
Source0: https://files.pythonhosted.org/packages/source/S/%{srcname}/%{srcname}-%{srcversion}.tar.gz Source0: %{pypi_source %{srcname} %{srcversion}}
BuildRequires: gcc BuildRequires: gcc
BuildRequires: python3-devel >= 3.6 BuildRequires: python3-devel >= 3.6
@ -44,19 +44,8 @@ as you choose, determining relationships based on foreign keys or letting you
define the join conditions explicitly, to bridge the gap between database and define the join conditions explicitly, to bridge the gap between database and
domain. domain.
This package includes the python 2 version of the module.
%package doc
Summary: Documentation for SQLAlchemy
BuildArch: noarch
%description doc
Documentation for SQLAlchemy
%package -n python3-sqlalchemy %package -n python3-sqlalchemy
Summary: Modular and flexible ORM library for python Summary: %{summary}
%{?python_provide:%python_provide python%{python3_pkgversion}-sqlalchemy}
Obsoletes: python2-sqlalchemy < 1.3.10-2
%description -n python3-sqlalchemy %description -n python3-sqlalchemy
SQLAlchemy is an Object Relational Mapper (ORM) that provides a flexible, SQLAlchemy is an Object Relational Mapper (ORM) that provides a flexible,
@ -67,11 +56,16 @@ as you choose, determining relationships based on foreign keys or letting you
define the join conditions explicitly, to bridge the gap between database and define the join conditions explicitly, to bridge the gap between database and
domain. domain.
This package includes the python 3 version of the module.
# Subpackages to ensure dependencies enabling extra functionality # Subpackages to ensure dependencies enabling extra functionality
%{?python_extras_subpkg:%python_extras_subpkg -n python3-sqlalchemy -i %{python3_sitearch}/*.egg-info %python_pkg_extras} %{?python_extras_subpkg:%python_extras_subpkg -n python3-sqlalchemy -i %{python3_sitearch}/*.egg-info %python_pkg_extras}
%package doc
Summary: Documentation for SQLAlchemy
BuildArch: noarch
%description doc
Documentation for SQLAlchemy.
%prep %prep
%setup -q -n %{srcname}-%{srcversion} %setup -q -n %{srcname}-%{srcversion}
@ -86,7 +80,7 @@ This package includes the python 3 version of the module.
rm -rf doc/build rm -rf doc/build
%check %check
PYTHONPATH=. %{__python3} -m pytest test \ %pytest test \
%if %{with xdist} %if %{with xdist}
--numprocesses=auto --numprocesses=auto
%endif %endif
@ -98,7 +92,8 @@ PYTHONPATH=. %{__python3} -m pytest test \
%files -n python3-sqlalchemy %files -n python3-sqlalchemy
%license LICENSE %license LICENSE
%doc README.rst %doc README.rst
%{python3_sitearch}/* %{python3_sitearch}/SQLAlchemy-*.egg-info/
%{python3_sitearch}/sqlalchemy/
%changelog %changelog
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.39-2 * Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.39-2