| |
@@ -9,6 +9,8 @@
|
| |
BuildArch: noarch
|
| |
BuildRequires: python3-devel
|
| |
BuildRequires: pyproject-rpm-macros
|
| |
+ BuildRequires: /usr/bin/git
|
| |
+ BuildRequires: /usr/bin/hg
|
| |
|
| |
%description
|
| |
Here we test that %%pyproject_extras_subpkg works and generates
|
| |
@@ -16,6 +18,10 @@
|
| |
|
| |
Note that it only works on Fedora 33+.
|
| |
|
| |
+ We also check passing multiple -e flags to %%pyproject_buildrequires.
|
| |
+ The tox environments also have a dependency on an extra ("toml").
|
| |
+
|
| |
+
|
| |
%package -n python3-setuptools_scm
|
| |
Summary: %{summary}
|
| |
|
| |
@@ -28,9 +34,22 @@
|
| |
%prep
|
| |
%autosetup -p1 -n setuptools_scm-%{version}
|
| |
|
| |
+ # there is a mistake in the flake8 environment configuration
|
| |
+ # https://github.com/pypa/setuptools_scm/pull/444
|
| |
+ # https://github.com/pypa/setuptools_scm/pull/489
|
| |
+ sed -i -e 's@flake8 setuptools_scm/@flake8 src/setuptools_scm/@' -e 's@--exclude=setuptools_scm/@--exclude=src/setuptools_scm/@' tox.ini
|
| |
+
|
| |
|
| |
%generate_buildrequires
|
| |
+ %if 0%{?fedora} >= 33 || 0%{?rhel} >= 9
|
| |
+ # Note that you should not run flake8-like linters in Fedora spec files,
|
| |
+ # here we do it solely to check the *ability* to use multiple toxenvs.
|
| |
+ %pyproject_buildrequires -e %{default_toxenv}-test -e flake8
|
| |
+ %else
|
| |
+ # older Fedoras don't have the required runtime dependencies, so we don't test it there
|
| |
%pyproject_buildrequires
|
| |
+ %endif
|
| |
+
|
| |
|
| |
|
| |
%build
|
| |
@@ -43,6 +62,16 @@
|
| |
|
| |
|
| |
%check
|
| |
+ %if 0%{?fedora} >= 33 || 0%{?rhel} >= 9
|
| |
+ # This tox should run all the toxenvs specified via -e in %%pyproject_buildrequires
|
| |
+ # We only run some of the tests (running all of them requires network connection and is slow)
|
| |
+ %tox -- -- -k test_version | tee toxlog
|
| |
+
|
| |
+ # Internal check for our macros: Assert both toxenvs were executed.
|
| |
+ grep -F 'py%{python3_version_nodots}-test: commands succeeded' toxlog
|
| |
+ grep -F 'flake8: commands succeeded' toxlog
|
| |
+ %endif
|
| |
+
|
| |
# Internal check for our macros
|
| |
# making sure that %%{pyproject_ghost_distinfo} has the right content
|
| |
test -f %{pyproject_ghost_distinfo}
|
| |
Depends-on: https://src.fedoraproject.org/rpms/python-tox-current-env/pull-request/9