Compare commits
No commits in common. "c9-beta" and "c10s" have entirely different histories.
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
||||
1
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -0,0 +1 @@
|
||||
__pycache__/
|
||||
@ -80,7 +80,7 @@ using the `-R` flag:
|
||||
%pyproject_buildrequires -R
|
||||
|
||||
Alternatively, if the project specifies its dependencies in the pyproject.toml
|
||||
`[project]` table (as defined in [PEP 621](https://www.python.org/dev/peps/pep-0621/)),
|
||||
`[project]` table (as defined in [PEP 621]),
|
||||
the runtime dependencies can be obtained by reading that metadata.
|
||||
|
||||
This can be enabled by using the `-p` flag.
|
||||
@ -92,28 +92,6 @@ Please note that not all build backends which use pyproject.toml support the
|
||||
For example, poetry-core (at least in 1.9.0) defines package metadata in the
|
||||
custom `[tool.poetry]` table which is not supported by the `%pyproject_buildrequires` macro.
|
||||
|
||||
Finally, the runtime dependencies can be obtained by building the wheel and reading the metadata from the built wheel.
|
||||
This can be enabled with the `-w` flag and cannot be combined with `-p`.
|
||||
Support for building wheels with `%pyproject_buildrequires -w` is **provisional** and the behavior might change.
|
||||
Please subscribe to Fedora's [python-devel list] if you use the option.
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires -w
|
||||
|
||||
When this is used, the wheel is going to be built at least twice,
|
||||
becasue the `%generate_buildrequires` section runs repeatedly.
|
||||
To avoid accidentally reusing a wheel leaking from a previous (different) build,
|
||||
it cannot be reused between `%generate_buildrequires` rounds.
|
||||
Contrarily to that, rebuilding the wheel again in the `%build` section is redundant
|
||||
and the packager can omit the `%build` section entirely
|
||||
to reuse the wheel built from the last round of `%generate_buildrequires`.
|
||||
Be extra careful when attempting to modify the sources after `%pyproject_buildrequires`,
|
||||
e.g. when running extra commands in the `%build` section:
|
||||
|
||||
%build
|
||||
cython src/wrong.pyx # this is too late with %%pyproject_buildrequires -w
|
||||
%pyproject_wheel
|
||||
|
||||
For projects that specify test requirements using an [`extra`
|
||||
provide](https://packaging.python.org/specifications/core-metadata/#provides-extra-multiple-use),
|
||||
these can be added using the `-x` flag.
|
||||
@ -167,7 +145,7 @@ in worst case, patch/sed the requirement out from the tox configuration.
|
||||
Note that neither `-x` or `-t` can be used with `-R` or `-N`,
|
||||
because runtime dependencies are always required for testing.
|
||||
You can only use those options if the build backend supports the [prepare-metadata-for-build-wheel hook],
|
||||
or together with `-p` or `-w`.
|
||||
or together with `-p`.
|
||||
However, using `-g` with `-R` or `-N` is supported because dependency groups don't need to be used for testing
|
||||
and can be obtained by reading `pyproject.toml` only.
|
||||
|
||||
@ -184,7 +162,7 @@ Dependencies will be loaded from them:
|
||||
For packages not using build system you can use `-N` to entirely skip automatical
|
||||
generation of requirements and install requirements only from manually specified files.
|
||||
`-N` option implies `-R` and cannot be used in combination with other options mentioned above
|
||||
(`-w`, `-e`, `-t`, `-x`, `-p`).
|
||||
(`-e`, `-t`, `-x`, `-p`).
|
||||
|
||||
The `%pyproject_buildrequires` macro also accepts the `-r` flag for backward compatibility;
|
||||
it means "include runtime dependencies" which has been the default since version 0-53.
|
||||
@ -243,7 +221,7 @@ The macro:
|
||||
- Always prepends `$PATH` with `%{buildroot}%{_bindir}`
|
||||
- If not defined, sets `$PYTHONPATH` to `%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}`
|
||||
- If not defined, sets `$TOX_TESTENV_PASSENV` to `*`
|
||||
- Runs `tox` with `-q` (quiet), `--recreate` and `--current-env` (from [tox-current-env]) flags
|
||||
- Runs `tox` with `-q` (quiet), `--recreate`, `--current-env` (from [tox-current-env]) and `--assert-config` (from [tox-current-env]) flags
|
||||
- Implicitly uses the tox environment name stored in `%{toxenv}` - as overridden by `%pyproject_buildrequires -e`
|
||||
|
||||
By using the `-e` flag, you can use a different tox environment(s):
|
||||
@ -311,10 +289,17 @@ However, in Fedora packages, always list executables explicitly to avoid uninten
|
||||
%doc README.rst
|
||||
%{_bindir}/downloader
|
||||
|
||||
If the package has no Python modules in it, you can explicitly use `-M` to denote that.
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files -M
|
||||
|
||||
Otherwise, at least one module-glob argument is required.
|
||||
|
||||
`%pyproject_save_files` can automatically mark license files with `%license` macro
|
||||
and language (`*.mo`) files with `%lang` macro and appropriate language code.
|
||||
Only license files declared via [PEP 639] `License-File` field are detected.
|
||||
[PEP 639] is still provisional and can be changed in the future.
|
||||
It is possible to use the `-l` flag to declare that a missing license should
|
||||
terminate the build or `-L` (the default) to explicitly disable this check.
|
||||
Packagers are encouraged to use the `-l` flag when the `%license` file is not manually listed in `%files`
|
||||
@ -417,7 +402,7 @@ Provisional: Declarative Buildsystem (RPM 4.20+)
|
||||
|
||||
It is possible to reduce some of the spec boilerplate by using the provided
|
||||
pyproject [declarative buildsystem].
|
||||
This option is only available with RPM 4.20+ (e.g. in Fedora 41+).
|
||||
This option is only available with RPM 4.20+ (e.g. in Fedora 41+, ELN/CentOS Stream 11+).
|
||||
The declarative buildsystem is **provisional** and the behavior might change.
|
||||
Please subscribe to Fedora's [python-devel list] if you use the feature.
|
||||
|
||||
@ -532,6 +517,7 @@ so be prepared for problems.
|
||||
[PEP 508]: https://www.python.org/dev/peps/pep-0508/
|
||||
[PEP 517]: https://www.python.org/dev/peps/pep-0517/
|
||||
[PEP 518]: https://www.python.org/dev/peps/pep-0518/
|
||||
[PEP 621]: https://www.python.org/dev/peps/pep-0621/
|
||||
[PEP 639]: https://www.python.org/dev/peps/pep-0639/
|
||||
[PEP 735]: https://www.python.org/dev/peps/pep-0735/
|
||||
[pip's documentation]: https://pip.pypa.io/en/stable/cli/pip_install/#vcs-support
|
||||
@ -542,6 +528,11 @@ Deprecated
|
||||
|
||||
The `%{pyproject_build_lib}` macro is deprecated, don't use it.
|
||||
|
||||
The `%pyproject_buildrequires` `-w` option is deprecated, don't use it.
|
||||
If the build backend does not support the [prepare-metadata-for-build-wheel hook],
|
||||
consider using the `-p` flag to read the metadata from the pyproject.toml
|
||||
`[project]` table (as defined in [PEP 621]) instead.
|
||||
|
||||
|
||||
Testing the macros
|
||||
------------------
|
||||
@ -565,11 +556,11 @@ For each `$PKG.spec` in `tests/`:
|
||||
|
||||
- download the sources:
|
||||
|
||||
spectool -g -R $PKG.spec
|
||||
spectool -g $PKG.spec
|
||||
|
||||
- build a SRPM:
|
||||
|
||||
rpmbuild -bs $PKG.spec
|
||||
rpmbuild -bs --define '_sourcedir .' $PKG.spec
|
||||
|
||||
- build in mock, using the path from the command above as `$SRPM`:
|
||||
|
||||
4
gating.yaml
Normal file
4
gating.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
--- !Policy
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
||||
@ -3,8 +3,8 @@
|
||||
# When this file is installed but macros.pyproject is not
|
||||
# this macro will cause the package with the real macro to be installed.
|
||||
# When macros.pyproject is installed, it overrides this macro.
|
||||
# Note: This needs to maintain the same set of options as the real macro.
|
||||
%pyproject_buildrequires(rRxtNwpe:g:C:) echo 'pyproject-rpm-macros' && exit 0
|
||||
# Note: This takes arbitrary options, to ease addition of new options to the real macro.
|
||||
%pyproject_buildrequires(-) echo 'pyproject-rpm-macros'
|
||||
|
||||
|
||||
# Declarative buildsystem, requires RPM 4.20+ to work
|
||||
@ -2,8 +2,14 @@
|
||||
# For the main Python it's empty, for all others it's "-3.X"
|
||||
%_pyproject_files_pkgversion %{expr:"%{python3_pkgversion}" != "3" ? "-%{python3_pkgversion}" : ""}
|
||||
|
||||
# In RPM < 4.20 (4.19.9x is 4.20 alpha), there is no guaranteed, RPM-controlled per-build directory (%%mkbuilddir step).
|
||||
# Hence we use %%{buildsubdir} if available.
|
||||
# On newer RPM 4.20+ this is no longer necessary and breaks the declarative buildsystem:
|
||||
# https://github.com/rpm-software-management/rpm/issues/3890
|
||||
%_pyproject_buildsubdir_compat %[ v"0%{?rpmversion}" < v"4.19.90" ? "%{?buildsubdir:/%{buildsubdir}}" : ""]
|
||||
|
||||
# This is a directory where wheels are stored and installed from, absolute
|
||||
%_pyproject_wheeldir %{_builddir}%{?buildsubdir:/%{buildsubdir}}/pyproject-wheeldir%{_pyproject_files_pkgversion}
|
||||
%_pyproject_wheeldir %{_builddir}%{_pyproject_buildsubdir_compat}/pyproject-wheeldir%{_pyproject_files_pkgversion}
|
||||
|
||||
# This is a directory used as TMPDIR, where pip copies sources to and builds from, relative to PWD
|
||||
# For proper debugsource packages, we create TMPDIR within PWD
|
||||
@ -12,7 +18,7 @@
|
||||
# This will be used in debugsource package paths (applies to extension modules only)
|
||||
# NB: pytest collects tests from here if not hidden
|
||||
# https://docs.pytest.org/en/latest/reference.html#confval-norecursedirs
|
||||
%_pyproject_builddir %{_builddir}%{?buildsubdir:/%{buildsubdir}}/.pyproject-builddir%{_pyproject_files_pkgversion}
|
||||
%_pyproject_builddir %{_builddir}%{_pyproject_buildsubdir_compat}/.pyproject-builddir%{_pyproject_files_pkgversion}
|
||||
|
||||
# We prefix all created files with this value to make them unique
|
||||
# Ideally, we would put them into %%{buildsubdir}, but that value changes during the spec
|
||||
@ -75,7 +81,7 @@ echo $(IFS=:; echo "${pyproject_build_lib[*]}")
|
||||
|
||||
%pyproject_install() %{expand:\\\
|
||||
specifier=$(ls %{_pyproject_wheeldir}/*.whl | xargs basename --multiple | sed -E 's/([^-]+)-([^-]+)-.+\\\.whl/\\\1==\\\2/')
|
||||
if [ -z $specifier ]; then
|
||||
if [ -z "$specifier" ]; then
|
||||
echo 'ERROR: %%%%pyproject_install found no wheel in %%%%{_pyproject_wheeldir} %{_pyproject_wheeldir}' >&2
|
||||
exit 1
|
||||
fi
|
||||
@ -97,7 +103,7 @@ fi
|
||||
# Process all *.dist-info dirs in sitelib/sitearch
|
||||
for site_dir in ${site_dirs[@]}; do
|
||||
for distinfo in %{buildroot}$site_dir/*.dist-info; do
|
||||
echo "%ghost ${distinfo#%{buildroot}}" >> %{_pyproject_ghost_distinfo}
|
||||
echo "%ghost %dir ${distinfo#%{buildroot}}" >> %{_pyproject_ghost_distinfo}
|
||||
sed -i 's/pip/rpm/' ${distinfo}/INSTALLER
|
||||
PYTHONPATH=%{_rpmconfigdir}/redhat \\
|
||||
%{__python3} -B %{_rpmconfigdir}/redhat/pyproject_preprocess_record.py \\
|
||||
@ -122,7 +128,7 @@ fi
|
||||
# https://github.com/rpm-software-management/rpm/issues/1749#issuecomment-1020420616
|
||||
# Since we support both ways, we pass either 4.19 or 4.18 to the script, so it knows which one to use
|
||||
# Rather than passing the actual version, we let RPM compare the versions, as it is easier done here than in Python
|
||||
%pyproject_save_files(lL) %{expand:\\\
|
||||
%pyproject_save_files(lLM) %{expand:\\\
|
||||
%{expr:v"0%{?rpmversion}" >= v"4.18.90" ? "RPM_FILES_ESCAPE=4.19" : "RPM_FILES_ESCAPE=4.18" } \\
|
||||
%{__python3} %{_rpmconfigdir}/redhat/pyproject_save_files.py \\
|
||||
--output-files "%{pyproject_files}" \\
|
||||
@ -166,7 +172,6 @@ fi
|
||||
]"\
|
||||
]
|
||||
|
||||
# Note: Keep the options in sync with this macro from macros.aaa-pyproject-srpm
|
||||
%pyproject_buildrequires(rRxtNwpe:g:C:) %{expand:\\\
|
||||
%_set_pytest_addopts
|
||||
# The default flags expect the package note file to exist
|
||||
@ -193,6 +198,10 @@ fi
|
||||
fi}
|
||||
}
|
||||
%{-w:
|
||||
%{!?__pyproject_buildrequires_w_warned:%{warn:The %%pyproject_buildrequires -w option is deprecated.
|
||||
It's not efficient to build the wheel several times during the build.
|
||||
The option is not scheduled for removal, but packagers should use the -p option instead.
|
||||
}%global __pyproject_buildrequires_w_warned 1}
|
||||
%{-p:%{error:The -w and -p options are mutually exclusive}}
|
||||
}
|
||||
%{-e:%{expand:%global toxenv %(%{__python3} -s %{_rpmconfigdir}/redhat/pyproject_construct_toxenv.py %{?**})}}
|
||||
@ -216,7 +225,7 @@ if [ -f %{__python3} ]; then
|
||||
echo -n > %{_pyproject_buildrequires}
|
||||
%{_pyproject_build_flags} \\\
|
||||
TMPDIR="%{_pyproject_builddir}" \\\
|
||||
RPM_TOXENV="%{toxenv}" HOSTNAME="rpmbuild" %{__python3} -Bs %{_rpmconfigdir}/redhat/pyproject_buildrequires.py %{?!_python_no_extras_requires:--generate-extras} --python3_pkgversion %{python3_pkgversion} --wheeldir %{_pyproject_wheeldir} --output %{_pyproject_buildrequires} %{?**} >&2
|
||||
RPM_TOXENV="%{toxenv}" FEDORA=%{?fedora} HOSTNAME="rpmbuild" %{__python3} -Bs %{_rpmconfigdir}/redhat/pyproject_buildrequires.py %{?!_python_no_extras_requires:--generate-extras} --python3_pkgversion %{python3_pkgversion} --wheeldir %{_pyproject_wheeldir} --output %{_pyproject_buildrequires} %{?**} >&2
|
||||
cat %{_pyproject_buildrequires}
|
||||
fi
|
||||
# Incomplete .dist-info dir might confuse importlib.metadata
|
||||
@ -231,7 +240,7 @@ PATH="%{buildroot}%{_bindir}:$PATH" \\
|
||||
PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}" \\
|
||||
%{?__pytest_addopts:PYTEST_ADDOPTS="${PYTEST_ADDOPTS:-} %{__pytest_addopts}"}} \\
|
||||
HOSTNAME="rpmbuild" \\
|
||||
%{__python3} -m tox --current-env -q --recreate -e "%{-e:%{-e*}}%{!-e:%{toxenv}}" %{?*}
|
||||
%{__python3} -m tox --current-env --assert-config -q --recreate -e "%{-e:%{-e*}}%{!-e:%{toxenv}}" %{?*}
|
||||
}
|
||||
|
||||
|
||||
125
plan.fmf
Normal file
125
plan.fmf
Normal file
@ -0,0 +1,125 @@
|
||||
execute:
|
||||
how: tmt
|
||||
discover:
|
||||
- name: same_repo
|
||||
how: shell
|
||||
tests:
|
||||
- name: pytest
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-pytest
|
||||
- name: entrypoints
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-entrypoints
|
||||
- name: pluggy
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-pluggy
|
||||
- name: clikit
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-clikit
|
||||
- name: distroinfo
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-distroinfo
|
||||
- name: tldr
|
||||
path: /tests
|
||||
test: ./mocktest.sh tldr
|
||||
- name: openqa_client
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-openqa_client
|
||||
- name: httpbin
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-httpbin
|
||||
- name: ldap
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-ldap
|
||||
- name: isort
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-isort
|
||||
- name: mistune
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-mistune
|
||||
- name: setuptools_scm
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-setuptools_scm
|
||||
- name: ipykernel
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-ipykernel
|
||||
- name: zope
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-zope-event
|
||||
- name: django
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-django
|
||||
- name: printrun
|
||||
path: /tests
|
||||
test: ./mocktest.sh printrun
|
||||
- name: dns_lexicon
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-dns-lexicon
|
||||
- name: flit_core
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-flit-core
|
||||
- name: poetry_core
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-poetry-core
|
||||
- name: setuptools
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-setuptools
|
||||
# No matching package to install: 'python3dist(pallets-sphinx-themes)'
|
||||
# No matching package to install: 'python3dist(sphinxcontrib-log-cabinet)'
|
||||
#- name: markupsafe
|
||||
# path: /tests
|
||||
# test: ./mocktest.sh python-markupsafe
|
||||
- name: getmac
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-getmac
|
||||
- name: userpath
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-userpath
|
||||
- name: markdown_it_py
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-markdown-it-py
|
||||
- name: double_install
|
||||
path: /tests
|
||||
test: ./mocktest.sh double-install
|
||||
- name: fake_requirements
|
||||
path: /tests
|
||||
test: ./mocktest.sh fake-requirements
|
||||
- name: virtualenv
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-virtualenv
|
||||
- name: coverage_pth
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-coverage-pth
|
||||
- name: pello
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-pello
|
||||
- name: pello_with_options
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-pello --with options
|
||||
- name: pello_with_override_install
|
||||
path: /tests
|
||||
test: ./mocktest.sh python-pello --with override_install
|
||||
- name: escape_paths
|
||||
path: /tests
|
||||
test: ./mocktest.sh escape_paths
|
||||
- name: config-settings-test
|
||||
path: /tests
|
||||
test: ./mocktest.sh config-settings-test
|
||||
- name: isort_c9s
|
||||
path: /tests
|
||||
test: NAME="CentOS Stream" VERSION_ID=9 ./mocktest.sh python-isort
|
||||
- name: isort_c10s
|
||||
path: /tests
|
||||
test: NAME="CentOS Stream" VERSION_ID=10 ./mocktest.sh python-isort
|
||||
prepare:
|
||||
- name: Install dependencies
|
||||
how: install
|
||||
package:
|
||||
- 'https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm'
|
||||
- mock
|
||||
- rpmdevtools
|
||||
- rpm-build
|
||||
- dnf
|
||||
- name: Update packages
|
||||
how: shell
|
||||
script: dnf upgrade -y
|
||||
11
pyproject-rpm-macros.rpmlintrc
Normal file
11
pyproject-rpm-macros.rpmlintrc
Normal file
@ -0,0 +1,11 @@
|
||||
# RPM macros, this is expected
|
||||
addFilter(r'only-non-binary-in-usr-lib')
|
||||
|
||||
# we mention macro names in the descriptions and summaries
|
||||
addFilter(r'[EW]: unexpanded-macro (%description|Summary).+ %(py3_|(generate|pyproject)_buildrequires)')
|
||||
|
||||
# terms, not spelling errors
|
||||
addFilter(r"[EW]: spelling-error .+'(cfg|toml|setuptools|buildrequires)'")
|
||||
|
||||
# the documentation is in the other subpackage
|
||||
addFilter(r'pyproject-srpm-macros.noarch: [EW]: no-documentation')
|
||||
@ -14,7 +14,7 @@ License: MIT
|
||||
# Increment Y and reset Z when new macros or features are added
|
||||
# Increment Z when this is a bugfix or a cosmetic change
|
||||
# Dropping support for EOL Fedoras is *not* considered a breaking change
|
||||
Version: 1.16.2
|
||||
Version: 1.18.5
|
||||
Release: 1%{?dist}
|
||||
|
||||
# Macro files
|
||||
@ -59,25 +59,10 @@ BuildRequires: python3dist(packaging)
|
||||
BuildRequires: python3dist(pip)
|
||||
BuildRequires: python3dist(setuptools)
|
||||
%if %{with tox_tests}
|
||||
BuildRequires: python3dist(tox-current-env) >= 0.0.6
|
||||
BuildRequires: python3dist(tox-current-env) >= 0.0.16
|
||||
%endif
|
||||
BuildRequires: python3dist(wheel)
|
||||
BuildRequires: (python3dist(wheel) if python3dist(setuptools) < 71)
|
||||
BuildRequires: (python3dist(tomli) if python3 < 3.11)
|
||||
|
||||
# RHEL 9: We also run pytest with Python 3.11 and 3.12
|
||||
BuildRequires: python3.11dist(pytest)
|
||||
BuildRequires: python3.11dist(pyyaml)
|
||||
BuildRequires: python3.11dist(packaging)
|
||||
BuildRequires: python3.11dist(pip)
|
||||
BuildRequires: python3.11dist(setuptools)
|
||||
BuildRequires: python3.11dist(wheel)
|
||||
|
||||
BuildRequires: python3.12dist(pytest)
|
||||
BuildRequires: python3.12dist(pyyaml)
|
||||
BuildRequires: python3.12dist(packaging)
|
||||
BuildRequires: python3.12dist(pip)
|
||||
BuildRequires: python3.12dist(setuptools)
|
||||
BuildRequires: python3.12dist(wheel)
|
||||
%endif
|
||||
|
||||
# We build on top of those:
|
||||
@ -152,26 +137,12 @@ install -pm 644 pyproject_construct_toxenv.py %{buildroot}%{_rpmconfigdir}/redha
|
||||
install -pm 644 pyproject_requirements_txt.py %{buildroot}%{_rpmconfigdir}/redhat/
|
||||
install -pm 644 pyproject_wheel.py %{buildroot}%{_rpmconfigdir}/redhat/
|
||||
|
||||
%check
|
||||
# assert the two signatures of %%pyproject_buildrequires match exactly
|
||||
signature1="$(grep '^%%pyproject_buildrequires' macros.pyproject | cut -d' ' -f1)"
|
||||
signature2="$(grep '^%%pyproject_buildrequires' macros.aaa-pyproject-srpm | cut -d' ' -f1)"
|
||||
test "$signature1" == "$signature2"
|
||||
# but also assert we are not comparing empty strings
|
||||
test "$signature1" != ""
|
||||
|
||||
%if %{with tests}
|
||||
%check
|
||||
export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856356
|
||||
%pytest -vv --doctest-modules %{?with_pytest_xdist:-n auto} %{!?with_tox_tests:-k "not tox"}
|
||||
|
||||
# RHEL 9 only:
|
||||
%global __pytest pytest-3.11
|
||||
%pytest -vv --doctest-modules -k "not tox"
|
||||
|
||||
# RHEL 9 only:
|
||||
%global __pytest pytest-3.12
|
||||
%pytest -vv --doctest-modules -k "not tox"
|
||||
|
||||
# brp-compress is provided as an argument to get the right directory macro expansion
|
||||
%{python3} compare_mandata.py -f %{_rpmconfigdir}/brp-compress
|
||||
%endif
|
||||
@ -196,6 +167,51 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856
|
||||
|
||||
|
||||
%changelog
|
||||
* Thu Oct 16 2025 Miro Hrončok <mhroncok@redhat.com> - 1.18.5-1
|
||||
- %%pyproject_extras_subpkg: Only %%ghost the dist-info directory, not the content
|
||||
- That way, accidentally unpackaged files within are reported as errors
|
||||
- %%pyproject_save_files: Also save top level typing stub files (.pyi)
|
||||
|
||||
* Mon Sep 01 2025 Miro Hrončok <mhroncok@redhat.com> - 1.18.4-1
|
||||
- Don't exit from pyproject-srpm-macros implementation of %%pyproject_buildrequires
|
||||
- Fixes: rhbz#2391290
|
||||
- On RPM 4.20+ don't put pyproject-macros-specific files in %%buildsubdir
|
||||
- Works around https://github.com/rpm-software-management/rpm/issues/3890
|
||||
- Speed %%pyproject_save_files up significantly
|
||||
|
||||
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.18.3-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
|
||||
|
||||
* Fri Jul 11 2025 Miro Hrončok <mhroncok@redhat.com> - 1.18.3-1
|
||||
- %%pyproject_buildrequires: Do not generate BuildRequires from Requires core metadata fields
|
||||
- That field is deprecated and should include importable module names, not distribution packages
|
||||
- Related: rhbz#2378463
|
||||
|
||||
* Mon May 19 2025 Maxwell G <maxwell@gtmx.me> - 1.18.2-1
|
||||
- Fix handling of config_settings in %%pyproject_buildrequires
|
||||
|
||||
* Fri Mar 21 2025 Miro Hrončok <mhroncok@redhat.com> - 1.18.1-1
|
||||
- Fix reverted conditional in %%pyproject_buildrequires -t/-e Fedora version comparison
|
||||
|
||||
* Tue Mar 11 2025 Miro Hrončok <mhroncok@redhat.com> - 1.18.0-1
|
||||
- Make %%pyproject_buildrequires -t/-e and %%tox fail when no suitable tox configuration exists
|
||||
- The %%pyproject_buildrequires -t/-e case is temporarily allowed on Fedora 40-42
|
||||
- Requires tox-current-env >= 0.0.16
|
||||
|
||||
* Thu Jan 30 2025 Miro Hrončok <miro@hroncok.cz> - 1.17.0-1
|
||||
- Add the -M flag to %%pyproject_save_files
|
||||
- The flag can be used to indicate no Python modules should be saved
|
||||
|
||||
* Sat Jan 18 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.16.4-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
|
||||
|
||||
* Tue Dec 03 2024 Miro Hrončok <mhroncok@redhat.com> - 1.16.4-1
|
||||
- Deprecate the provisional -w flag for %%pyproject_buildrequires
|
||||
|
||||
* Tue Dec 03 2024 Miro Hrončok <mhroncok@redhat.com> - 1.16.3-1
|
||||
- Accept arbitrary options from %%pyproject_buildrequires in pyproject-srpm-macros
|
||||
- This will make future additions smoother
|
||||
|
||||
* Wed Nov 13 2024 Miro Hrončok <mhroncok@redhat.com> - 1.16.2-1
|
||||
- Fix one remaining test for setuptools 70+
|
||||
|
||||
@ -242,6 +258,12 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856
|
||||
- That way, a single-spec can be used to build packages for multiple Python versions
|
||||
- Fixes: rhbz#2209055
|
||||
|
||||
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.0-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Wed Sep 27 2023 Miro Hrončok <mhroncok@redhat.com> - 1.11.0-1
|
||||
- Add the -l/-L flag to %%pyproject_save_files
|
||||
- The -l flag can be used to assert at least 1 License-File was detected
|
||||
@ -258,8 +280,12 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856
|
||||
- Fix handling of tox 4 provision without an explicit tox minversion
|
||||
- Fixes: rhbz#2240590
|
||||
|
||||
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.0-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||
|
||||
* Wed May 31 2023 Maxwell G <maxwell@gtmx.me> - 1.9.0-1
|
||||
- Allow passing config_settings to the build backend.
|
||||
- Resolves: rhbz#2192581
|
||||
|
||||
* Wed May 31 2023 Miro Hrončok <mhroncok@redhat.com> - 1.8.1-1
|
||||
- On Python older than 3.11, use tomli instead of deprecated toml
|
||||
@ -270,12 +296,14 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856
|
||||
|
||||
* Thu Apr 27 2023 Miro Hrončok <mhroncok@redhat.com> - 1.8.0-1
|
||||
- %%pyproject_buildrequires: Add support for self-referential extras requirements
|
||||
Fixes: rhbz#2171343
|
||||
- Deprecate the provisional %%{pyproject_build_lib} macro
|
||||
See https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/thread/HMLOPAU3RZLXD4BOJHTIPKI3I4U6U7OE/
|
||||
|
||||
* Fri Mar 31 2023 Miro Hrončok <mhroncok@redhat.com> - 1.7.0-1
|
||||
- %%pyproject_buildrequires: Redirect stdout to stderr via Shell
|
||||
- Dependencies are recorded to a text file that is catted at the end
|
||||
- Fixes: rhbz#2183519
|
||||
|
||||
* Mon Feb 13 2023 Lumír Balhar <lbalhar@redhat.com> - 1.6.3-1
|
||||
- Remove .dist-info directory at the end of %%pyproject_buildrequires
|
||||
@ -283,24 +311,31 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856
|
||||
|
||||
* Wed Feb 08 2023 Lumír Balhar <lbalhar@redhat.com> - 1.6.2-1
|
||||
- Improve detection of lang files
|
||||
- Fixes: rhbz#2166295
|
||||
|
||||
* Fri Feb 03 2023 Miro Hrončok <mhroncok@redhat.com> - 1.6.1-1
|
||||
- %%pyproject_buildrequires: Avoid leaking stdout from subprocesses
|
||||
- Fixes: rhbz#2166888
|
||||
|
||||
* Fri Jan 20 2023 Miro Hrončok <miro@hroncok.cz> - 1.6.0-1
|
||||
- Add pyproject-srpm-macros with a minimal %%pyproject_buildrequires macro
|
||||
|
||||
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.1-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||
|
||||
* Fri Jan 13 2023 Miro Hrončok <mhroncok@redhat.com> - 1.5.1-1
|
||||
- Adjusts %%pyproject_buildrequires tests for tox 4
|
||||
- Fixes: rhbz#2160687
|
||||
|
||||
* Mon Nov 28 2022 Miro Hrončok <mhroncok@redhat.com> - 1.5.0-1
|
||||
- Use %%py3_test_envvars in %%tox when available
|
||||
|
||||
* Mon Sep 19 2022 Python Maint <python-maint@redhat.com> - 1.4.0-1
|
||||
- %%pyproject_save_files: Support License-Files installed into the *Root License Directory* from PEP 639
|
||||
|
||||
- Fixes: rhbz#2127946
|
||||
- %%pyproject_check_import: Import only the modules whose top-level names
|
||||
match any of the globs provided to %%pyproject_save_files
|
||||
- Fixes: rhbz#2127958
|
||||
|
||||
* Tue Aug 30 2022 Otto Liljalaakso <otto.liljalaakso@iki.fi> - 1.3.4-1
|
||||
- Fix typo in internal function name
|
||||
@ -308,10 +343,15 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856
|
||||
* Tue Aug 09 2022 Karolina Surma <ksurma@redhat.com> - 1.3.3-1
|
||||
- Don't fail %%pyproject_save_files '*' if no modules are detected
|
||||
|
||||
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.2-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
* Wed Jun 15 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.3.2-1
|
||||
- Update %%pyproject_build_lib to support setuptools 62.1.0 and later
|
||||
- Fixes: rhbz#2097158
|
||||
- %%pyproject_buildrequires: When extension modules are built,
|
||||
support https://fedoraproject.org/wiki/Changes/Package_information_on_ELF_objects
|
||||
- Fixes: rhbz#2097535
|
||||
|
||||
* Fri May 27 2022 Owen Taylor <otaylor@redhat.com> - 1.3.1-1
|
||||
- %%pyproject_install: pass %%{_prefix} explicitly to pip install
|
||||
@ -324,9 +364,11 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856
|
||||
prepare_metadata_for_build_wheel hook
|
||||
When used, the wheel is built in %%pyproject_buildrequires
|
||||
and information about runtime requires and extras is read from that wheel.
|
||||
- Fixes: rhbz#2076994
|
||||
|
||||
* Tue Apr 12 2022 Miro Hrončok <mhroncok@redhat.com> - 1.1.0-1
|
||||
- %%pyproject_save_files: Support nested directories in dist-info
|
||||
- Fixes: rhbz#1985340
|
||||
|
||||
* Tue Mar 22 2022 Miro Hrončok <mhroncok@redhat.com> - 1.0.1-1
|
||||
- Prefix paths of intermediate files (such as %%{pyproject_files}) with NVRA
|
||||
@ -346,6 +388,7 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856
|
||||
|
||||
* Wed Jan 19 2022 Karolina Surma <ksurma@redhat.com> - 0-54
|
||||
- Include compressed manpages to the package if flag '+auto' is provided to %%pyproject_save_files
|
||||
- Fixes: rhbz#2033254
|
||||
|
||||
* Fri Jan 14 2022 Miro Hrončok <mhroncok@redhat.com> - 0-53
|
||||
- %%pyproject_buildrequires: Make -r (include runtime) the default, use -R to opt-out
|
||||
@ -368,6 +411,7 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856
|
||||
|
||||
* Sat Oct 16 2021 Miro Hrončok <mhroncok@redhat.com> - 0-48
|
||||
- %%pyproject_buildrequires: Accept installed pre-releases for all requirements
|
||||
- Fixes: rhbz#2014639
|
||||
|
||||
* Thu Sep 09 2021 Miro Hrončok <mhroncok@redhat.com> - 0-47
|
||||
- %%pyproject_save_files: Expand the namespace error message, also display it with /
|
||||
@ -375,6 +419,7 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856
|
||||
|
||||
* Fri Jul 23 2021 Miro Hrončok <miro@hroncok.cz> - 0-46
|
||||
- %%pyproject_buildrequires now fails when it encounters an invalid requirement
|
||||
- Fixes: rhbz#1983053
|
||||
- Rename %%_pyproject_ghost_distinfo and %%_pyproject_record to indicate they are private
|
||||
- Automatically detect LICENSE files and mark them with %%license macro
|
||||
|
||||
@ -383,36 +428,34 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856
|
||||
|
||||
* Fri Jul 09 2021 Python Maint <python-maint@redhat.com> - 0-44
|
||||
- Escape weird paths generated by %%pyproject_save_files
|
||||
- Fixes rhbz#1976363
|
||||
- Support x.* versions in %%pyproject_buildrequires
|
||||
- Fixes rhbz#1981558
|
||||
- %%pyproject_buildrequires fallbacks to setuptools only if setup.py exists
|
||||
- Fixes: rhbz#1976459
|
||||
- Explicitly require the "basic" Python RPM macros
|
||||
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
||||
Related: rhbz#1991688
|
||||
|
||||
* Thu Jul 01 2021 Tomas Hrnciar <thrnciar@redhat.com> - 0-43
|
||||
- Generate BuildRequires from file
|
||||
- Fixes: rhbz#1936448
|
||||
|
||||
* Tue Jun 29 2021 Miro Hrončok <mhroncok@redhat.com> - 0-42
|
||||
- Don't accidentally treat "~= X.0" requirement as "~= X"
|
||||
- Fixes rhzb#1977060
|
||||
- Fixes rhbz#1977060
|
||||
|
||||
* Mon Jun 28 2021 Miro Hrončok <mhroncok@redhat.com> - 0-41
|
||||
- Don't leak %%{_pyproject_builddir} to pytest collection
|
||||
- Fixes rhbz#1935212
|
||||
|
||||
* Thu May 27 2021 Miro Hrončok <mhroncok@redhat.com> - 0-40
|
||||
- Don't leak $TMPDIR outside of pyproject macros
|
||||
- Set %%_pyproject_wheeldir and %%_pyproject_builddir relative to the source tree, not $PWD
|
||||
|
||||
* Thu Apr 22 2021 Miro Hrončok <mhroncok@redhat.com> - 0-39.2
|
||||
* Mon Mar 29 2021 Miro Hrončok <mhroncok@redhat.com> - 0-39
|
||||
- Handle tox provision (tox.requires / tox.minversion)
|
||||
- Fixes: rhbz#1922495
|
||||
- Generate BuildRequires on extras in lower case
|
||||
- Fixes: rhbz#1947074
|
||||
|
||||
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 0-39.1
|
||||
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
|
||||
|
||||
* Mon Mar 08 2021 Charalampos Stratakis <cstratak@redhat.com> - 0-38.1
|
||||
- Disable tests on RHEL9 to remove tox dependency
|
||||
- Fixes: rhbz#1937944
|
||||
|
||||
* Sun Feb 07 2021 Miro Hrončok <mhroncok@redhat.com> - 0-38
|
||||
- Include nested __pycache__ directories in %%pyproject_save_files
|
||||
@ -22,6 +22,15 @@ from pyproject_wheel import parse_config_settings_args
|
||||
# Allow only the forms we know we can handle.
|
||||
VERSION_RE = re.compile(r'[a-zA-Z0-9.-]+(\.\*)?')
|
||||
|
||||
# To avoid breakage on Fedora 40-42,
|
||||
# we don't assert tox configuration there.
|
||||
# This can be removed when Fedora 42 goes EOL.
|
||||
# Note that %tox still uses --assert-config
|
||||
# because %tox without config is dangerous (false sense of tests).
|
||||
# Running %pyproject_buildrequires -t/-e without tox config is wrong, but not dangerous.
|
||||
FEDORA = int(os.getenv('FEDORA') or 0)
|
||||
TOX_ASSERT_CONFIG_OPTS = () if 40 <= FEDORA < 43 else ('--assert-config',)
|
||||
|
||||
|
||||
class EndPass(Exception):
|
||||
"""End current pass of generating requirements"""
|
||||
@ -290,7 +299,7 @@ def get_backend(requirements):
|
||||
def generate_build_requirements(backend, requirements):
|
||||
get_requires = getattr(backend, 'get_requires_for_build_wheel', None)
|
||||
if get_requires:
|
||||
new_reqs = get_requires(config_settings=requirements.config_settings)
|
||||
new_reqs = get_requires(requirements.config_settings)
|
||||
requirements.extend(new_reqs, source='get_requires_for_build_wheel')
|
||||
requirements.check(source='get_requires_for_build_wheel')
|
||||
|
||||
@ -300,7 +309,7 @@ def parse_metadata_file(metadata_file):
|
||||
|
||||
|
||||
def requires_from_parsed_metadata_file(message):
|
||||
return {k: message.get_all(k, ()) for k in ('Requires', 'Requires-Dist')}
|
||||
return {k: message.get_all(k, ()) for k in ('Requires-Dist',)}
|
||||
|
||||
|
||||
def package_name_from_parsed_metadata_file(message):
|
||||
@ -323,10 +332,9 @@ def generate_run_requirements_hook(backend, requirements):
|
||||
'(incl. runtime requirements) before build. '
|
||||
'If the dependencies are specified in the pyproject.toml [project] '
|
||||
'table, you can use the -p flag to read them. '
|
||||
'Alternatively, use the provisional -w flag to build the wheel and parse the metadata from it, '
|
||||
'or use the -R flag not to generate runtime dependencies.'
|
||||
'Alternatively, use the -R flag not to generate runtime dependencies.'
|
||||
)
|
||||
dir_basename = prepare_metadata('.', config_settings=requirements.config_settings)
|
||||
dir_basename = prepare_metadata('.', requirements.config_settings)
|
||||
with open(dir_basename + '/METADATA') as metadata_file:
|
||||
name, requires = package_name_and_requires_from_metadata_file(metadata_file)
|
||||
for key, req in requires.items():
|
||||
@ -417,7 +425,7 @@ def generate_run_requirements(backend, requirements, *, build_wheel, read_pyproj
|
||||
|
||||
def generate_tox_requirements(toxenv, requirements):
|
||||
toxenv = ','.join(toxenv)
|
||||
requirements.add('tox-current-env >= 0.0.6', source='tox itself')
|
||||
requirements.add('tox-current-env >= 0.0.16', source='tox itself')
|
||||
requirements.check(source='tox itself')
|
||||
with tempfile.NamedTemporaryFile('r') as deps, \
|
||||
tempfile.NamedTemporaryFile('r') as extras, \
|
||||
@ -427,6 +435,7 @@ def generate_tox_requirements(toxenv, requirements):
|
||||
'--print-deps-to', deps.name,
|
||||
'--print-extras-to', extras.name,
|
||||
'--no-provision', provision.name,
|
||||
*TOX_ASSERT_CONFIG_OPTS,
|
||||
'-q', '-r', '-e', toxenv],
|
||||
check=False,
|
||||
encoding='utf-8',
|
||||
@ -669,7 +678,7 @@ def main(argv):
|
||||
parser.add_argument(
|
||||
'-w', '--wheel', action='store_true', default=False,
|
||||
help=('Generate run-time requirements by building the wheel '
|
||||
'(useful for build backends without the prepare_metadata_for_build_wheel hook)'),
|
||||
'(useful for build backends without the prepare_metadata_for_build_wheel hook, deprecated)'),
|
||||
)
|
||||
parser.add_argument(
|
||||
'-p', '--read-pyproject-dependencies', action='store_true', default=False,
|
||||
@ -456,7 +456,7 @@ tox dependencies:
|
||||
setuptools: 50
|
||||
wheel: 1
|
||||
tox: 3.5.3
|
||||
tox-current-env: 0.0.6
|
||||
tox-current-env: 0.0.16
|
||||
toxenv:
|
||||
- py3
|
||||
setup.py: |
|
||||
@ -479,13 +479,13 @@ tox dependencies:
|
||||
- | # tox 3 with setuptools < 70
|
||||
python3dist(setuptools) >= 40.8
|
||||
python3dist(wheel)
|
||||
python3dist(tox-current-env) >= 0.0.6
|
||||
python3dist(tox-current-env) >= 0.0.16
|
||||
python3dist(toxdep1)
|
||||
python3dist(toxdep2)
|
||||
python3dist(inst)
|
||||
- | # tox 4 with setuptools 70+
|
||||
python3dist(setuptools) >= 40.8
|
||||
python3dist(tox-current-env) >= 0.0.6
|
||||
python3dist(tox-current-env) >= 0.0.16
|
||||
python3dist(tox)
|
||||
python3dist(toxdep1)
|
||||
python3dist(toxdep2)
|
||||
@ -493,7 +493,7 @@ tox dependencies:
|
||||
- | # tox 4 with setuptools < 70
|
||||
python3dist(setuptools) >= 40.8
|
||||
python3dist(wheel)
|
||||
python3dist(tox-current-env) >= 0.0.6
|
||||
python3dist(tox-current-env) >= 0.0.16
|
||||
python3dist(tox)
|
||||
python3dist(toxdep1)
|
||||
python3dist(toxdep2)
|
||||
@ -505,7 +505,7 @@ tox extras:
|
||||
setuptools: 50
|
||||
wheel: 1
|
||||
tox: 3.5.3
|
||||
tox-current-env: 0.0.6
|
||||
tox-current-env: 0.0.16
|
||||
generate_extras: true
|
||||
toxenv:
|
||||
- py3
|
||||
@ -536,7 +536,7 @@ tox extras:
|
||||
- | # tox 3 with setuptools < 70
|
||||
python3dist(setuptools) >= 40.8
|
||||
python3dist(wheel)
|
||||
python3dist(tox-current-env) >= 0.0.6
|
||||
python3dist(tox-current-env) >= 0.0.16
|
||||
python3dist(toxdep)
|
||||
python3dist(inst)
|
||||
python3dist(dep11) > 11.0
|
||||
@ -548,7 +548,7 @@ tox extras:
|
||||
python3dist(extra-dep[extra_dep])
|
||||
- | # tox 4 with setuptools 70+
|
||||
python3dist(setuptools) >= 40.8
|
||||
python3dist(tox-current-env) >= 0.0.6
|
||||
python3dist(tox-current-env) >= 0.0.16
|
||||
python3dist(tox)
|
||||
python3dist(toxdep)
|
||||
python3dist(inst)
|
||||
@ -562,7 +562,7 @@ tox extras:
|
||||
- | # tox 4 with setuptools < 70
|
||||
python3dist(setuptools) >= 40.8
|
||||
python3dist(wheel)
|
||||
python3dist(tox-current-env) >= 0.0.6
|
||||
python3dist(tox-current-env) >= 0.0.16
|
||||
python3dist(tox)
|
||||
python3dist(toxdep)
|
||||
python3dist(inst)
|
||||
@ -580,7 +580,7 @@ tox provision unsatisfied:
|
||||
setuptools: 50
|
||||
wheel: 1
|
||||
tox: 3.5.3
|
||||
tox-current-env: 0.0.6
|
||||
tox-current-env: 0.0.16
|
||||
toxenv:
|
||||
- py3
|
||||
setup.py: |
|
||||
@ -604,13 +604,13 @@ tox provision unsatisfied:
|
||||
- | # tox 3 with setuptools < 70
|
||||
python3dist(setuptools) >= 40.8
|
||||
python3dist(wheel)
|
||||
python3dist(tox-current-env) >= 0.0.6
|
||||
python3dist(tox-current-env) >= 0.0.16
|
||||
python3dist(tox) >= 3.999
|
||||
python3dist(setuptools) > 40.0
|
||||
python3dist(wheel) > 2.0
|
||||
- | # tox 4 with setuptools 70+
|
||||
python3dist(setuptools) >= 40.8
|
||||
python3dist(tox-current-env) >= 0.0.6
|
||||
python3dist(tox-current-env) >= 0.0.16
|
||||
python3dist(tox) >= 3.999
|
||||
python3dist(setuptools) > 40.0
|
||||
python3dist(wheel) > 2.0
|
||||
@ -618,7 +618,7 @@ tox provision unsatisfied:
|
||||
- | # tox 4 with setuptools < 70
|
||||
python3dist(setuptools) >= 40.8
|
||||
python3dist(wheel)
|
||||
python3dist(tox-current-env) >= 0.0.6
|
||||
python3dist(tox-current-env) >= 0.0.16
|
||||
python3dist(tox) >= 3.999
|
||||
python3dist(setuptools) > 40.0
|
||||
python3dist(wheel) > 2.0
|
||||
@ -630,7 +630,7 @@ tox provision satisfied:
|
||||
setuptools: 50
|
||||
wheel: 1
|
||||
tox: 3.5.3
|
||||
tox-current-env: 0.0.6
|
||||
tox-current-env: 0.0.16
|
||||
toxenv:
|
||||
- py3
|
||||
setup.py: |
|
||||
@ -653,7 +653,7 @@ tox provision satisfied:
|
||||
- | # tox 3 with setuptools < 70
|
||||
python3dist(setuptools) >= 40.8
|
||||
python3dist(wheel)
|
||||
python3dist(tox-current-env) >= 0.0.6
|
||||
python3dist(tox-current-env) >= 0.0.16
|
||||
python3dist(tox) >= 3.5
|
||||
python3dist(setuptools) > 40.0
|
||||
python3dist(toxdep1)
|
||||
@ -661,7 +661,7 @@ tox provision satisfied:
|
||||
python3dist(inst)
|
||||
- | # tox 4 with setuptools 70+
|
||||
python3dist(setuptools) >= 40.8
|
||||
python3dist(tox-current-env) >= 0.0.6
|
||||
python3dist(tox-current-env) >= 0.0.16
|
||||
python3dist(setuptools) > 40.0
|
||||
python3dist(tox) >= 3.5
|
||||
python3dist(toxdep1)
|
||||
@ -670,7 +670,7 @@ tox provision satisfied:
|
||||
- | # tox 4 with setuptools < 70
|
||||
python3dist(setuptools) >= 40.8
|
||||
python3dist(wheel)
|
||||
python3dist(tox-current-env) >= 0.0.6
|
||||
python3dist(tox-current-env) >= 0.0.16
|
||||
python3dist(setuptools) > 40.0
|
||||
python3dist(tox) >= 3.5
|
||||
python3dist(toxdep1)
|
||||
@ -683,7 +683,7 @@ tox provision no minversion:
|
||||
setuptools: 50
|
||||
wheel: 1
|
||||
tox: 3.5.3
|
||||
tox-current-env: 0.0.6
|
||||
tox-current-env: 0.0.16
|
||||
toxenv:
|
||||
- py3
|
||||
setup.py: |
|
||||
@ -701,19 +701,19 @@ tox provision no minversion:
|
||||
- | # tox 3 with setuptools < 70
|
||||
python3dist(setuptools) >= 40.8
|
||||
python3dist(wheel)
|
||||
python3dist(tox-current-env) >= 0.0.6
|
||||
python3dist(tox-current-env) >= 0.0.16
|
||||
python3dist(setuptools) > 40.0
|
||||
python3dist(wheel) > 2.0
|
||||
- | # tox 4 with setuptools 70+
|
||||
python3dist(setuptools) >= 40.8
|
||||
python3dist(tox-current-env) >= 0.0.6
|
||||
python3dist(tox-current-env) >= 0.0.16
|
||||
python3dist(setuptools) > 40.0
|
||||
python3dist(wheel) > 2.0
|
||||
python3dist(tox)
|
||||
- | # tox 4 with setuptools < 70
|
||||
python3dist(setuptools) >= 40.8
|
||||
python3dist(wheel)
|
||||
python3dist(tox-current-env) >= 0.0.6
|
||||
python3dist(tox-current-env) >= 0.0.16
|
||||
python3dist(setuptools) > 40.0
|
||||
python3dist(wheel) > 2.0
|
||||
python3dist(tox)
|
||||
@ -1573,7 +1573,7 @@ tox with dependency_groups:
|
||||
setuptools: 50
|
||||
wheel: 1
|
||||
tox: 4.22
|
||||
tox-current-env: 0.0.14
|
||||
tox-current-env: 0.0.16
|
||||
toxenv:
|
||||
- py3
|
||||
pyproject.toml: |
|
||||
@ -1594,7 +1594,7 @@ tox with dependency_groups:
|
||||
expected:
|
||||
- | # setuptools 70+
|
||||
python3dist(setuptools)
|
||||
python3dist(tox-current-env) >= 0.0.6
|
||||
python3dist(tox-current-env) >= 0.0.16
|
||||
python3dist(tox) >= 4.22
|
||||
python3dist(tox)
|
||||
python3dist(pytest) >= 5
|
||||
@ -1602,9 +1602,29 @@ tox with dependency_groups:
|
||||
- | # setuptools < 70
|
||||
python3dist(setuptools)
|
||||
python3dist(wheel)
|
||||
python3dist(tox-current-env) >= 0.0.6
|
||||
python3dist(tox-current-env) >= 0.0.16
|
||||
python3dist(tox) >= 4.22
|
||||
python3dist(tox)
|
||||
python3dist(pytest) >= 5
|
||||
python3dist(pytest-mock)
|
||||
result: 0
|
||||
|
||||
Plain Requires fields in core metadata is ignored:
|
||||
installed:
|
||||
setuptools: 50
|
||||
wheel: 1
|
||||
include_runtime: true
|
||||
setup.py: |
|
||||
from setuptools import setup
|
||||
setup(
|
||||
name='test',
|
||||
version='0.1',
|
||||
requires=['ignore_me'],
|
||||
)
|
||||
expected:
|
||||
- | # setuptools 70+
|
||||
python3dist(setuptools) >= 40.8
|
||||
- | # setuptools < 70
|
||||
python3dist(setuptools) >= 40.8
|
||||
python3dist(wheel)
|
||||
result: 0
|
||||
@ -137,12 +137,11 @@ def add_file_to_module(paths, module_name, module_type, files_dirs, *files):
|
||||
"""
|
||||
for module in paths["modules"][module_name]:
|
||||
if module["type"] == module_type:
|
||||
if files[0] not in module[files_dirs]:
|
||||
module[files_dirs].extend(files)
|
||||
module[files_dirs].update(files)
|
||||
break
|
||||
else:
|
||||
paths["modules"][module_name].append(
|
||||
{"type": module_type, "files": [], "dirs": [], files_dirs: list(files)}
|
||||
{"type": module_type, "files": set(), "dirs": set(), files_dirs: set(files)}
|
||||
)
|
||||
|
||||
|
||||
@ -348,7 +347,7 @@ def classify_paths(
|
||||
"docs": [], # to be used once there is upstream way to recognize READMEs
|
||||
"licenses": [], # %license entries parsed from dist-info METADATA file
|
||||
},
|
||||
"lang": {}, # %lang entries: [module_name or None][language_code] lists of .mo files
|
||||
"lang": {}, # %lang entries: [module_name or None][language_code] lists of .mo and .qm files
|
||||
"modules": defaultdict(list), # each importable module (directory, .py, .so)
|
||||
"module_names": set(), # qualified names of each importable module ("foo.bar.baz")
|
||||
"other": {"files": []}, # regular %file entries we could not parse :(
|
||||
@ -357,7 +356,7 @@ def classify_paths(
|
||||
license_files = metadata.get_all('License-File')
|
||||
license_directory = distinfo / 'licenses' # See PEP 639 "Root License Directory"
|
||||
# setuptools was the first known build backend to implement License-File.
|
||||
# Unfortunately they don't put licenses to the license directory (yet):
|
||||
# Unfortunately they didn't put licenses to the license directory in setuptools<78:
|
||||
# https://github.com/pypa/setuptools/issues/3596
|
||||
# Hence, we check licenses in both licenses and dist-info
|
||||
license_directories = (license_directory, distinfo)
|
||||
@ -396,6 +395,9 @@ def classify_paths(
|
||||
# extension modules can have 2 suffixes
|
||||
name = BuildrootPath(path.stem).stem
|
||||
add_file_to_module(paths, name, "extension", "files", path)
|
||||
elif path.suffix == ".pyi":
|
||||
name = path.stem
|
||||
add_file_to_module(paths, name, "stub", "files", path)
|
||||
elif path.suffix == ".py":
|
||||
name = path.stem
|
||||
# we add the .pyc files, but not top-level __pycache__
|
||||
@ -412,7 +414,7 @@ def classify_paths(
|
||||
for parent in list(path.parents)[:index]: # no direct slice until Python 3.10
|
||||
add_file_to_module(paths, module_dir.name, "package", "dirs", parent)
|
||||
is_lang = False
|
||||
if path.suffix == ".mo":
|
||||
if path.suffix == ".mo" or path.suffix == ".qm":
|
||||
is_lang = add_lang_to_module(paths, module_dir.name, path)
|
||||
if not is_lang:
|
||||
if path.suffix == ".py":
|
||||
@ -425,7 +427,7 @@ def classify_paths(
|
||||
add_file_to_module(paths, module_dir.name, "package", "files", path)
|
||||
break
|
||||
else:
|
||||
if path.suffix == ".mo":
|
||||
if path.suffix == ".mo" or path.suffix == ".qm":
|
||||
add_lang_to_module(paths, None, path) or paths["other"]["files"].append(path)
|
||||
else:
|
||||
path = normalize_manpage_filename(prefix, path)
|
||||
@ -614,7 +616,9 @@ def generate_file_list(paths_dict, module_globs, include_others=False):
|
||||
# Users using '*' don't care about the files in the package, so it's ok
|
||||
# not to fail the build when no modules are detected
|
||||
# There can be legitimate reasons to create a package without Python modules
|
||||
if not modules and fnmatch.fnmatchcase("", glob):
|
||||
if not modules:
|
||||
for glob in module_globs:
|
||||
if fnmatch.fnmatchcase("", glob):
|
||||
done_globs.add(glob)
|
||||
|
||||
missed = module_globs - done_globs
|
||||
@ -782,7 +786,7 @@ def dist_metadata(buildroot, record_path):
|
||||
return dist.metadata
|
||||
|
||||
|
||||
def pyproject_save_files_and_modules(buildroot, sitelib, sitearch, python_version, pyproject_record, prefix, assert_license, varargs):
|
||||
def pyproject_save_files_and_modules(buildroot, sitelib, sitearch, python_version, pyproject_record, prefix, assert_license, allow_no_modules, varargs):
|
||||
"""
|
||||
Takes arguments from the %{pyproject_save_files} macro
|
||||
|
||||
@ -797,6 +801,15 @@ def pyproject_save_files_and_modules(buildroot, sitelib, sitearch, python_versio
|
||||
sitedirs = sorted({sitelib, sitearch})
|
||||
|
||||
globs, include_auto = parse_varargs(varargs)
|
||||
if not globs and not allow_no_modules:
|
||||
raise ValueError(
|
||||
"At least one module glob needs to be provided to %pyproject_save_files. "
|
||||
"Alternatively, use -M to indicate no Python modules should be saved."
|
||||
)
|
||||
if globs and allow_no_modules:
|
||||
raise ValueError(
|
||||
"%pyproject_save_files -M cannot be used together with module globs."
|
||||
)
|
||||
parsed_records = load_parsed_record(pyproject_record)
|
||||
|
||||
final_file_list = []
|
||||
@ -840,6 +853,7 @@ def main(cli_args):
|
||||
cli_args.pyproject_record,
|
||||
cli_args.prefix,
|
||||
cli_args.assert_license,
|
||||
cli_args.allow_no_modules,
|
||||
cli_args.varargs,
|
||||
)
|
||||
|
||||
@ -853,7 +867,7 @@ def argparser():
|
||||
prog="%pyproject_save_files",
|
||||
add_help=False,
|
||||
# custom usage to add +auto
|
||||
usage="%(prog)s [-l|-L] MODULE_GLOB [MODULE_GLOB ...] [+auto]",
|
||||
usage="%(prog)s [-l|-L] MODULE_GLOB|-M [MODULE_GLOB ...] [+auto]",
|
||||
)
|
||||
parser.add_argument(
|
||||
'--help', action='help',
|
||||
@ -878,7 +892,11 @@ def argparser():
|
||||
help="Don't fail when no License-File (PEP 639) is found (the default).",
|
||||
)
|
||||
parser.add_argument(
|
||||
"varargs", nargs="+", metavar="MODULE_GLOB",
|
||||
"-M", "--allow-no-modules", action="store_true", default=False,
|
||||
help="Don't fail when no globs are provided, only include non-modules data in the generated filelist.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"varargs", nargs="*", metavar="MODULE_GLOB",
|
||||
help="Shell-like glob matching top-level module names to save into %%{pyproject_files}",
|
||||
)
|
||||
return parser
|
||||
@ -213,6 +213,10 @@ classified:
|
||||
- /usr/lib/python3.7/site-packages/__pycache__/tldr.cpython-37{,.opt-?}.pyc
|
||||
dirs: []
|
||||
type: script
|
||||
- files:
|
||||
- /usr/lib/python3.7/site-packages/tldr.pyi
|
||||
dirs: []
|
||||
type: stub
|
||||
other:
|
||||
files:
|
||||
- /usr/bin/tldr
|
||||
@ -7572,6 +7576,7 @@ dumped:
|
||||
- /usr/lib/python3.7/site-packages/tldr-0.5.dist-info/WHEEL
|
||||
- /usr/lib/python3.7/site-packages/tldr-0.5.dist-info/top_level.txt
|
||||
- /usr/lib/python3.7/site-packages/tldr.py
|
||||
- /usr/lib/python3.7/site-packages/tldr.pyi
|
||||
- /usr/share/man/man1/tldr*
|
||||
- - tldr
|
||||
- - mistune
|
||||
@ -15665,6 +15670,7 @@ records:
|
||||
tldr-0.5.dist-info/WHEEL,sha256=S8S5VL-stOTSZDYxHyf0KP7eds0J72qrK0Evu3TfyAY,92
|
||||
tldr-0.5.dist-info/top_level.txt,sha256=xHSI9WD6Y-_hONbi2b_9RIn9oiO7RBGHU3A8geJq3mI,5
|
||||
tldr.py,sha256=aJlA3tIz4QYYy8e7DZUhPyLCqTwnfFjA7Nubwm9bPe0,12779
|
||||
tldr.pyi,sha256=GxQ4ZGLPQObN92QW_Hb8IJPEuYINNn186FjrRovM09g,13
|
||||
|
||||
mistune:
|
||||
path: /usr/lib64/python3.7/site-packages/mistune-0.8.3.dist-info/RECORD
|
||||
7
rpminspect.yaml
Normal file
7
rpminspect.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
# completely disabled inspections:
|
||||
inspections:
|
||||
# there is no upstream and we regularly change all files
|
||||
addedfiles: off
|
||||
changedfiles: off
|
||||
filesize: off
|
||||
upstream: off
|
||||
@ -9,3 +9,4 @@ tldr-0.5.dist-info/RECORD,,
|
||||
tldr-0.5.dist-info/WHEEL,sha256=S8S5VL-stOTSZDYxHyf0KP7eds0J72qrK0Evu3TfyAY,92
|
||||
tldr-0.5.dist-info/top_level.txt,sha256=xHSI9WD6Y-_hONbi2b_9RIn9oiO7RBGHU3A8geJq3mI,5
|
||||
tldr.py,sha256=aJlA3tIz4QYYy8e7DZUhPyLCqTwnfFjA7Nubwm9bPe0,12779
|
||||
tldr.pyi,sha256=GxQ4ZGLPQObN92QW_Hb8IJPEuYINNn186FjrRovM09g,13
|
||||
@ -102,15 +102,15 @@ def test_data(case_name, capfd, tmp_path, monkeypatch):
|
||||
assert 'expected' in case or 'stderr_contains' in case
|
||||
|
||||
out, err = capfd.readouterr()
|
||||
dependencies = output.read_text()
|
||||
dependencies = sorted(output.read_text().splitlines())
|
||||
|
||||
if 'expected' in case:
|
||||
expected = case['expected']
|
||||
if isinstance(expected, list):
|
||||
# at least one of them needs to match
|
||||
assert dependencies in expected
|
||||
assert dependencies in [sorted(e.splitlines()) for e in expected]
|
||||
else:
|
||||
assert dependencies == expected
|
||||
assert dependencies == sorted(expected.splitlines())
|
||||
|
||||
# stderr_contains may be a string or list of strings
|
||||
stderr_contains = case.get('stderr_contains')
|
||||
@ -103,6 +103,7 @@ def test_parse_record_tldr():
|
||||
str(SITELIB / "tldr-0.5.dist-info/WHEEL"),
|
||||
str(SITELIB / "tldr-0.5.dist-info/top_level.txt"),
|
||||
str(SITELIB / "tldr.py"),
|
||||
str(SITELIB / "tldr.pyi"),
|
||||
]
|
||||
assert output == expected
|
||||
|
||||
50
tests/config-settings-test.spec
Normal file
50
tests/config-settings-test.spec
Normal file
@ -0,0 +1,50 @@
|
||||
Name: config-settings-test
|
||||
Version: 1.0.0
|
||||
Release: 1%{?dist}
|
||||
Summary: Test config_settings support
|
||||
|
||||
License: MIT
|
||||
URL: ...
|
||||
Source0: config_settings_test_backend.py
|
||||
|
||||
|
||||
%description
|
||||
%{summary}.
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -cT
|
||||
|
||||
cp -p %{sources} .
|
||||
|
||||
cat <<'EOF' >config_settings.py
|
||||
"""
|
||||
This is a test package
|
||||
"""
|
||||
EOF
|
||||
|
||||
cat <<'EOF' >pyproject.toml
|
||||
[build-system]
|
||||
build-backend = "config_settings_test_backend"
|
||||
backend-path = ["."]
|
||||
requires = ["flit-core", "packaging", "pip"]
|
||||
|
||||
[project]
|
||||
name = "config_settings"
|
||||
version = "%{version}"
|
||||
dynamic = ["description"]
|
||||
EOF
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires -C abc=123 -C xyz=456 -C--option-with-dashes=1 -C--option-with-dashes=2
|
||||
%{!?el9:%pyproject_buildrequires -C abc=123 -C xyz=456 -C--option-with-dashes=1 -C--option-with-dashes=2 -w}
|
||||
|
||||
|
||||
%build
|
||||
%{!?el9:%pyproject_wheel -C abc=123 -C xyz=456 -C--option-with-dashes=1 -C--option-with-dashes=2}
|
||||
|
||||
|
||||
%changelog
|
||||
* Fri May 19 2023 Maxwell G <maxwell@gtmx.me>
|
||||
- Initial package
|
||||
40
tests/config_settings_test_backend.py
Normal file
40
tests/config_settings_test_backend.py
Normal file
@ -0,0 +1,40 @@
|
||||
"""
|
||||
This is a test backend for pyproject-rpm-macros' integration tests
|
||||
It is not compliant with PEP 517 and omits some required hooks.
|
||||
"""
|
||||
|
||||
from flit_core import buildapi
|
||||
from packaging.version import parse
|
||||
from pip import __version__ as pip_version
|
||||
|
||||
EXPECTED_CONFIG_SETTINGS = [{"abc": "123", "xyz": "456", "--option-with-dashes": ["1", "2"]}]
|
||||
# Older pip did not accept multiple values,
|
||||
# but we might backport that later,
|
||||
# hence we accept it both ways with older pips
|
||||
if parse(pip_version) < parse("23.1"):
|
||||
EXPECTED_CONFIG_SETTINGS.append(
|
||||
EXPECTED_CONFIG_SETTINGS[0] | {"--option-with-dashes": "2"}
|
||||
)
|
||||
|
||||
|
||||
def _verify_config_settings(config_settings):
|
||||
print(f"config_settings={config_settings}")
|
||||
if config_settings not in EXPECTED_CONFIG_SETTINGS:
|
||||
raise ValueError(
|
||||
f"{config_settings!r} does not match expected {EXPECTED_CONFIG_SETTINGS!r}"
|
||||
)
|
||||
|
||||
|
||||
def build_wheel(wheel_directory, config_settings=None, metadata_directory=None):
|
||||
_verify_config_settings(config_settings)
|
||||
return buildapi.build_wheel(wheel_directory, None, metadata_directory)
|
||||
|
||||
|
||||
def get_requires_for_build_wheel(config_settings=None):
|
||||
_verify_config_settings(config_settings)
|
||||
return buildapi.get_requires_for_build_wheel(None)
|
||||
|
||||
|
||||
def prepare_metadata_for_build_wheel(metadata_directory, config_settings=None):
|
||||
_verify_config_settings(config_settings)
|
||||
return buildapi.prepare_metadata_for_build_wheel(metadata_directory, None)
|
||||
70
tests/double-install.spec
Normal file
70
tests/double-install.spec
Normal file
@ -0,0 +1,70 @@
|
||||
Name: double-install
|
||||
Version: 0
|
||||
Release: 0%{?dist}
|
||||
Summary: Install 2 wheels
|
||||
License: BSD-3-Clause AND MIT
|
||||
%global markupsafe_version 2.0.1
|
||||
%global tldr_version 0.4.4
|
||||
Source1: https://github.com/pallets/markupsafe/archive/%{markupsafe_version}/MarkupSafe-%{markupsafe_version}.tar.gz
|
||||
Source2: %{pypi_source tldr %{tldr_version}}
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: python3-devel
|
||||
|
||||
%description
|
||||
This package tests that we can build and install 2 wheels at once.
|
||||
One of them is "noarch" and one has an extension module.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -Tc
|
||||
tar xf %{SOURCE1}
|
||||
tar xf %{SOURCE2}
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
cd markupsafe-%{markupsafe_version}
|
||||
%pyproject_buildrequires -R
|
||||
cd ../tldr-%{tldr_version}
|
||||
%pyproject_buildrequires -R
|
||||
cd ..
|
||||
|
||||
|
||||
%build
|
||||
cd markupsafe-%{markupsafe_version}
|
||||
%pyproject_wheel
|
||||
cd ../tldr-%{tldr_version}
|
||||
%pyproject_wheel
|
||||
cd ..
|
||||
|
||||
|
||||
%install
|
||||
(
|
||||
# This should install both the wheels:
|
||||
%pyproject_install
|
||||
) 2>&1 | tee install.log
|
||||
#pyproject_save_files is not possible with 2 dist-infos
|
||||
|
||||
|
||||
%check
|
||||
# Internal check for the value of %%{pyproject_build_lib}
|
||||
cd markupsafe-%{markupsafe_version}
|
||||
%if 0%{?rhel} == 9
|
||||
test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/markupsafe-%{markupsafe_version}/build/lib.%{python3_platform}-%{python3_version}"
|
||||
%else
|
||||
test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/markupsafe-%{markupsafe_version}/build/lib.%{python3_platform}-cpython-%{python3_version_nodots}"
|
||||
%endif
|
||||
cd ../tldr-%{tldr_version}
|
||||
test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/tldr-%{tldr_version}/build/lib"
|
||||
cd ..
|
||||
# Internal regression check for %%pyproject_install with multiple wheels
|
||||
grep 'binary operator expected' install.log && exit 1 || true
|
||||
grep 'too many arguments' install.log && exit 1 || true
|
||||
|
||||
|
||||
%files
|
||||
%{_bindir}/tldr*
|
||||
%pycached %{python3_sitelib}/tldr.py
|
||||
%{python3_sitelib}/tldr-%{tldr_version}.dist-info/
|
||||
%{python3_sitearch}/[Mm]arkup[Ss]afe-%{markupsafe_version}.dist-info/
|
||||
%{python3_sitearch}/markupsafe/
|
||||
88
tests/escape_paths.spec
Normal file
88
tests/escape_paths.spec
Normal file
@ -0,0 +1,88 @@
|
||||
Name: escape_paths
|
||||
Version: 0.1
|
||||
Release: 0
|
||||
Summary: ...
|
||||
License: MIT
|
||||
BuildArch: noarch
|
||||
|
||||
%description
|
||||
This spec file verifies that escaping percentage signs in paths is possible via
|
||||
exactly 8 (or 2) percentage signs in a filelist and directly in the %%files section.
|
||||
It also verifies other path escaping assumptions on RPM 4.19+.
|
||||
It serves as a regression test for pyproject_save_files:escape_rpm_path().
|
||||
When this breaks, the function needs to be adapted.
|
||||
|
||||
|
||||
%prep
|
||||
cat > pyproject.toml << EOF
|
||||
[build-system]
|
||||
requires = ["setuptools"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
EOF
|
||||
|
||||
cat > setup.cfg << EOF
|
||||
[metadata]
|
||||
name = escape_paths
|
||||
version = 0.1
|
||||
[options]
|
||||
packages =
|
||||
escape_paths
|
||||
[options.package_data]
|
||||
escape_paths =
|
||||
*
|
||||
EOF
|
||||
|
||||
mkdir -p escape_paths
|
||||
touch escape_paths/__init__.py
|
||||
# the paths on disk will have 1 percentage sign if we type 2 in the spec
|
||||
# we use the word 'version' after the sign, as that is a known existing macro
|
||||
touch 'escape_paths/one%%version'
|
||||
%if v"0%{?rpmversion}" >= v"4.18.90"
|
||||
touch 'escape_paths/path with spaces'
|
||||
touch 'escape_paths/path with spaces and "quotes'
|
||||
touch 'escape_paths/path_with_?*[!globs]!'
|
||||
touch 'escape_paths/path_with_\backslash'
|
||||
touch 'escape_paths/path_with_{curly,brackets}'
|
||||
touch 'escape_paths/path with spaces and ?*[!globs]! and \backslash'
|
||||
%endif
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires
|
||||
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files -L escape_paths
|
||||
touch '%{buildroot}/two%%version'
|
||||
%if v"0%{?rpmversion}" >= v"4.18.90"
|
||||
touch '%{buildroot}/another_path with spaces'
|
||||
touch '%{buildroot}/another_path with spaces and "quotes'
|
||||
touch '%{buildroot}/another_path_with_?*[!globs]!'
|
||||
touch '%{buildroot}/another_path_with_\backslash'
|
||||
touch '%{buildroot}/another_path_with_{curly,brackets}'
|
||||
touch '%{buildroot}/another_path with spaces and ?*[!globs]! and \backslash'
|
||||
%endif
|
||||
|
||||
|
||||
%check
|
||||
grep '/escape_paths/one' %{pyproject_files}
|
||||
|
||||
|
||||
|
||||
%files -f %{pyproject_files}
|
||||
%if v"0%{?rpmversion}" >= v"4.18.90"
|
||||
/two%%version
|
||||
/another_path\ with\ spaces
|
||||
/another_path\ with\ spaces\ and\ \"quotes
|
||||
/another_path_with_\?\*\[\!globs\]\!
|
||||
/another_path_with_\\backslash
|
||||
/another_path_with_\{curly,brackets\}
|
||||
/another_path\ with\ spaces\ and\ \?\*\[\!globs\]\!\ and\ \\backslash
|
||||
%else
|
||||
/two%%%%%%%%version
|
||||
%endif
|
||||
30
tests/fake-requirements.spec
Normal file
30
tests/fake-requirements.spec
Normal file
@ -0,0 +1,30 @@
|
||||
Name: fake-requirements
|
||||
Version: 0
|
||||
Release: 0%{?dist}
|
||||
|
||||
Summary: ...
|
||||
License: MIT
|
||||
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
|
||||
|
||||
%description
|
||||
Fake spec file to test %%pyproject_buildrequires -N works as expected
|
||||
|
||||
%prep
|
||||
cat > requirements.txt <<EOF
|
||||
click!=5.0.0,>=4.1 # comment to increase test complexity
|
||||
tomli>=0.10.0
|
||||
EOF
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires requirements.txt -N
|
||||
|
||||
|
||||
%check
|
||||
grep '^((python3dist(click) < 5 or python3dist(click) > 5) with python3dist(click) >= 4.1)$' %{_pyproject_buildrequires}
|
||||
grep '^python3dist(tomli) >= 0.10$' %{_pyproject_buildrequires}
|
||||
|
||||
grep 'python3dist(pip)' %{_pyproject_buildrequires} && exit 1 || true
|
||||
grep 'python3dist(wheel)' %{_pyproject_buildrequires} && exit 1 || true
|
||||
test -f /usr/bin/pip && exit 1 || true
|
||||
85
tests/mocktest.sh
Executable file
85
tests/mocktest.sh
Executable file
@ -0,0 +1,85 @@
|
||||
#!/usr/bin/bash -eux
|
||||
if [ -z "${VERSION_ID-}" ] && [ -z "${NAME-}" ]; then
|
||||
. /etc/os-release
|
||||
fi
|
||||
|
||||
version=$(echo "${VERSION_ID}" | cut -d. -f1)
|
||||
arch="x86_64"
|
||||
|
||||
case $NAME in
|
||||
"Fedora Linux"|"Fedora")
|
||||
mock="fedora-${version}-${arch}"
|
||||
repos="local"
|
||||
;;
|
||||
|
||||
"CentOS Stream"|"Red Hat Enterprise Linux")
|
||||
case $version in
|
||||
9)
|
||||
mock="centos-stream+epel-next-${version}-${arch}"
|
||||
;;
|
||||
*)
|
||||
mock="centos-stream+epel-${version}-${arch}"
|
||||
;;
|
||||
esac
|
||||
repos="local,local-centos-stream"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Not supported OS" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
pkgname=${1}
|
||||
shift
|
||||
|
||||
config="/tmp/${mock}-ci.cfg"
|
||||
|
||||
# create mock config if not present
|
||||
# this makes sure tested version of pyproject-rpm-macros is available
|
||||
# TODO: check if it has precedence if the release was not bumped in tested PR
|
||||
if [ ! -f $config ]; then
|
||||
original="/etc/mock/${mock}.cfg"
|
||||
cp $original $config
|
||||
|
||||
echo -e '\n\n' >> $config
|
||||
echo -e 'config_opts["package_manager_max_attempts"] = 10' >> $config
|
||||
echo -e 'config_opts["package_manager_attempt_delay"] = 60' >> $config
|
||||
echo -e '\n\nconfig_opts["dnf.conf"] += """' >> $config
|
||||
|
||||
# The zuul CI has zuul-build.repo
|
||||
# The Jenkins CI has test-<pkgname>.repo
|
||||
# We run this code from various packages, so we support any <pkgname>
|
||||
if [ -f /etc/yum.repos.d/zuul-build.repo ]; then
|
||||
cat /etc/yum.repos.d/zuul-build.repo >> $config
|
||||
else
|
||||
cat /etc/yum.repos.d/test-*.repo >> $config
|
||||
fi
|
||||
echo -e '\n"""\n' >> $config
|
||||
fi
|
||||
|
||||
# prepare the rpmbuild folders, make sure nothing relevant is there
|
||||
mkdir -p ~/rpmbuild/SRPMS
|
||||
rm -f ~/rpmbuild/SRPMS/${pkgname}-*.src.rpm
|
||||
|
||||
# download the sources and create SRPM
|
||||
spectool -g ${pkgname}.spec
|
||||
rpmbuild -bs --define '_sourcedir .' ${pkgname}.spec
|
||||
|
||||
# build the SRPM in mock
|
||||
res=0
|
||||
mock --verbose --isolation=simple -r $config --enablerepo="$repos" init
|
||||
mock --verbose --isolation=simple -r $config --enablerepo="$repos" "$@" ~/rpmbuild/SRPMS/${pkgname}-*.src.rpm || res=$?
|
||||
|
||||
# move the results to the artifacts directory, so we can examine them
|
||||
artifacts=${TEST_ARTIFACTS:-${TMT_TEST_DATA:-/tmp/artifacts}}
|
||||
|
||||
# on Fedora Rawhide, the directory contains "rawhide" instead of the actual version
|
||||
pushd /var/lib/mock/${mock}/result || pushd /var/lib/mock/${mock/${version}/rawhide}/result
|
||||
mv *.rpm ${artifacts}/ || :
|
||||
for log in *.log; do
|
||||
mv ${log} ${artifacts}/${pkgname}-${log}
|
||||
done
|
||||
popd
|
||||
|
||||
exit $res
|
||||
54
tests/printrun.spec
Normal file
54
tests/printrun.spec
Normal file
@ -0,0 +1,54 @@
|
||||
Name: printrun
|
||||
Version: 2.0.0~rc6
|
||||
%global upstream_version 2.0.0rc6
|
||||
Release: 0%{?dist}
|
||||
Summary: RepRap printer interface and tools
|
||||
License: GPL-3.0-or-later AND FSFAP
|
||||
URL: https://github.com/kliment/Printrun
|
||||
Source0: https://github.com/kliment/Printrun/archive/%{name}-%{upstream_version}.tar.gz
|
||||
|
||||
# fix locale location
|
||||
Patch0: https://github.com/kliment/Printrun/pull/1101.patch
|
||||
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: gcc
|
||||
|
||||
%description
|
||||
This package contains lang files outside of printrun module.
|
||||
Building this tests that lang files are marked with %%lang in filelist.
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n Printrun-printrun-%{upstream_version}
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires -R
|
||||
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files -l printrun +auto
|
||||
|
||||
|
||||
%check
|
||||
# Internal check if generated lang entries are same as
|
||||
# the ones generated using %%find_lang
|
||||
%find_lang pronterface
|
||||
%find_lang plater
|
||||
|
||||
grep '^%%lang' %{pyproject_files} | sort > tested.lang
|
||||
sort pronterface.lang plater.lang > expected.lang
|
||||
diff tested.lang expected.lang
|
||||
|
||||
# Internal check that generated files contain nested __pycache__ directories
|
||||
grep -E '/printrun/__pycache__$' %{pyproject_files}
|
||||
|
||||
|
||||
%files -f %{pyproject_files}
|
||||
%doc README*
|
||||
65
tests/python-clikit.spec
Normal file
65
tests/python-clikit.spec
Normal file
@ -0,0 +1,65 @@
|
||||
%global pypi_name clikit
|
||||
Name: python-%{pypi_name}
|
||||
Version: 0.3.1
|
||||
Release: 1%{?dist}
|
||||
Summary: Builds beautiful and testable command line interfaces
|
||||
|
||||
License: MIT
|
||||
URL: https://github.com/sdispater/clikit
|
||||
Source0: %{pypi_source}
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
BuildRequires: python3-devel
|
||||
|
||||
%description
|
||||
Tests building with the poetry(-core) build backend.
|
||||
|
||||
|
||||
%package -n python3-%{pypi_name}
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-%{pypi_name}
|
||||
%{summary}.
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n %{pypi_name}-%{version}
|
||||
%if 0%{?rhel}
|
||||
# force the poetry-core build backend, as that is available rather than full poetry
|
||||
sed -i 's/"poetry>=0.12"/"poetry-core"/' pyproject.toml
|
||||
sed -i 's/"poetry.masonry.api"/"poetry.core.masonry.api"/' pyproject.toml
|
||||
%endif
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
# this runtime-requires pastel<0.2 which is no longer available in Fedora
|
||||
%pyproject_buildrequires -R
|
||||
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
# Internal check that $TMPDIR is not changed
|
||||
TPMDIR_original="$TMPDIR"
|
||||
|
||||
%pyproject_install
|
||||
|
||||
# Internal check that $TMPDIR is not changed
|
||||
test "$TMPDIR" == "$TPMDIR_original"
|
||||
|
||||
|
||||
%check
|
||||
# Internal check that the RECORD and REQUESTED files are
|
||||
# always removed in %%pyproject_wheel
|
||||
test ! $(find %{buildroot}%{python3_sitelib}/ | grep -E "\.dist-info/RECORD$")
|
||||
test ! $(find %{buildroot}%{python3_sitelib}/ | grep -E "\.dist-info/REQUESTED$")
|
||||
|
||||
|
||||
%files -n python3-%{pypi_name}
|
||||
%doc README.md
|
||||
%license LICENSE
|
||||
%{python3_sitelib}/%{pypi_name}/
|
||||
%{python3_sitelib}/%{pypi_name}-%{version}.dist-info/
|
||||
50
tests/python-coverage-pth.spec
Normal file
50
tests/python-coverage-pth.spec
Normal file
@ -0,0 +1,50 @@
|
||||
Name: python-coverage-pth
|
||||
Version: 0.0.2
|
||||
Release: 0%{?dist}
|
||||
Summary: Coverage PTH file to enable coverage at the virtualenv level
|
||||
License: BSD-2-Clause
|
||||
URL: https://github.com/dougn/coverage_pth
|
||||
Source: %{pypi_source coverage_pth}
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: python3-devel
|
||||
|
||||
%description
|
||||
This package exists to test %%pyproject_save_files -M.
|
||||
It contains no Python modules, just a single .pth file.
|
||||
|
||||
|
||||
%package -n python3-coverage-pth
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-coverage-pth
|
||||
...
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n coverage_pth-%{version}
|
||||
# support multi-digit Python versions in setup.py regexes
|
||||
sed -i 's/d)/d+)/' setup.py
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires
|
||||
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
|
||||
# internal check for our macros:
|
||||
# this should not work without -M
|
||||
%pyproject_save_files -L && exit 1 || true
|
||||
|
||||
# but this should:
|
||||
%pyproject_save_files -LM
|
||||
|
||||
|
||||
%files -n python3-coverage-pth -f %{pyproject_files}
|
||||
%{python3_sitelib}/coverage_pth.pth
|
||||
54
tests/python-distroinfo.spec
Normal file
54
tests/python-distroinfo.spec
Normal file
@ -0,0 +1,54 @@
|
||||
Name: python-distroinfo
|
||||
Version: 0.3.2
|
||||
Release: 0%{?dist}
|
||||
Summary: Parsing and querying distribution metadata stored in text/YAML files
|
||||
License: Apache-2.0
|
||||
URL: https://github.com/softwarefactory-project/distroinfo
|
||||
Source0: %{pypi_source distroinfo}
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-pytest
|
||||
BuildRequires: git-core
|
||||
|
||||
%description
|
||||
This package uses setuptools and pbr.
|
||||
It has setup_requires and tests that %%pyproject_buildrequires correctly
|
||||
handles that including runtime requirements.
|
||||
Run %%pyproject_check_import with top-level modules filtering.
|
||||
|
||||
|
||||
%package -n python3-distroinfo
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-distroinfo
|
||||
...
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n distroinfo-%{version}
|
||||
# we don't need pytest-runner
|
||||
sed -Ei "s/(, )?'pytest-runner'//" setup.py
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires
|
||||
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files -l distroinfo
|
||||
|
||||
|
||||
%check
|
||||
%pytest
|
||||
%pyproject_check_import -t
|
||||
|
||||
|
||||
%files -n python3-distroinfo -f %{pyproject_files}
|
||||
%doc README.rst AUTHORS
|
||||
60
tests/python-django.spec
Normal file
60
tests/python-django.spec
Normal file
@ -0,0 +1,60 @@
|
||||
Name: python-django
|
||||
Version: 3.0.7
|
||||
Release: 0%{?dist}
|
||||
Summary: A high-level Python Web framework
|
||||
License: BSD-3-Clause
|
||||
URL: https://www.djangoproject.com/
|
||||
Source0: %{pypi_source Django}
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
BuildRequires: python3-devel
|
||||
|
||||
%description
|
||||
This package contains lang files.
|
||||
Building this tests that lang files are marked with %%lang in filelist.
|
||||
|
||||
|
||||
%package -n python3-django
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-django
|
||||
...
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n Django-%{version}
|
||||
%py3_shebang_fix django/conf/project_template/manage.py-tpl django/bin/django-admin.py
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires -R
|
||||
|
||||
|
||||
%build
|
||||
# remove .po files (in ideal world, we would rebuild the .mo files first)
|
||||
find -name "*.po" | xargs rm -f
|
||||
|
||||
%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files -l django
|
||||
|
||||
|
||||
%check
|
||||
# Internal check if generated lang entries are same as
|
||||
# the ones generated using %%find_lang
|
||||
%find_lang django
|
||||
%find_lang djangojs
|
||||
|
||||
grep '^%%lang' %{pyproject_files} | sort > tested.lang
|
||||
sort django.lang djangojs.lang > expected.lang
|
||||
diff tested.lang expected.lang
|
||||
|
||||
|
||||
%files -n python3-django -f %{pyproject_files}
|
||||
%doc README.rst
|
||||
%{_bindir}/django-admin
|
||||
%{_bindir}/django-admin.py
|
||||
71
tests/python-dns-lexicon.spec
Normal file
71
tests/python-dns-lexicon.spec
Normal file
@ -0,0 +1,71 @@
|
||||
Name: python-dns-lexicon
|
||||
Version: 3.8.1
|
||||
Release: 0%{?dist}
|
||||
Summary: Manipulate DNS records on various DNS providers in a standardized/agnostic way
|
||||
License: MIT
|
||||
URL: https://github.com/AnalogJ/lexicon
|
||||
Source0: %{url}/archive/v%{version}/lexicon-%{version}.tar.gz
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
BuildRequires: python3-devel
|
||||
|
||||
# Upstream does not declare this dependency
|
||||
# They dropped it later: https://github.com/AnalogJ/lexicon/issues/1240
|
||||
BuildRequires: python3-pkg_resources
|
||||
|
||||
%description
|
||||
This package has extras specified in tox configuration,
|
||||
we test that the extras are installed when -e is used.
|
||||
This package also uses a custom toxenv and creates several extras subpackages.
|
||||
|
||||
|
||||
%package -n python3-dns-lexicon
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-dns-lexicon
|
||||
...
|
||||
|
||||
|
||||
%pyproject_extras_subpackage -n python3-dns-lexicon plesk route53
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -n lexicon-%{version}
|
||||
# The tox configuration lists a [dev] extra, but that installs nothing (is missing).
|
||||
# The test requirements are only specified via poetry.dev-dependencies.
|
||||
# Here we amend the data a bit so we can test more things, adding the tests deps to the dev extra:
|
||||
sed -i \
|
||||
's/\[tool.poetry.extras\]/'\
|
||||
'pytest = {version = ">3", optional = true}\n'\
|
||||
'vcrpy = {version = ">1", optional = true}\n\n'\
|
||||
'[tool.poetry.extras]\n'\
|
||||
'dev = ["pytest", "vcrpy"]/' pyproject.toml
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
# We use the "light" toxenv because the default one installs the [full] extra and we don't have all the deps.
|
||||
# Note that [full] contains [plesk] and [route53] but we specify them manually instead:
|
||||
%pyproject_buildrequires -e light -x plesk -x route53
|
||||
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
# the license is not marked as License-File by poetry-core, hence -L
|
||||
%pyproject_save_files -L lexicon
|
||||
|
||||
|
||||
%check
|
||||
# we cannot use %%tox here, because the configured commands call poetry directly :/
|
||||
# we use %%pytest instead, running a subset of tests not to waste CI time
|
||||
%pytest -k "test_route53 or test_plesk"
|
||||
|
||||
|
||||
%files -n python3-dns-lexicon -f %{pyproject_files}
|
||||
%license LICENSE
|
||||
%doc README.rst
|
||||
%{_bindir}/lexicon
|
||||
58
tests/python-entrypoints.spec
Normal file
58
tests/python-entrypoints.spec
Normal file
@ -0,0 +1,58 @@
|
||||
%global pypi_name entrypoints
|
||||
Name: python-%{pypi_name}
|
||||
Version: 0.3
|
||||
Release: 0%{?dist}
|
||||
Summary: Discover and load entry points from installed packages
|
||||
License: MIT
|
||||
URL: https://entrypoints.readthedocs.io/
|
||||
Source0: %{pypi_source}
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
%description
|
||||
This package contains one .py module
|
||||
Building this tests the flit(_core) build backend.
|
||||
This package also has no explicit BuildRequires for python or the macros,
|
||||
testing the minimal implementation of %%pyproject_buildrequires
|
||||
from pyproject-srpm-macros.
|
||||
|
||||
|
||||
%package -n python3-%{pypi_name}
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-%{pypi_name}
|
||||
%{summary}.
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n %{pypi_name}-%{version}
|
||||
%if 0%{?rhel}
|
||||
# force the flit-core build backend, as that is available rather than full flit
|
||||
sed -i 's/"flit/"flit_core/' pyproject.toml
|
||||
%endif
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires
|
||||
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
# the license is not marked as License-File, hence -L
|
||||
%pyproject_save_files entrypoints -L
|
||||
|
||||
|
||||
%check
|
||||
# Internal check: Top level __pycache__ is never owned
|
||||
grep -E '/__pycache__$' %{pyproject_files} && exit 1 || true
|
||||
grep -E '/__pycache__/$' %{pyproject_files} && exit 1 || true
|
||||
grep -F '/__pycache__/' %{pyproject_files}
|
||||
|
||||
|
||||
%files -n python3-%{pypi_name} -f %{pyproject_files}
|
||||
%doc README.rst
|
||||
%license LICENSE
|
||||
54
tests/python-flit-core.spec
Normal file
54
tests/python-flit-core.spec
Normal file
@ -0,0 +1,54 @@
|
||||
Name: python-flit-core
|
||||
Version: 3.0.0
|
||||
Release: 0%{?dist}
|
||||
Summary: Distribution-building parts of Flit
|
||||
|
||||
License: BSD-3-Clause AND BSD-2-Clause
|
||||
URL: https://pypi.org/project/flit-core/
|
||||
Source0: https://github.com/takluyver/flit/archive/%{version}/flit-%{version}.tar.gz
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
|
||||
%description
|
||||
Test a wheel built from a subdirectory.
|
||||
Test a build with pyproject.toml backend-path = .
|
||||
flit-core builds with flit-core.
|
||||
|
||||
|
||||
%package -n python3-flit-core
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-flit-core
|
||||
...
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n flit-%{version}
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
cd flit_core
|
||||
# this runtime-requires pytoml which is no longer available in Fedora
|
||||
%pyproject_buildrequires -R
|
||||
cd ..
|
||||
|
||||
%build
|
||||
cd flit_core
|
||||
%pyproject_wheel
|
||||
cd ..
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
# there is no license file marked as License-File, hence not using -l
|
||||
%pyproject_save_files flit_core
|
||||
|
||||
|
||||
%check
|
||||
# internal check for our macros, we assume there is no license
|
||||
grep -F %%license %{pyproject_files} && exit 1 || true
|
||||
|
||||
|
||||
%files -n python3-flit-core -f %{pyproject_files}
|
||||
79
tests/python-getmac.spec
Normal file
79
tests/python-getmac.spec
Normal file
@ -0,0 +1,79 @@
|
||||
Name: python-getmac
|
||||
Version: 0.8.3
|
||||
Release: 0%{?dist}
|
||||
Summary: Get MAC addresses of remote hosts and local interfaces
|
||||
License: MIT
|
||||
URL: https://github.com/GhostofGoes/getmac
|
||||
Source0: %{pypi_source getmac}
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
|
||||
|
||||
%global _description %{expand:
|
||||
Test that manpages are correctly processed by %%%%%%%%pyproject_save_files '*' +auto.
|
||||
Run %%%%%%%%_pyproject_check_import_allow_no_modules twice
|
||||
- exclude all modules and test the check still passes thanks to -M option
|
||||
- regression test: test that check imports all modules even if -M option is set}
|
||||
|
||||
|
||||
%description %_description
|
||||
|
||||
%package -n python3-getmac
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-getmac %_description
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n getmac-%{version}
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires -r
|
||||
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files -l '*' +auto
|
||||
|
||||
|
||||
%check
|
||||
# Internal check for our macros, assert the behavior of the import check macros
|
||||
# Both of the macros should succeed
|
||||
%pyproject_check_import
|
||||
%_pyproject_check_import_allow_no_modules
|
||||
(%{pyproject_check_import}) 2>pyproject_check_import.stderr
|
||||
(%{_pyproject_check_import_allow_no_modules}) 2>_pyproject_check_import_allow_no_modules.stderr
|
||||
|
||||
# Modules were found, stderrs should include getmac.getmac
|
||||
grep '^Check import: getmac\.getmac$' pyproject_check_import.stderr
|
||||
grep '^Check import: getmac\.getmac$' _pyproject_check_import_allow_no_modules.stderr
|
||||
|
||||
# Now let's pretend no modules were found at all
|
||||
echo -e '' > %{_pyproject_modules}
|
||||
|
||||
# This should fail
|
||||
(%{pyproject_check_import}) && exit 1 || true
|
||||
|
||||
# This should succeed and say something about no modules found
|
||||
%{_pyproject_check_import_allow_no_modules}
|
||||
(%{_pyproject_check_import_allow_no_modules}) 2>_pyproject_check_import_allow_no_modules.stderr
|
||||
grep '\bNo modules to check found\b' _pyproject_check_import_allow_no_modules.stderr
|
||||
|
||||
# We want to ensure the rest of the %%check section is still executed
|
||||
# (To avoid a temptation to call `exit 0` from %%_pyproject_check_import_allow_no_modules)
|
||||
# We'll touch a marker file here and assert its presence in %%files
|
||||
touch %{buildroot}/check-completed-entirely
|
||||
|
||||
# Internal check for our macros, assert there is a manpage:
|
||||
test -f %{buildroot}%{_mandir}/man1/getmac.1*
|
||||
|
||||
|
||||
%files -n python3-getmac -f %{pyproject_files}
|
||||
/check-completed-entirely
|
||||
44
tests/python-httpbin-werkzeug-2.1.patch
Normal file
44
tests/python-httpbin-werkzeug-2.1.patch
Normal file
@ -0,0 +1,44 @@
|
||||
From 06f390d522afb6d2d71bb601c2060a9fabe3f7de Mon Sep 17 00:00:00 2001
|
||||
From: Adam Williamson <awilliam@redhat.com>
|
||||
Date: Mon, 19 Jul 2021 15:41:23 -0700
|
||||
Subject: [PATCH] Fix disabling of location header autocorrect for werkzeug 2+
|
||||
(#647)
|
||||
|
||||
In werkzeug 2.0.0 and later, the Location header autocorrection
|
||||
moved from BaseResponse to Response, so we need to set
|
||||
`autocorrect_location_header = False` in `Response` not
|
||||
`BaseResponse`. From 2.1.0, BaseResponse is removed and importing
|
||||
it is an error, so we can't support both any more.
|
||||
|
||||
Signed-off-by: Adam Williamson <awilliam@redhat.com>
|
||||
---
|
||||
httpbin/core.py | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/httpbin/core.py b/httpbin/core.py
|
||||
index 66a2ed6..fd2842c 100644
|
||||
--- a/httpbin/core.py
|
||||
+++ b/httpbin/core.py
|
||||
@@ -19,7 +19,7 @@ from flask import Flask, Response, request, render_template, redirect, jsonify a
|
||||
from six.moves import range as xrange
|
||||
from werkzeug.datastructures import WWWAuthenticate, MultiDict
|
||||
from werkzeug.http import http_date
|
||||
-from werkzeug.wrappers import BaseResponse
|
||||
+from werkzeug.wrappers import Response as WzResponse
|
||||
from werkzeug.http import parse_authorization_header
|
||||
from raven.contrib.flask import Sentry
|
||||
|
||||
@@ -48,7 +48,9 @@ def jsonify(*args, **kwargs):
|
||||
return response
|
||||
|
||||
# Prevent WSGI from correcting the casing of the Location header
|
||||
-BaseResponse.autocorrect_location_header = False
|
||||
+# and forcing it to be absolute.
|
||||
+WzResponse.autocorrect_location_header = False
|
||||
+
|
||||
|
||||
# Find the correct template folder when running from a different location
|
||||
tmpl_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'templates')
|
||||
--
|
||||
2.36.0
|
||||
|
||||
77
tests/python-httpbin.spec
Normal file
77
tests/python-httpbin.spec
Normal file
@ -0,0 +1,77 @@
|
||||
Name: python-httpbin
|
||||
Version: 0.7.0
|
||||
Release: 0%{?dist}
|
||||
Summary: HTTP Request & Response Service, written in Python + Flask
|
||||
License: MIT
|
||||
URL: https://github.com/Runscope/httpbin
|
||||
Source0: %{url}/archive/v%{version}/httpbin-%{version}.tar.gz
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
|
||||
%if 0%{?rhel} != 9
|
||||
# Wekrzeug in Fedora and EL10+ isn't compatible with our httpbin
|
||||
Patch: python-httpbin-werkzeug-2.1.patch
|
||||
%endif
|
||||
|
||||
# no flask, itsdangerous, raven, werkzeug packaged for EPEL 9 yet
|
||||
# cannot run tests on EPEL and also cannot BuildRequire runtime deps
|
||||
%if 0%{?fedora}
|
||||
%bcond_without tests
|
||||
%else
|
||||
%bcond_with tests
|
||||
%endif
|
||||
|
||||
%description
|
||||
This package buildrequires a package with extra: raven[flask].
|
||||
|
||||
|
||||
%package -n python3-httpbin
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-httpbin
|
||||
%{summary}.
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -n httpbin-%{version} -p1
|
||||
|
||||
# brotlipy wrapper is not packaged, httpbin works fine with brotli
|
||||
sed -i s/brotlipy/brotli/ setup.py
|
||||
|
||||
# update test_httpbin.py to reflect new behavior of werkzeug
|
||||
sed -i /Content-Length/d test_httpbin.py
|
||||
|
||||
# https://github.com/postmanlabs/httpbin/issues/647
|
||||
sed -Ei 's/\bdef (test_(relative_)?redirect_(to_post|n_(equals_to|higher_than)_1))/def no\1/' test_httpbin.py
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires %{?with_tests:-t}%{?!with_tests:-R}
|
||||
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files -l httpbin
|
||||
|
||||
|
||||
%if %{with tests}
|
||||
%check
|
||||
%if 0%{?rhel} == 9
|
||||
# this version of httpbin is not compatible with werkzeug 3+
|
||||
%tox
|
||||
%endif
|
||||
|
||||
# Internal check for our macros
|
||||
# The runtime dependencies contain raven[flask], we assert we got them.
|
||||
# The %%tox above also dies without it, but this makes it more explicit
|
||||
%{python3} -c 'import blinker, flask' # transitive deps
|
||||
%endif
|
||||
|
||||
|
||||
%files -n python3-httpbin -f %{pyproject_files}
|
||||
%doc README*
|
||||
53
tests/python-ipykernel.spec
Normal file
53
tests/python-ipykernel.spec
Normal file
@ -0,0 +1,53 @@
|
||||
Name: python-ipykernel
|
||||
Version: 6.11.0
|
||||
Release: 0%{?dist}
|
||||
Summary: IPython Kernel for Jupyter
|
||||
License: BSD-3-Clause
|
||||
URL: https://github.com/ipython/ipykernel
|
||||
Source0: https://github.com/ipython/ipykernel/archive/v%{version}/ipykernel-%{version}.tar.gz
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
BuildRequires: python3-devel
|
||||
|
||||
%description
|
||||
This package contains data files.
|
||||
Building this tests that data files are not listed when +auto is not used
|
||||
with %%pyproject_save_files.
|
||||
Run %%pyproject_check_import on installed package and exclude unwanted modules
|
||||
(if they're not excluded, build fails).
|
||||
- We don't want to pull test dependencies just to check import
|
||||
- The others fail to find `gi` and `matplotlib` which weren't declared
|
||||
in the upstream metadata
|
||||
|
||||
|
||||
%package -n python3-ipykernel
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-ipykernel
|
||||
...
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n ipykernel-%{version}
|
||||
|
||||
# Remove the dependency on debugpy.
|
||||
# See https://github.com/ipython/ipykernel/pull/767
|
||||
sed -i '/"debugpy/d' pyproject.toml setup.py
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires -r
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files -l 'ipykernel*' +auto
|
||||
|
||||
%check
|
||||
%pyproject_check_import -e '*.test*' -e 'ipykernel.gui*' -e 'ipykernel.pylab.*' -e 'ipykernel.trio*' -e 'ipykernel.datapub' -e 'ipykernel.pickleutil' -e 'ipykernel.serialize'
|
||||
|
||||
%files -n python3-ipykernel -f %{pyproject_files}
|
||||
%doc README.md
|
||||
|
||||
159
tests/python-isort.spec
Normal file
159
tests/python-isort.spec
Normal file
@ -0,0 +1,159 @@
|
||||
%global modname isort
|
||||
|
||||
Name: python-%{modname}
|
||||
Version: 4.3.21
|
||||
Release: 7%{?dist}
|
||||
Summary: Python utility / library to sort Python imports
|
||||
|
||||
License: MIT
|
||||
URL: https://github.com/timothycrosley/%{modname}
|
||||
Source0: %{url}/archive/%{version}-2/%{modname}-%{version}-2.tar.gz
|
||||
BuildArch: noarch
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
|
||||
%description
|
||||
This package contains executables.
|
||||
Building this tests that executables are not listed when +auto is not used
|
||||
with %%pyproject_save_files.
|
||||
|
||||
This package also uses %%{python3_pkgversion} in name and has a very limited
|
||||
set of dependencies -- allows to set a different value for it repeatedly.
|
||||
|
||||
%package -n python%{python3_pkgversion}-%{modname}
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python%{python3_pkgversion}-%{modname}
|
||||
%{summary}.
|
||||
|
||||
%if 0%{?rhel} == 9
|
||||
%global python3_pkgversion 3.11
|
||||
%package -n python%{python3_pkgversion}-%{modname}
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python%{python3_pkgversion}-%{modname}
|
||||
%{summary}.
|
||||
|
||||
%global python3_pkgversion 3.12
|
||||
%package -n python%{python3_pkgversion}-%{modname}
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python%{python3_pkgversion}-%{modname}
|
||||
%{summary}.
|
||||
%endif
|
||||
|
||||
%if 0%{?rhel} == 9 || 0%{?rhel} == 10
|
||||
%global python3_pkgversion 3.13
|
||||
%package -n python%{python3_pkgversion}-%{modname}
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python%{python3_pkgversion}-%{modname}
|
||||
%{summary}.
|
||||
|
||||
%global python3_pkgversion 3
|
||||
%endif
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -n %{modname}-%{version}-2
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires
|
||||
%if 0%{?rhel} == 9
|
||||
%global python3_pkgversion 3.11
|
||||
%pyproject_buildrequires
|
||||
%global python3_pkgversion 3.12
|
||||
%pyproject_buildrequires
|
||||
%endif
|
||||
%if 0%{?rhel} == 9 || 0%{?rhel} == 10
|
||||
%global python3_pkgversion 3.13
|
||||
%pyproject_buildrequires
|
||||
%global python3_pkgversion 3
|
||||
%endif
|
||||
|
||||
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
%if 0%{?rhel} == 9
|
||||
%global python3_pkgversion 3.11
|
||||
%pyproject_wheel
|
||||
%global python3_pkgversion 3.12
|
||||
%pyproject_wheel
|
||||
%endif
|
||||
%if 0%{?rhel} == 9 || 0%{?rhel} == 10
|
||||
%global python3_pkgversion 3.13
|
||||
%pyproject_wheel
|
||||
%global python3_pkgversion 3
|
||||
%endif
|
||||
|
||||
|
||||
%install
|
||||
%if 0%{?rhel} == 9
|
||||
%global python3_pkgversion 3.11
|
||||
%pyproject_install
|
||||
%pyproject_save_files -l isort
|
||||
%global python3_pkgversion 3.12
|
||||
%pyproject_install
|
||||
%pyproject_save_files -l isort
|
||||
%endif
|
||||
%if 0%{?rhel} == 9 || 0%{?rhel} == 10
|
||||
%global python3_pkgversion 3.13
|
||||
%pyproject_install
|
||||
%pyproject_save_files -l isort
|
||||
%global python3_pkgversion 3
|
||||
%endif
|
||||
# we keep this one last so /usr/bin/isort is installed with python3 shebang
|
||||
%pyproject_install
|
||||
%pyproject_save_files -l isort
|
||||
|
||||
|
||||
%check
|
||||
# Internal check if the instalation outputs expected result
|
||||
test -d %{buildroot}%{python3_sitelib}/%{modname}/
|
||||
test -d %{buildroot}%{python3_sitelib}/%{modname}-%{version}.dist-info/
|
||||
|
||||
# Internal check that executables are not present when +auto was not used with %%pyproject_save_files
|
||||
grep -F %{_bindir}/%{modname} %{pyproject_files} && exit 1 || true
|
||||
|
||||
%if 0%{?rhel} == 9
|
||||
# Internal check that correct versions are in correct %%{pyproject_files}s
|
||||
diff %{pyproject_files} <(grep -F python3.9/site-packages %{pyproject_files})
|
||||
|
||||
%global python3_pkgversion 3.11
|
||||
test -d %{buildroot}%{_usr}/lib/python3.11/site-packages/%{modname}/
|
||||
test -d %{buildroot}%{_usr}/lib/python3.11/site-packages/%{modname}-%{version}.dist-info/
|
||||
diff %{pyproject_files} <(grep -F python3.11/site-packages %{pyproject_files})
|
||||
|
||||
%global python3_pkgversion 3.12
|
||||
test -d %{buildroot}%{_usr}/lib/python3.12/site-packages/%{modname}/
|
||||
test -d %{buildroot}%{_usr}/lib/python3.12/site-packages/%{modname}-%{version}.dist-info/
|
||||
diff %{pyproject_files} <(grep -F python3.12/site-packages %{pyproject_files})
|
||||
%endif
|
||||
|
||||
%if 0%{?rhel} == 9 || 0%{?rhel} == 10
|
||||
%global python3_pkgversion 3.13
|
||||
test -d %{buildroot}%{_usr}/lib/python3.13/site-packages/%{modname}/
|
||||
test -d %{buildroot}%{_usr}/lib/python3.13/site-packages/%{modname}-%{version}.dist-info/
|
||||
diff %{pyproject_files} <(grep -F python3.13/site-packages %{pyproject_files})
|
||||
%global python3_pkgversion 3
|
||||
%endif
|
||||
|
||||
|
||||
%files -n python%{python3_pkgversion}-%{modname} -f %{pyproject_files}
|
||||
%doc README.rst *.md
|
||||
%{_bindir}/%{modname}
|
||||
%if 0%{?rhel} == 9
|
||||
%global python3_pkgversion 3.11
|
||||
%files -n python%{python3_pkgversion}-%{modname} -f %{pyproject_files}
|
||||
%doc README.rst *.md
|
||||
%global python3_pkgversion 3.12
|
||||
%files -n python%{python3_pkgversion}-%{modname} -f %{pyproject_files}
|
||||
%doc README.rst *.md
|
||||
%endif
|
||||
%if 0%{?rhel} == 9 || 0%{?rhel} == 10
|
||||
%global python3_pkgversion 3.13
|
||||
%files -n python%{python3_pkgversion}-%{modname} -f %{pyproject_files}
|
||||
%doc README.rst *.md
|
||||
%global python3_pkgversion 3
|
||||
%endif
|
||||
34
tests/python-ldap-always-use-ldap-library.patch
Normal file
34
tests/python-ldap-always-use-ldap-library.patch
Normal file
@ -0,0 +1,34 @@
|
||||
From 536a7671151e3070481736e5d6159987df920d8b Mon Sep 17 00:00:00 2001
|
||||
From: Simon Pichugin <spichugi@redhat.com>
|
||||
Date: Wed, 9 Feb 2022 16:06:14 -0800
|
||||
Subject: [PATCH] Always use 'ldap' library
|
||||
|
||||
---
|
||||
setup.py | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 119b571..851223e 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -37,6 +37,8 @@ if cfg.has_section('_ldap'):
|
||||
for name in dir(LDAP_CLASS):
|
||||
if cfg.has_option('_ldap', name):
|
||||
setattr(LDAP_CLASS, name, cfg.get('_ldap', name).split())
|
||||
+#-- Overwrite it as 'ldap' is the always correct library we have in Fedora 34+
|
||||
+LDAP_CLASS.libs = ['ldap', 'lber']
|
||||
|
||||
for i in range(len(LDAP_CLASS.defines)):
|
||||
LDAP_CLASS.defines[i]=((LDAP_CLASS.defines[i],None))
|
||||
@@ -132,7 +134,7 @@ setup(
|
||||
extra_objects = LDAP_CLASS.extra_objects,
|
||||
runtime_library_dirs = (not sys.platform.startswith("win"))*LDAP_CLASS.library_dirs,
|
||||
define_macros = LDAP_CLASS.defines + \
|
||||
- ('ldap_r' in LDAP_CLASS.libs or 'oldap_r' in LDAP_CLASS.libs)*[('HAVE_LIBLDAP_R',None)] + \
|
||||
+ ('ldap' in LDAP_CLASS.libs or 'oldap' in LDAP_CLASS.libs)*[('HAVE_LIBLDAP_R',None)] + \
|
||||
('sasl' in LDAP_CLASS.libs or 'sasl2' in LDAP_CLASS.libs or 'libsasl' in LDAP_CLASS.libs)*[('HAVE_SASL',None)] + \
|
||||
('ssl' in LDAP_CLASS.libs and 'crypto' in LDAP_CLASS.libs)*[('HAVE_TLS',None)] + \
|
||||
[
|
||||
--
|
||||
2.31.1
|
||||
|
||||
107
tests/python-ldap.spec
Normal file
107
tests/python-ldap.spec
Normal file
@ -0,0 +1,107 @@
|
||||
Name: python-ldap
|
||||
Version: 3.3.0
|
||||
Release: 0%{?dist}
|
||||
License: python-ldap
|
||||
Summary: An object-oriented API to access LDAP directory servers
|
||||
Source0: %{pypi_source}
|
||||
|
||||
# OpenLDAP 2.5+ is not yet supported by python-ldap
|
||||
# https://github.com/python-ldap/python-ldap/issues/432
|
||||
# Fedora has this patch to make it build, but the tests will fail anyway
|
||||
Patch0: python-ldap-always-use-ldap-library.patch
|
||||
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
|
||||
BuildRequires: cyrus-sasl-devel
|
||||
BuildRequires: gcc
|
||||
BuildRequires: openldap-clients
|
||||
BuildRequires: openldap-devel
|
||||
BuildRequires: openssl-devel
|
||||
|
||||
|
||||
%description
|
||||
This package contains extension modules. Does not contain pyproject.toml.
|
||||
Has multiple files and directories.
|
||||
Building this tests:
|
||||
- the proper files are installed in the proper places
|
||||
- module glob in %%pyproject_save_files (some modules are included, some not)
|
||||
- combined manual and generated Buildrequires
|
||||
- building an extension module via %%pyproject_buildrequires -w
|
||||
|
||||
|
||||
%package -n python3-ldap
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-ldap
|
||||
%{summary}
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup
|
||||
# Hack: We remove tests that are broken by OpenLDAP 2.5+ and/or require openldap-servers
|
||||
# Don't do this in the regular Fedora package, please
|
||||
rm Tests/t_ldapobject.py Tests/t_cext.py Tests/t_edit.py Tests/t_ldap_sasl.py Tests/t_ldap_syncrepl.py Tests/t_slapdobject.py Tests/t_bind.py Tests/t_ldap_options.py Tests/t_ldap_schema_subentry.py
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
# -w is not required with this package, but we test that we can use it anyway
|
||||
%pyproject_buildrequires -t -w
|
||||
|
||||
|
||||
%build
|
||||
#%%pyproject_wheel -- this is done via %%pyproject_buildrequires -w
|
||||
|
||||
# Internal check that we can import the built extension modules from %%{pyproject_build_lib}
|
||||
%{python3} -c 'import _ldap' && exit 1 || true
|
||||
PYTHONPATH=%{pyproject_build_lib} %{python3} -c 'import _ldap'
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
# We can pass multiple globs
|
||||
%pyproject_save_files -l 'ldap*' '*ldap'
|
||||
|
||||
|
||||
%check
|
||||
%tox
|
||||
|
||||
# Internal check if the instalation outputs expected files
|
||||
test -d %{buildroot}%{python3_sitearch}/__pycache__/
|
||||
test -d %{buildroot}%{python3_sitearch}/python_ldap-%{version}.dist-info/
|
||||
test -d %{buildroot}%{python3_sitearch}/ldap/
|
||||
test -f %{buildroot}%{python3_sitearch}/ldapurl.py
|
||||
test -f %{buildroot}%{python3_sitearch}/ldif.py
|
||||
test -d %{buildroot}%{python3_sitearch}/slapdtest/
|
||||
test -f %{buildroot}%{python3_sitearch}/_ldap.cpython-*.so
|
||||
|
||||
# Internal check: Unmatched modules are not supposed to be listed in %%{pyproject_files}
|
||||
# We'll list them explicitly
|
||||
grep -F %{python3_sitearch}/ldif.py %{pyproject_files} && exit 1 || true
|
||||
grep -F %{python3_sitearch}/__pycache__/ldif.cpython-%{python3_version_nodots}.pyc %{pyproject_files} && exit 1 || true
|
||||
grep -F %{python3_sitearch}/__pycache__/ldif.cpython-%{python3_version_nodots}.opt-1.pyc %{pyproject_files} && exit 1 || true
|
||||
grep -F %{python3_sitearch}/slapdtest %{pyproject_files} && exit 1 || true
|
||||
|
||||
# Internal check: Unmatched modules are not supposed to be listed in %%{_pyproject_modules}
|
||||
grep -F slapdtest %{_pyproject_modules} && exit 1 || true
|
||||
grep -F ldif %{_pyproject_modules} && exit 1 || true
|
||||
# Let's check that at least one module is listed in %%{_pyproject_modules}
|
||||
grep -F ldapurl %{_pyproject_modules}
|
||||
|
||||
# Internal check: Top level __pycache__ is never owned
|
||||
grep -E '/site-packages/__pycache__$' %{pyproject_files} && exit 1 || true
|
||||
grep -E '/site-packages/__pycache__/$' %{pyproject_files} && exit 1 || true
|
||||
|
||||
# Internal check for the value of %%{pyproject_build_lib} in an archful package
|
||||
%if 0%{?rhel} == 9
|
||||
test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/build/lib.%{python3_platform}-%{python3_version}"
|
||||
%else
|
||||
test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/build/lib.%{python3_platform}-cpython-%{python3_version_nodots}"
|
||||
%endif
|
||||
|
||||
|
||||
%files -n python3-ldap -f %{pyproject_files}
|
||||
%doc CHANGES README TODO Demo
|
||||
# Explicitly listed files can be combined with automation
|
||||
%pycached %{python3_sitearch}/ldif.py
|
||||
%{python3_sitearch}/slapdtest/
|
||||
50
tests/python-markdown-it-py.spec
Normal file
50
tests/python-markdown-it-py.spec
Normal file
@ -0,0 +1,50 @@
|
||||
Name: python-markdown-it-py
|
||||
Version: 3.0.0
|
||||
Release: 0%{?dist}
|
||||
Summary: Python port of markdown-it
|
||||
License: MIT
|
||||
URL: https://github.com/executablebooks/markdown-it-py
|
||||
Source0: %{url}/archive/v%{version}/markdown-it-py-%{version}.tar.gz
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: python3-devel
|
||||
|
||||
%description
|
||||
This package tests generating of runtime requirements from pyproject.toml
|
||||
Upstream has got many more extras than we package,
|
||||
so it's a good example to test it's filtered correctly.
|
||||
|
||||
%package -n python3-markdown-it-py
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-markdown-it-py
|
||||
...
|
||||
|
||||
%pyproject_extras_subpkg -n python3-markdown-it-py linkify
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n markdown-it-py-%{version}
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires -x testing,linkify -p
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files markdown_it -L
|
||||
|
||||
%check
|
||||
# sphinx-copybutton is in [rtd] extra, should not appear
|
||||
grep "python3dist(sphinx-copybutton)" %_pyproject_buildrequires && exit 1 || true
|
||||
# "pytest-benchmark" is in [benchmarking] extra, should not appear
|
||||
grep "python3dist(pytest-benchmark)" %_pyproject_buildrequires && exit 1 || true
|
||||
# "pytest-regressions" is in [testing] extra, should appear
|
||||
grep "python3dist(pytest-regressions)" %_pyproject_buildrequires
|
||||
# "linkify-it-py" is in [linkify] extra, should appear
|
||||
grep "python3dist(linkify-it-py)" %_pyproject_buildrequires
|
||||
|
||||
|
||||
%files -n python3-markdown-it-py -f %{pyproject_files}
|
||||
%{_bindir}/markdown-it
|
||||
61
tests/python-markupsafe.spec
Normal file
61
tests/python-markupsafe.spec
Normal file
@ -0,0 +1,61 @@
|
||||
Name: python-markupsafe
|
||||
Version: 2.0.1
|
||||
Release: 0%{?dist}
|
||||
Summary: Implements a XML/HTML/XHTML Markup safe string for Python
|
||||
License: BSD-3-Clause
|
||||
URL: https://github.com/pallets/markupsafe
|
||||
Source0: %{url}/archive/%{version}/MarkupSafe-%{version}.tar.gz
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: make
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
|
||||
%description
|
||||
This package installs test- and docs-requirements from files
|
||||
and uses them to run tests and build documentation.
|
||||
It also has a less common order of the %%files section.
|
||||
|
||||
|
||||
%package -n python3-markupsafe
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-markupsafe
|
||||
...
|
||||
|
||||
|
||||
# In this spec, we put %%files early to test it still works
|
||||
%files -n python3-markupsafe -f %{pyproject_files}
|
||||
%doc CHANGES.rst README.rst
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -n markupsafe-%{version}
|
||||
|
||||
# we don't have pip-tools packaged in Fedora yet
|
||||
sed -i /pip-tools/d requirements/dev.in
|
||||
|
||||
# help the macros understand the URL in requirements/docs.in
|
||||
sed -Ei 's/sphinx\.git@([0-9a-f]+)/sphinx.git@\1#egg=sphinx/' requirements/docs.in
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
# requirements/dev.in recursively includes tests.in and docs.in
|
||||
# we also list tests.in manually to verify we can pass multiple arguments,
|
||||
# but it should be redundant if this was a real package
|
||||
%pyproject_buildrequires requirements/dev.in requirements/tests.in
|
||||
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
%make_build -C docs html SPHINXOPTS='-n %{?_smp_mflags}'
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files -l markupsafe
|
||||
|
||||
|
||||
%check
|
||||
%pytest
|
||||
|
||||
63
tests/python-mistune.spec
Normal file
63
tests/python-mistune.spec
Normal file
@ -0,0 +1,63 @@
|
||||
Name: python-mistune
|
||||
Version: 0.8.3
|
||||
Release: 11%{?dist}
|
||||
Summary: Markdown parser for Python
|
||||
|
||||
License: BSD-3-Clause
|
||||
URL: https://github.com/lepture/mistune
|
||||
Source0: %{url}/archive/v%{version}.tar.gz
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: python%{python3_pkgversion}-devel
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
|
||||
# optional dependency, listed explicitly to have the extension module:
|
||||
BuildRequires: python%{python3_pkgversion}-Cython
|
||||
|
||||
%description
|
||||
This package contains an extension module. Does not contain pyproject.toml.
|
||||
Has a script (.py) and extension (.so) with identical name.
|
||||
Building this tests:
|
||||
- installing both a script and an extension with the same name
|
||||
- default build backend without pyproject.toml
|
||||
Check %%pyproject_check_import basic functionality.
|
||||
|
||||
This package also uses %%{python3_pkgversion} in name and has a very limited
|
||||
set of dependencies -- allows to set a different value for it in the CI.
|
||||
|
||||
%package -n python%{python3_pkgversion}-mistune
|
||||
Summary: %summary
|
||||
|
||||
%description -n python%{python3_pkgversion}-mistune
|
||||
%{summary}
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -n mistune-%{version}
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires
|
||||
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files -l mistune
|
||||
|
||||
|
||||
%check
|
||||
%pyproject_check_import
|
||||
|
||||
# Internal check for our macros
|
||||
# making sure that pyproject_install outputs these files so that we can test behaviour of %%pyproject_save_files
|
||||
# when a package has multiple files with the same name (here script and extension)
|
||||
test -f %{buildroot}%{python3_sitearch}/mistune.py
|
||||
test -f %{buildroot}%{python3_sitearch}/mistune.cpython-*.so
|
||||
|
||||
|
||||
%files -n python%{python3_pkgversion}-mistune -f %{pyproject_files}
|
||||
%doc README.rst
|
||||
56
tests/python-openqa_client.spec
Normal file
56
tests/python-openqa_client.spec
Normal file
@ -0,0 +1,56 @@
|
||||
%global pypi_name openqa_client
|
||||
Name: python-%{pypi_name}
|
||||
Version: 4.0.0
|
||||
Release: 1%{?dist}
|
||||
Summary: Python client library for openQA API
|
||||
|
||||
License: GPL-2.0-or-later
|
||||
URL: https://github.com/os-autoinst/openQA-python-client
|
||||
Source0: %{pypi_source}
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
|
||||
%description
|
||||
This package uses tox.ini file with recursive deps (via the -r option).
|
||||
|
||||
|
||||
%package -n python3-%{pypi_name}
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-%{pypi_name}
|
||||
%{summary}.
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n %{pypi_name}-%{version}
|
||||
# setuptools-git is needed to build the source distribution, but not
|
||||
# for packaging, which *starts* from the source distribution
|
||||
# we sed it out to save ourselves a dependency, but that is not strictly required
|
||||
sed -i -e 's., "setuptools-git"..g' pyproject.toml
|
||||
|
||||
# the tests don't actually need mock, they use unittest.mock
|
||||
# https://github.com/os-autoinst/openQA-python-client/pull/21
|
||||
sed -i '/mock/d' tests.requires
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires -t
|
||||
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files -l %{pypi_name}
|
||||
|
||||
|
||||
%check
|
||||
%tox
|
||||
|
||||
|
||||
%files -n python3-%{pypi_name} -f %{pyproject_files}
|
||||
%doc README.*
|
||||
63
tests/python-pello.spec
Normal file
63
tests/python-pello.spec
Normal file
@ -0,0 +1,63 @@
|
||||
Name: python-pello
|
||||
Version: 1.0.4
|
||||
Release: 0%{?dist}
|
||||
Summary: Example Python library
|
||||
|
||||
License: MIT-0
|
||||
URL: https://github.com/fedora-python/Pello
|
||||
Source: %{url}/archive/v%{version}/Pello-%{version}.tar.gz
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
# we use this specfile for various different tests, the bconds controls it
|
||||
# a build --with options tests custom BuildOptions(generate_buildrequires)
|
||||
%bcond options 0
|
||||
# a build --with override_install has a custom %%install section
|
||||
%bcond override_install 0
|
||||
|
||||
# unfortunately, the following is not even parsable on RPM < 4.20
|
||||
%if v"0%{?rpmversion}" >= v"4.19.90"
|
||||
BuildSystem: pyproject
|
||||
%if %{without override_install}
|
||||
BuildOption(install): -l pello
|
||||
%endif
|
||||
%if %{with options}
|
||||
BuildOption(generate_buildrequires): -t
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%description
|
||||
We use this specfile to test the declarative buildsystem.
|
||||
On older RPM version the build succeeds but builds nothing.
|
||||
|
||||
Note that due to the "automagic" it's a bit challenging to actually assert
|
||||
anything here. Manually inspecting the logs and results when doing changes
|
||||
to the declarative buildsystem is still advised.
|
||||
|
||||
|
||||
%package -n python3-pello
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-pello
|
||||
...
|
||||
|
||||
|
||||
%if %{with options} && v"0%{?rpmversion}" >= v"4.19.90"
|
||||
%check -a
|
||||
%tox
|
||||
%endif
|
||||
|
||||
|
||||
%if %{with override_install} && v"0%{?rpmversion}" >= v"4.19.90"
|
||||
# to test a fix for https://github.com/rpm-software-management/rpm/issues/3890
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files -l pello
|
||||
%endif
|
||||
|
||||
|
||||
%if v"0%{?rpmversion}" >= v"4.19.90"
|
||||
%files -n python3-pello -f %{pyproject_files}
|
||||
%doc README.md
|
||||
%{_bindir}/pello_greeting
|
||||
%endif
|
||||
57
tests/python-pluggy.spec
Normal file
57
tests/python-pluggy.spec
Normal file
@ -0,0 +1,57 @@
|
||||
%global pypi_name pluggy
|
||||
Name: python-%{pypi_name}
|
||||
Version: 1.5.0
|
||||
Release: 1%{?dist}
|
||||
Summary: The plugin manager stripped of pytest specific details
|
||||
|
||||
License: MIT
|
||||
URL: https://github.com/pytest-dev/pluggy
|
||||
Source0: %{pypi_source}
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
# we don't BR python3-devel here just for test purposes, but we recommend you do it
|
||||
|
||||
%description
|
||||
A pure Python library. The package contains tox.ini. Does not contain executables.
|
||||
Building this tests:
|
||||
- generating runtime and testing dependencies
|
||||
- running tests with %%tox
|
||||
- the %%pyproject_save_files +auto option works without actual executables
|
||||
- pyproject.toml with the setuptools backend and setuptools-scm
|
||||
|
||||
|
||||
%package -n python3-%{pypi_name}
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-%{pypi_name}
|
||||
%{summary}.
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n %{pypi_name}-%{version}
|
||||
# internal check for our macros: insert a subprocess echo to setup.py
|
||||
# to ensure it's not generated as BuildRequires
|
||||
echo 'import os; os.system("echo if-this-is-generated-the-build-will-fail")' >> setup.py
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires -t
|
||||
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
# There are no executables, but we are allowed to pass +auto anyway
|
||||
%pyproject_save_files pluggy +auto -l
|
||||
|
||||
|
||||
%check
|
||||
%tox
|
||||
|
||||
|
||||
%files -n python3-%{pypi_name} -f %{pyproject_files}
|
||||
%doc README.rst
|
||||
48
tests/python-poetry-core.spec
Normal file
48
tests/python-poetry-core.spec
Normal file
@ -0,0 +1,48 @@
|
||||
Name: python-poetry-core
|
||||
Version: 1.1.0
|
||||
Release: 0%{?dist}
|
||||
Summary: Poetry PEP 517 Build Backend
|
||||
|
||||
License: MIT
|
||||
URL: https://pypi.org/project/poetry-core/
|
||||
Source0: %{pypi_source poetry-core}
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
|
||||
%description
|
||||
Test a build with pyproject.toml backend-path = [.]
|
||||
poetry-core builds with poetry-core.
|
||||
|
||||
|
||||
%package -n python3-poetry-core
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-poetry-core
|
||||
...
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n poetry-core-%{version}
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires
|
||||
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
# the license is not marked as License-File by poetry-core, hence -L
|
||||
%pyproject_save_files -L poetry
|
||||
|
||||
# internal check for our macros, -l must fail:
|
||||
%pyproject_save_files -l poetry && exit 1 || true
|
||||
|
||||
%files -n python3-poetry-core -f %{pyproject_files}
|
||||
%doc README.md
|
||||
%license LICENSE
|
||||
67
tests/python-pytest.spec
Normal file
67
tests/python-pytest.spec
Normal file
@ -0,0 +1,67 @@
|
||||
%global pypi_name pytest
|
||||
Name: python-%{pypi_name}
|
||||
Version: 8.0.2
|
||||
Release: 0%{?dist}
|
||||
Summary: Simple powerful testing with Python
|
||||
License: MIT
|
||||
URL: https://pytest.org
|
||||
Source0: %{pypi_source}
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
|
||||
# no xmlschema packaged for EPEL 10 yet, cannot run tests on EPEL
|
||||
%if 0%{?fedora}
|
||||
%bcond_without tests
|
||||
%else
|
||||
%bcond_with tests
|
||||
%endif
|
||||
|
||||
%description
|
||||
This is a pure Python package with executables. It has a test suite in tox.ini
|
||||
and test dependencies specified via the [testing] extra.
|
||||
Building this tests:
|
||||
- generating runtime and test dependencies by both tox.ini and extras
|
||||
- pyproject.toml with the setuptools backend and setuptools-scm
|
||||
- passing arguments into %%tox
|
||||
|
||||
%package -n python3-%{pypi_name}
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-%{pypi_name}
|
||||
%{summary}.
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n %{pypi_name}-%{version}
|
||||
# remove optional test dependencies we don't like to pull in
|
||||
sed -E -i '/mock|nose/d' setup.cfg
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires %{?with_tests:-x testing -t}
|
||||
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files -l '*pytest' py +auto
|
||||
|
||||
|
||||
%check
|
||||
%if %{with tests}
|
||||
# Only run one test (which uses a test-only dependency, hypothesis)
|
||||
# See how to pass options trough the macro to tox, trough tox to pytest
|
||||
%tox -- -- -k "metafunc and not test_parametrize_" -Wdefault
|
||||
%else
|
||||
%pyproject_check_import
|
||||
%endif
|
||||
|
||||
|
||||
%files -n python3-%{pypi_name} -f %{pyproject_files}
|
||||
%doc README.rst
|
||||
%doc CHANGELOG.rst
|
||||
@ -0,0 +1,38 @@
|
||||
From 4612fd1b6b7f9d3fdbfad34863e5b04535bb44cc Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <thrnciar@redhat.com>
|
||||
Date: Wed, 8 Dec 2021 10:22:37 +0100
|
||||
Subject: [PATCH] Remove optional or unpackaged test deps
|
||||
|
||||
---
|
||||
setup.cfg | 10 ----------
|
||||
1 file changed, 10 deletions(-)
|
||||
|
||||
diff --git a/setup.cfg b/setup.cfg
|
||||
index 0bc0101..442da7a 100644
|
||||
--- a/setup.cfg
|
||||
+++ b/setup.cfg
|
||||
@@ -37,21 +37,11 @@ exclude =
|
||||
[options.extras_require]
|
||||
testing =
|
||||
pytest >= 6
|
||||
- pytest-checkdocs >= 2.4
|
||||
- pytest-flake8
|
||||
- pytest-black >= 0.3.7; \
|
||||
- python_implementation != "PyPy"
|
||||
- pytest-cov
|
||||
- pytest-mypy; \
|
||||
- python_implementation != "PyPy"
|
||||
- pytest-enabler >= 1.0.1
|
||||
|
||||
mock
|
||||
- flake8-2020
|
||||
virtualenv>=13.0.0
|
||||
pytest-virtualenv>=1.2.7 # TODO: Update once man-group/pytest-plugins#188 is solved
|
||||
wheel
|
||||
- paver
|
||||
pip>=19.1 # For proper file:// URLs support.
|
||||
jaraco.envs>=2.2
|
||||
pytest-xdist
|
||||
--
|
||||
2.33.1
|
||||
|
||||
@ -0,0 +1,46 @@
|
||||
From a03fa24ad65286ad9f2dc8bf1934bc84525ed06f Mon Sep 17 00:00:00 2001
|
||||
From: Charalampos Stratakis <cstratak@redhat.com>
|
||||
Date: Wed, 8 Mar 2023 02:48:31 +0100
|
||||
Subject: [PATCH] Remove optional or unpackaged test deps
|
||||
|
||||
---
|
||||
setup.cfg | 16 ----------------
|
||||
1 file changed, 16 deletions(-)
|
||||
|
||||
diff --git a/setup.cfg b/setup.cfg
|
||||
index 4791ed6..2776b31 100644
|
||||
--- a/setup.cfg
|
||||
+++ b/setup.cfg
|
||||
@@ -39,20 +39,6 @@ exclude =
|
||||
[options.extras_require]
|
||||
testing =
|
||||
pytest >= 6
|
||||
- pytest-checkdocs >= 2.4
|
||||
- pytest-flake8; \
|
||||
- python_version < "3.12"
|
||||
- flake8 < 5
|
||||
- pytest-black >= 0.3.7; \
|
||||
- python_implementation != "PyPy"
|
||||
- pytest-cov; \
|
||||
- python_implementation != "PyPy"
|
||||
- pytest-mypy >= 0.9.1; \
|
||||
- python_implementation != "PyPy"
|
||||
- pytest-enabler >= 1.3
|
||||
- pytest-perf
|
||||
-
|
||||
- flake8-2020
|
||||
virtualenv>=13.0.0
|
||||
wheel
|
||||
pip>=19.1 # For proper file:// URLs support.
|
||||
@@ -60,8 +46,6 @@ testing =
|
||||
pytest-xdist
|
||||
jaraco.path>=3.2.0
|
||||
build[virtualenv]
|
||||
- filelock>=3.4.0
|
||||
- pip_run>=8.8
|
||||
ini2toml[lite]>=0.9
|
||||
tomli-w>=1.0.0
|
||||
pytest-timeout
|
||||
--
|
||||
2.39.2
|
||||
|
||||
106
tests/python-setuptools.spec
Normal file
106
tests/python-setuptools.spec
Normal file
@ -0,0 +1,106 @@
|
||||
Name: python-setuptools
|
||||
# on the CI we test different version of setuptools on different Fedora versions
|
||||
# don't package software like this in Fedora please
|
||||
%if 0%{?rhel} != 9
|
||||
Version: 67.7.2
|
||||
%else
|
||||
Version: 59.6.0
|
||||
%endif
|
||||
Release: 0%{?dist}
|
||||
Summary: Easily build and distribute Python packages
|
||||
# see the real Fedora package for explanation:
|
||||
License: MIT AND (BSD-2-Clause OR Apache-2.0)
|
||||
URL: https://pypi.python.org/pypi/setuptools
|
||||
Source: %{pypi_source setuptools %{version}}
|
||||
|
||||
# Patch from Fedora proper
|
||||
Patch: python-setuptools-%{version}-remove-optional-or-unpackaged-test-deps.patch
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
BuildRequires: gcc
|
||||
|
||||
# too many missing tests deps in EPEL 9
|
||||
%if 0%{?fedora}
|
||||
%bcond_without tests
|
||||
%else
|
||||
%bcond_with tests
|
||||
%endif
|
||||
|
||||
%description
|
||||
This package tests 2 things:
|
||||
|
||||
- %%{_pyproject_builddir} does not leak to pytest collection (rhzb#1935212)
|
||||
- TODO %%{pyproject_files} has escaped spaces (rhzb#1976363)
|
||||
|
||||
|
||||
%package -n python3-setuptools
|
||||
Summary: %{summary}
|
||||
|
||||
# For users who might see ModuleNotFoundError: No module named 'pkg_resoureces'
|
||||
%py_provides python3-pkg_resources
|
||||
%py_provides python3-pkg-resources
|
||||
|
||||
%description -n python3-setuptools
|
||||
...
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n setuptools-%{version}
|
||||
|
||||
%if 0%{?rhel} == 9
|
||||
# The following test deps are optional and either not desired or not available in Fedora:
|
||||
sed -Ei setup.cfg -e '/\bpytest-(checkdocs|black|cov|mypy|enabler)\b/d' \
|
||||
-e '/\bflake8\b/d' \
|
||||
-e '/\bpaver\b/d'
|
||||
# Strip pytest options from the above
|
||||
sed -i pytest.ini -e 's/ --flake8//' \
|
||||
-e 's/ --cov//'
|
||||
%endif
|
||||
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires -r %{?with_tests:-x testing}
|
||||
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files setuptools pkg_resources _distutils_hack -l
|
||||
|
||||
# https://github.com/pypa/setuptools/issues/2709
|
||||
rm -rf %{buildroot}%{python3_sitelib}/pkg_resources/tests/
|
||||
sed -i '/tests/d' %{pyproject_files}
|
||||
|
||||
|
||||
%check
|
||||
# https://github.com/pypa/setuptools/discussions/2607
|
||||
rm pyproject.toml
|
||||
|
||||
%if %{with tests}
|
||||
# We only run a subset of tests to speed things up and be less fragile
|
||||
PRE_BUILT_SETUPTOOLS_WHEEL=%{_pyproject_wheeldir}/setuptools-%{version}-py3-none-any.whl \
|
||||
PYTHONPATH=$(pwd) %pytest --ignore=pavement.py \
|
||||
--ignore=setuptools/tests/test_develop.py \
|
||||
--ignore=setuptools/tests/test_editable_install.py \
|
||||
--ignore=setuptools/tests/config/test_apply_pyprojecttoml.py \
|
||||
-k "sdist" -n %{_smp_build_ncpus}
|
||||
%else
|
||||
%pyproject_check_import
|
||||
%endif
|
||||
|
||||
# Internal check that license file was recognized correctly
|
||||
grep '^%%license' %{pyproject_files} > tested.license
|
||||
echo '%%license %{python3_sitelib}/setuptools-%{version}.dist-info/LICENSE' > expected.license
|
||||
diff tested.license expected.license
|
||||
|
||||
|
||||
%files -n python3-setuptools -f %{pyproject_files}
|
||||
%doc docs/* CHANGES.rst README.rst
|
||||
%{python3_sitelib}/distutils-precedence.pth
|
||||
75
tests/python-setuptools_scm.spec
Normal file
75
tests/python-setuptools_scm.spec
Normal file
@ -0,0 +1,75 @@
|
||||
Name: python-setuptools_scm
|
||||
Version: 6.3.2
|
||||
|
||||
Release: 0%{?dist}
|
||||
Summary: The blessed package to manage your versions by SCM tags
|
||||
License: MIT
|
||||
URL: https://github.com/pypa/setuptools_scm/
|
||||
Source0: %{pypi_source setuptools_scm}
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
BuildRequires: /usr/bin/git
|
||||
|
||||
# flake8 is still missing tests deps in EPEL 9/10
|
||||
%if 0%{?fedora}
|
||||
%bcond_without flake8
|
||||
%else
|
||||
%bcond_with flake8
|
||||
%endif
|
||||
|
||||
%description
|
||||
Here we test that %%pyproject_extras_subpkg works and generates
|
||||
setuptools_scm[toml] extra subpackage.
|
||||
|
||||
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}
|
||||
|
||||
%description -n python3-setuptools_scm
|
||||
...
|
||||
|
||||
%pyproject_extras_subpkg -n python3-setuptools_scm toml
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n setuptools_scm-%{version}
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
# 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 %{?with_flake8:-e flake8}
|
||||
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files -l setuptools_scm
|
||||
|
||||
|
||||
%check
|
||||
# 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 -Wdefault --ignore testing/test_hg_git.py | tee toxlog
|
||||
|
||||
# Internal check for our macros: Assert both toxenvs were executed.
|
||||
grep -E 'py%{python3_version_nodots}-test: (OK|commands succeeded)' toxlog
|
||||
grep -E 'flake8: (OK|commands succeeded)' toxlog %{?!with_flake8:&& exit 1 || true}
|
||||
|
||||
# Internal check for our macros
|
||||
# making sure that %%{_pyproject_ghost_distinfo} has the right content
|
||||
test -f %{_pyproject_ghost_distinfo}
|
||||
test "$(cat %{_pyproject_ghost_distinfo})" == "%ghost %dir %{python3_sitelib}/setuptools_scm-%{version}.dist-info"
|
||||
|
||||
|
||||
%files -n python3-setuptools_scm -f %{pyproject_files}
|
||||
%doc README.rst
|
||||
%doc CHANGELOG.rst
|
||||
61
tests/python-userpath.spec
Normal file
61
tests/python-userpath.spec
Normal file
@ -0,0 +1,61 @@
|
||||
Name: python-userpath
|
||||
Version: 1.8.0
|
||||
Release: 1%{?dist}
|
||||
Summary: Cross-platform tool for adding locations to the user PATH
|
||||
License: MIT
|
||||
URL: https://github.com/ofek/userpath
|
||||
Source: %{pypi_source userpath}
|
||||
BuildArch: noarch
|
||||
BuildRequires: python3-devel
|
||||
|
||||
%description
|
||||
This package uses hatchling as build backend.
|
||||
This package is tested because:
|
||||
|
||||
- the prepare_metadata_for_build_wheel hook does not exist,
|
||||
%%pyproject_buildrequires -w is used
|
||||
https://github.com/ofek/hatch/issues/128
|
||||
- the licenses are stored in a dist-info subdirectory
|
||||
https://bugzilla.redhat.com/1985340
|
||||
(as of hatchling 0.22.0, not yet marked as License-File)
|
||||
|
||||
|
||||
%package -n python3-userpath
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-userpath
|
||||
...
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n userpath-%{version}
|
||||
sed -Ei '/^(coverage)$/d' requirements-dev.txt
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires requirements-dev.txt -w
|
||||
|
||||
|
||||
## %%pyproject_buildrequires -w makes this redundant:
|
||||
# %%build
|
||||
# %%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files -l userpath
|
||||
|
||||
|
||||
%check
|
||||
%pytest
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel} > 9
|
||||
# Internal check that license file was recognized correctly with hatchling 1.9.0+
|
||||
grep '^%%license' %{pyproject_files} > tested.license
|
||||
echo '%%license %{python3_sitelib}/userpath-%{version}.dist-info/licenses/LICENSE.txt' > expected.license
|
||||
diff tested.license expected.license
|
||||
%endif
|
||||
|
||||
|
||||
%files -n python3-userpath -f %{pyproject_files}
|
||||
%{_bindir}/userpath
|
||||
73
tests/python-virtualenv.spec
Normal file
73
tests/python-virtualenv.spec
Normal file
@ -0,0 +1,73 @@
|
||||
Name: python-virtualenv
|
||||
Version: 20.19.0
|
||||
Release: 0%{?dist}
|
||||
Summary: Tool to create isolated Python environments
|
||||
|
||||
License: MIT
|
||||
URL: http://pypi.python.org/pypi/virtualenv
|
||||
Source: %{pypi_source virtualenv}
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-pytest
|
||||
|
||||
%description
|
||||
This specfile was added as a regression test to
|
||||
https://src.fedoraproject.org/rpms/pyproject-rpm-macros/pull-request/363
|
||||
|
||||
It uses hatchling without %%pyproject_buildrequires -w.
|
||||
|
||||
|
||||
%package -n python3-virtualenv
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-virtualenv
|
||||
...
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n virtualenv-%{version}
|
||||
# Relax the upper bounds of some dependencies to their known available versions in EL 9
|
||||
sed -i -e 's/distlib<1,>=0.3.6/distlib<1,>=0.3.2/' \
|
||||
-e 's/filelock<4,>=3.4.1/filelock<4,>=3.3.1/' \
|
||||
-e 's/platformdirs<4,>=2.4/platformdirs<5,>=2.3/' \
|
||||
-e 's/hatchling>=1.12.2/hatchling>=0.25/' \
|
||||
-e 's/hatch-vcs>=0.3/hatch-vcs>=0.2.1/' \
|
||||
pyproject.toml
|
||||
# Drop the option for flaky
|
||||
sed -i 's/--no-success-flaky-report//' pyproject.toml
|
||||
# Hacky backport of https://src.fedoraproject.org/rpms/python-virtualenv/c/87b1f95664
|
||||
%if 0%{?rhel} != 9
|
||||
sed -i 's/_nonwrappers/_hookimpls/' tests/conftest.py
|
||||
%endif
|
||||
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires -w
|
||||
|
||||
|
||||
%build
|
||||
# %%pyproject_buildrequires -w makes this redundant
|
||||
# %%pyproject_wheel
|
||||
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files -l virtualenv
|
||||
%{?el9:
|
||||
# old version of setuptools_scm produces files incompatible with
|
||||
# assumptions in virtualenv code, we append the expected attributes:
|
||||
echo '__version__, __version_tuple__ = version, version_tuple' >> %{buildroot}%{python3_sitelib}/virtualenv/version.py
|
||||
}
|
||||
|
||||
|
||||
%check
|
||||
# test_main fails when .dist-info is not deleted at the end of %%pyproject_buildrequires
|
||||
# tests/integration/test_zipapp.py imports flaky
|
||||
PIP_CERT=/etc/pki/tls/certs/ca-bundle.crt \
|
||||
%pytest -v -k test_main --ignore tests/integration/test_zipapp.py
|
||||
|
||||
|
||||
%files -n python3-virtualenv -f %{pyproject_files}
|
||||
%doc README.md
|
||||
%{_bindir}/virtualenv
|
||||
45
tests/python-zope-event.spec
Normal file
45
tests/python-zope-event.spec
Normal file
@ -0,0 +1,45 @@
|
||||
Name: python-zope-event
|
||||
Version: 4.2.0
|
||||
Release: 0%{?dist}
|
||||
Summary: Zope Event Publication
|
||||
License: ZPL-2.1
|
||||
URL: https://pypi.python.org/pypi/zope.event/
|
||||
Source0: %{pypi_source zope.event}
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
BuildRequires: python3-devel
|
||||
|
||||
%description
|
||||
This package contains .pth files.
|
||||
Building this tests that .pth files are not listed when +auto is not used
|
||||
with %%pyproject_save_files.
|
||||
|
||||
%package -n python3-zope-event
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-zope-event
|
||||
...
|
||||
|
||||
%prep
|
||||
%setup -q -n zope.event-%{version}
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files -l zope +auto
|
||||
|
||||
%check
|
||||
# Internal check that the RECORD and REQUESTED files are
|
||||
# always removed in %%pyproject_wheel
|
||||
test ! $(find %{buildroot}%{python3_sitelib}/ | grep -E "\.dist-info/RECORD$")
|
||||
test ! $(find %{buildroot}%{python3_sitelib}/ | grep -E "\.dist-info/REQUESTED$")
|
||||
|
||||
%files -n python3-zope-event -f %{pyproject_files}
|
||||
%doc README.rst
|
||||
|
||||
61
tests/tldr.spec
Normal file
61
tests/tldr.spec
Normal file
@ -0,0 +1,61 @@
|
||||
Name: tldr
|
||||
Version: 0.4.4
|
||||
Release: 1%{?dist}
|
||||
Summary: Simplified and community-driven man pages
|
||||
|
||||
License: MIT
|
||||
URL: https://github.com/tldr-pages/tldr-python-client
|
||||
Source0: %{pypi_source}
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: pyproject-rpm-macros
|
||||
|
||||
%if 0%{?rhel} != 9
|
||||
# Internal check for our macros: test that we can install to a custom prefix
|
||||
BuildRequires: python3-rpm-macros >= 3.10-18
|
||||
%global _prefix /app
|
||||
%endif
|
||||
|
||||
%description
|
||||
A Python package containing executables.
|
||||
Building this tests:
|
||||
- there are no bytecompiled files in %%{_bindir}
|
||||
- the executable's shebang is adjusted properly
|
||||
- file direct_url.json isn't created
|
||||
- installation to custom prefix works
|
||||
|
||||
%prep
|
||||
%autosetup -n %{name}-%{version}
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files -l tldr +auto
|
||||
|
||||
%check
|
||||
# Internal check for our macros: tests we don't ship __pycache__ in bindir
|
||||
test ! -d %{buildroot}%{_bindir}/__pycache__
|
||||
|
||||
# Internal check for our macros: tests we have a proper shebang line
|
||||
head -n1 %{buildroot}%{_bindir}/%{name}.py | grep -E '#!\s*%{python3}\s+%{py3_shbang_opts}\s*$'
|
||||
|
||||
# Internal check for our macros: tests that direct_url.json file wasn't created
|
||||
test ! -e %{buildroot}%{python3_sitelib}/*.dist-info/direct_url.json
|
||||
|
||||
# Internal check for the value of %%{pyproject_build_lib} in a noarch package
|
||||
test "%{pyproject_build_lib}" == "${PWD}/build/lib"
|
||||
|
||||
%if 0%{?rhel} != 9
|
||||
# Internal check for custom prefix
|
||||
grep '^/usr' %{pyproject_files} && exit 1 || true
|
||||
grep '^/app' %{pyproject_files}
|
||||
%endif
|
||||
|
||||
%files -f %pyproject_files
|
||||
%doc README.md
|
||||
Loading…
Reference in New Issue
Block a user