From 0a9f7c0d35e8a7c9a92b4eaa994daeb4284a7980 Mon Sep 17 00:00:00 2001 From: Jvle Date: Thu, 5 Mar 2026 12:41:36 +0800 Subject: [PATCH] SPECS: add python-tox Signed-off-by: Jvle --- python-tox.spec | 75 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 python-tox.spec diff --git a/python-tox.spec b/python-tox.spec new file mode 100644 index 0000000..59f7938 --- /dev/null +++ b/python-tox.spec @@ -0,0 +1,75 @@ +# SPDX-FileCopyrightText: (C) 2026 Institute of Software, Chinese Academy of Sciences (ISCAS) +# SPDX-FileCopyrightText: (C) 2026 openRuyi Project Contributors +# SPDX-FileContributor: Jvle +# +# SPDX-License-Identifier: MulanPSL-2.0 + +%bcond bootstrap 0 +# Many tests are enabled by default, unless bootstrapping +%bcond tests %{without bootstrap} + +%global srcname tox + +Name: python-%{srcname} +Version: 4.30.0 +Release: %autorelease +Summary: Virtualenv-based automation of test activities +License: MIT +URL: https://tox.readthedocs.io/ +VCS: https://github.com/tox-dev/tox +#!RemoteAsset +Source0: https://files.pythonhosted.org/packages/source/t/%{srcname}/%{srcname}-%{version}.tar.gz +BuildArch: noarch +BuildSystem: pyproject + +BuildOption(install): %{srcname} + +BuildRequires: pkgconfig(python3) +BuildRequires: pyproject-rpm-macros +BuildRequires: python3dist(setuptools) +BuildRequires: python3dist(build) +%if %{with tests} +BuildRequires: gcc +BuildRequires: git +BuildRequires: python3dist(flaky) +BuildRequires: python3dist(pip) +BuildRequires: python3dist(pytest) +BuildRequires: python3dist(pytest-mock) +BuildRequires: pkgconfig(libffi) +# xdist is not used upstream, but we use it to speed up the %%check +BuildRequires: python3dist(pytest-xdist) +%endif + +Provides: python3-%{srcname} +%python_provide python3-%{srcname} + +%description +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 -a +%generate_buildrequires +export SETUPTOOLS_SCM_PRETEND_VERSION="%{version}" +%pyproject_buildrequires -r %{?with_tests:-g test} + +%build -p +export SETUPTOOLS_SCM_PRETEND_VERSION="%{version}" + +%check -a +%if %{with tests} +# deselected tests run tox without the options for this plugin and hence they need internet +%pytest -k "not regular and not noquiet_installed_packages[None]" +%endif + +%files -f %{pyproject_files} +%{_bindir}/tox + +%changelog +%{?autochangelog}