Modernize packaging
- use pyproject-rpm-macros - don't macronize the setuptools_scm name - use globs in .gitignore
This commit is contained in:
parent
c408a5e08a
commit
2e1f3f183d
20
.gitignore
vendored
20
.gitignore
vendored
@ -1,18 +1,2 @@
|
|||||||
/setuptools_scm-1.8.0.tar.bz2
|
/setuptools_scm-*.tar.gz
|
||||||
/setuptools_scm-1.9.0.tar.gz
|
/setuptools_scm-*/
|
||||||
/setuptools_scm-1.10.1.tar.bz2
|
|
||||||
/setuptools_scm-1.13.0.tar.gz
|
|
||||||
/setuptools_scm-1.15.0.tar.gz
|
|
||||||
/setuptools_scm-1.15.5.tar.gz
|
|
||||||
/setuptools_scm-1.15.6.tar.gz
|
|
||||||
/setuptools_scm-1.15.7.tar.gz
|
|
||||||
/setuptools_scm-2.1.0.tar.gz
|
|
||||||
/setuptools_scm-3.0.4.tar.gz
|
|
||||||
/setuptools_scm-3.1.0.tar.gz
|
|
||||||
/setuptools_scm-3.2.0.tar.gz
|
|
||||||
/setuptools_scm-3.3.0.tar.gz
|
|
||||||
/setuptools_scm-3.3.1.tar.gz
|
|
||||||
/setuptools_scm-3.3.3.tar.gz
|
|
||||||
/setuptools_scm-3.5.0.tar.gz
|
|
||||||
/setuptools_scm-4.1.2.tar.gz
|
|
||||||
/setuptools_scm-5.0.1.tar.gz
|
|
||||||
|
@ -1,62 +1,70 @@
|
|||||||
%bcond_without tests
|
%bcond_without tests
|
||||||
|
|
||||||
%global srcname setuptools_scm
|
Name: python-setuptools_scm
|
||||||
|
|
||||||
Name: python-%{srcname}
|
|
||||||
Version: 5.0.1
|
Version: 5.0.1
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: Blessed package to manage your versions by SCM tags
|
Summary: Blessed package to manage your versions by SCM tags
|
||||||
|
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://pypi.python.org/pypi/setuptools_scm
|
URL: https://pypi.python.org/pypi/setuptools_scm
|
||||||
Source0: %pypi_source
|
Source0: %{pypi_source setuptools_scm}
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
|
BuildRequires: python%{python3_pkgversion}-devel
|
||||||
|
BuildRequires: pyproject-rpm-macros
|
||||||
%if %{with tests}
|
%if %{with tests}
|
||||||
BuildRequires: git-core
|
BuildRequires: git-core
|
||||||
BuildRequires: mercurial
|
BuildRequires: mercurial
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Setuptools_scm handles managing your python package versions in SCM metadata.
|
Setuptools_scm handles managing your Python package versions in SCM metadata.
|
||||||
It also handles file finders for the supported SCMs.
|
It also handles file finders for the supported SCMs.
|
||||||
|
|
||||||
%package -n python%{python3_pkgversion}-%{srcname}
|
|
||||||
|
%package -n python%{python3_pkgversion}-setuptools_scm
|
||||||
Summary: %{summary}
|
Summary: %{summary}
|
||||||
BuildRequires: python%{python3_pkgversion}-devel
|
|
||||||
BuildRequires: python%{python3_pkgversion}-setuptools
|
|
||||||
%if %{with tests}
|
|
||||||
BuildRequires: python%{python3_pkgversion}-pip
|
|
||||||
BuildRequires: python%{python3_pkgversion}-pytest
|
|
||||||
BuildRequires: python%{python3_pkgversion}-toml
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%description -n python%{python3_pkgversion}-%{srcname}
|
%description -n python%{python3_pkgversion}-setuptools_scm
|
||||||
Setuptools_scm handles managing your python package versions in SCM metadata.
|
Setuptools_scm handles managing your Python package versions in SCM metadata.
|
||||||
It also handles file finders for the supported SCMs.
|
It also handles file finders for the supported SCMs.
|
||||||
|
|
||||||
%{?python_extras_subpkg:%{python_extras_subpkg -n python3-setuptools_scm -i %{python3_sitelib}/%{srcname}-*.egg-info toml}}
|
|
||||||
|
%pyproject_extras_subpkg -n python%{python3_pkgversion}-setuptools_scm toml
|
||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{srcname}-%{version}
|
%autosetup -p1 -n setuptools_scm-%{version}
|
||||||
|
# In case of a bootstrap loop between toml and setuptools_scm, do:
|
||||||
|
# rm pyproject.toml
|
||||||
|
# That way, toml is not fetched to parse the file.
|
||||||
|
# That only works assuming the backend in the file remains the default backend.
|
||||||
|
|
||||||
|
|
||||||
|
%generate_buildrequires
|
||||||
|
%pyproject_buildrequires %{?with_tests:-e %{toxenv}-test}
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%py3_build
|
%pyproject_wheel
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%py3_install
|
%pyproject_install
|
||||||
|
%pyproject_save_files setuptools_scm
|
||||||
|
|
||||||
|
|
||||||
%if %{with tests}
|
%if %{with tests}
|
||||||
%check
|
%check
|
||||||
PYTHONPATH=%{buildroot}%{python3_sitelib} pytest-3 -v -k 'not test_pip_download'
|
%tox -- -- -v -k 'not test_pip_download'
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%files -n python%{python3_pkgversion}-%{srcname}
|
|
||||||
|
%files -n python%{python3_pkgversion}-setuptools_scm -f %{pyproject_files}
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
%{python3_sitelib}/%{srcname}/
|
|
||||||
%{python3_sitelib}/%{srcname}-*.egg-info/
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Fri Jan 29 2021 Miro Hrončok <mhroncok@redhat.com> - 5.0.1-1
|
* Fri Jan 29 2021 Miro Hrončok <mhroncok@redhat.com> - 5.0.1-1
|
||||||
|
Loading…
Reference in New Issue
Block a user