Convert to pyproject-rpm-macros, rename the installable package to "tox"
Remove old obsoletes. Pathlib2 is now only imported on old Pythons.
This commit is contained in:
parent
4bd496ae58
commit
e2c1378f46
3 changed files with 81 additions and 71 deletions
117
python-tox.spec
117
python-tox.spec
|
|
@ -7,24 +7,40 @@
|
|||
# 2) Install the built package
|
||||
# (e.g. mock install ./results_python-tox/.../python3-tox-...rpm)
|
||||
# 3) Build again --with tests (and internet connection)
|
||||
# (e.g. fedpkg mockbuild --enable-network --no-clean-all)
|
||||
# (e.g. fedpkg mockbuild --enable-network --no-clean-all --with tests)
|
||||
# The Fedora CI tests do this.
|
||||
%bcond_with tests
|
||||
|
||||
|
||||
%global pypi_name tox
|
||||
Name: python-%{pypi_name}
|
||||
Name: python-tox
|
||||
Version: 3.21.0
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
Summary: Virtualenv-based automation of test activities
|
||||
|
||||
License: MIT
|
||||
URL: https://tox.readthedocs.io/
|
||||
Source0: %{pypi_source}
|
||||
Source0: %{pypi_source tox}
|
||||
|
||||
# Allow building with setuptools_scm 4 and 5
|
||||
Patch1: https://github.com/tox-dev/tox/pull/1799.patch
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
%description
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
|
||||
%if %{with tests}
|
||||
BuildRequires: /usr/bin/gcc
|
||||
BuildRequires: /usr/bin/git
|
||||
BuildRequires: /usr/bin/pip
|
||||
BuildRequires: /usr/bin/poetry
|
||||
BuildRequires: /usr/bin/pytest
|
||||
BuildRequires: /usr/bin/python
|
||||
BuildRequires: libffi-devel
|
||||
# The tests only work if the tested tox is installed :(
|
||||
BuildRequires: tox = %{version}-%{release}
|
||||
%endif
|
||||
|
||||
%global _description %{expand:
|
||||
Tox as is a generic virtualenv management and test command line tool you
|
||||
can use for:
|
||||
|
||||
|
|
@ -33,16 +49,13 @@ can use for:
|
|||
- running your tests in each of the environments, configuring your test tool
|
||||
of choice
|
||||
- acting as a frontend to Continuous Integration servers, greatly reducing
|
||||
boilerplate and merging CI and shell-based testing.
|
||||
boilerplate and merging CI and shell-based testing.}
|
||||
|
||||
%description %_description
|
||||
|
||||
|
||||
%package -n python3-%{pypi_name}
|
||||
%package -n tox
|
||||
Summary: %{summary}
|
||||
%{?python_provide:%python_provide python3-%{pypi_name}}
|
||||
Provides: %{pypi_name} = %{version}-%{release}
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-setuptools
|
||||
BuildRequires: python3-setuptools_scm
|
||||
|
||||
# Recommend "all the Pythons"
|
||||
# Why? Tox exists to enable developers to test libraries against various Python
|
||||
|
|
@ -63,83 +76,49 @@ Recommends: pypy3-devel
|
|||
Recommends: python2-devel
|
||||
Recommends: python3-devel
|
||||
|
||||
# Replace the python2 version
|
||||
Obsoletes: python2-tox < 2.9.1-4
|
||||
|
||||
# Replace detox (no longer supported, functionality is now in tox)
|
||||
# Remove this once Fedora 32 goes EOL
|
||||
Obsoletes: python3-detox < 0.19-5
|
||||
|
||||
%if %{with tests}
|
||||
BuildRequires: python3-filelock
|
||||
BuildRequires: python3-flaky
|
||||
BuildRequires: python3-freezegun
|
||||
BuildRequires: python3-packaging
|
||||
BuildRequires: python3-pip
|
||||
BuildRequires: python3-pluggy >= 0.12
|
||||
BuildRequires: python3-poetry
|
||||
BuildRequires: python3-psutil
|
||||
BuildRequires: python3-py
|
||||
BuildRequires: python3-pytest
|
||||
BuildRequires: python3-pytest-mock
|
||||
BuildRequires: python3-pytest-randomly
|
||||
BuildRequires: python3-pytest-xdist
|
||||
BuildRequires: python3-toml
|
||||
BuildRequires: python3-virtualenv
|
||||
BuildRequires: python3-wheel
|
||||
BuildRequires: (python3-importlib-metadata if python3 < 3.8)
|
||||
BuildRequires: /usr/bin/gcc
|
||||
BuildRequires: /usr/bin/git
|
||||
BuildRequires: /usr/bin/pip
|
||||
BuildRequires: /usr/bin/poetry
|
||||
BuildRequires: /usr/bin/pytest
|
||||
BuildRequires: /usr/bin/python
|
||||
BuildRequires: libffi-devel
|
||||
# The tests only work if the tested tox is installed :(
|
||||
BuildRequires: %{pypi_name} = %{version}-%{release}
|
||||
%endif
|
||||
%py_provides python3-tox
|
||||
# Remove this once Fedora 36 goes EOL:
|
||||
Obsoletes: python3-tox < 3.21.0-2
|
||||
|
||||
%?python_enable_dependency_generator
|
||||
%description -n tox %_description
|
||||
|
||||
%description -n python3-%{pypi_name}
|
||||
Tox as is a generic virtualenv management and test command line tool you
|
||||
can use for:
|
||||
|
||||
- checking your package installs correctly with different Python versions
|
||||
and interpreters
|
||||
- running your tests in each of the environments, configuring your test tool
|
||||
of choice
|
||||
- acting as a frontend to Continuous Integration servers, greatly reducing
|
||||
boilerplate and merging CI and shell-based testing.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n %{pypi_name}-%{version}
|
||||
%autosetup -p1 -n tox-%{version}
|
||||
|
||||
# Pathlib2 was retired in Fedora, instead of unretiring it,
|
||||
# it's enough to use pathlib instead.
|
||||
find . -type f -name "*.py" -print0 | xargs -0 sed -i "s/pathlib2/pathlib/g"
|
||||
|
||||
# remove bundled egg-info
|
||||
rm -rf %{pypi_name}.egg-info
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires %{?with_tests:-x testing}
|
||||
|
||||
|
||||
%build
|
||||
%py3_build
|
||||
%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%py3_install
|
||||
%pyproject_install
|
||||
%pyproject_save_files tox
|
||||
|
||||
|
||||
%if %{with tests}
|
||||
%check
|
||||
%pytest -n auto
|
||||
%endif
|
||||
|
||||
%files -n python3-%{pypi_name}
|
||||
%{_bindir}/%{pypi_name}
|
||||
%{_bindir}/%{pypi_name}-quickstart
|
||||
%{python3_sitelib}/%{pypi_name}/
|
||||
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info/
|
||||
|
||||
%files -n tox -f %{pyproject_files}
|
||||
%{_bindir}/tox
|
||||
%{_bindir}/tox-quickstart
|
||||
|
||||
|
||||
%changelog
|
||||
* Fri Jan 08 2021 Miro Hrončok <mhroncok@redhat.com> - 3.21.0-2
|
||||
- Rename the installable package to "tox"
|
||||
|
||||
* Fri Jan 08 2021 Miro Hrončok <mhroncok@redhat.com> - 3.21.0-1
|
||||
- Update to 3.21.0
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue