Commit Graph

196 Commits

Author SHA1 Message Date
Lukáš Zachar
2ed8664eb1 Change the test source location
Change the test source location to support evolving downstream testing
requirements. This is needed both for downstream certification
activities and changes to test development for internal infrastructure
differences.
2024-12-02 10:45:32 +01:00
Miro Hrončok
51c4b725b8 CI: %{pyproject_build_lib} changed on EL9
The actual value is still OK, but the tests were too strict.
2024-11-15 14:41:26 +01:00
Miro Hrončok
47b479923f CI: EL9-only: Skip tests we cannot run yet
(cherry picked from commit 2c94825e15)
2024-11-15 00:30:55 +01:00
Miro Hrončok
cc15860ccf Fix one remaining test for setuptools 70+
This test was previously skipped because we didn't have new enough tox.
That's why it was never fixed for setuptools 70+.

This is a fixup for 20b7ac63f3

(cherry picked from commit 1532f1893f)
2024-11-15 00:29:10 +01:00
Miro Hrončok
e8d079ef42 Fixup the version-release
(cherry picked from commit 4ddd57c537)
2024-11-15 00:29:10 +01:00
Miro Hrončok
9ecce29cd3 Support for setuptools 70+
- wheel is no longer generated as a dependency of the default build system
- test cases are adapted to support both old and new setuptools version

(cherry picked from commit 20b7ac63f3)
2024-11-15 00:29:10 +01:00
Miro Hrončok
35f8482574 %pyproject_buildrequires: Add support for dependency groups (PEP 735), via tox configuration
(cherry picked from commit 8baa94160c)
2024-11-15 00:29:10 +01:00
Miro Hrončok
f1186740e0 %pyproject_buildrequires: Add support for dependency groups (PEP 735), via the -g flag
(cherry picked from commit 307d2bef63)
2024-11-15 00:29:10 +01:00
Miro Hrončok
db6c19e6ad Minor documentation clarification wrt -p/-w
(cherry picked from commit 80d9abe0f4)
2024-11-15 00:29:10 +01:00
Miro Hrončok
d3f9abe206 PEP 639 is provisional, no longer a draft
(cherry picked from commit beceb2c94b)
2024-11-15 00:29:10 +01:00
Karolina Surma
4c6bd08a70 Fix handling of self-referencing extras when reading pyproject.toml
Keep the information about the requirement extras by storing the
Requirement instances in the list of the ignored requirements, rather
than the strings in the form they were initially read from metadata.
The requirements strings read from pyproject.toml don't contain the
extra information, we insert the extra marker only after converting them to
Requirement instances. When stored as the text, the information about
the extra went missing in the course of the script.

(cherry picked from commit bc6cb55227)
2024-11-15 00:29:10 +01:00
Miro Hrončok
c34065ccca Even when %_auto_set_build_flags is disabled, set all compiler flags when building wheels
- Fixes: rhbz#2293616

(cherry picked from commit c7553b2c7d)
2024-11-15 00:29:10 +01:00
Miro Hrončok
a33eda232e Don't generate a dependency on pip when %pyproject_buildrequires -N is used
- Fixes: rhbz#2294510

(cherry picked from commit 8a41ec5715)
2024-11-15 00:29:10 +01:00
Karolina Surma
a1488d18df Add a possibility to read runtime dependencies from pyproject.toml
This adds a new flag, -p, to %pyproject_buildrequires.
When set, the runtime dependencies are read from the pyproject.toml's
[project] table.

See: https://bugzilla.redhat.com/2261939

pyproject_buildrequires.py already had a short `-p` option for
--python3_pkgversion (hidden from the macro users).
This change removes the one-letter option and leaves the long-one.
`-p` is now reused for reading dependencies from pyproject.toml
and made visible to the macro users.

(cherry picked from commit 9f43e2a760)
2024-11-15 00:29:10 +01:00
Miro Hrončok
4c735ba581 CI: Update setuptools_scm to a version that can be tested on EL9, EL10, Fedora 39-42
(cherry picked from commit ab3dc0126a)
2024-11-15 00:29:10 +01:00
Miro Hrončok
2240335879 CI: python-ipykernel: Drop unneeded python3-ipyparallel dependency
It is not available in EPEL 10 and we can avoid it by excluding more imports,
which is what this spec file tests anyway.

(cherry picked from commit 459cda2e67)
2024-11-15 00:29:10 +01:00
Miro Hrončok
55957facfa CI: python-virtualenv: Drop an unused dependency on python3-flaky
We don't have flaky in EL 10 yet.

(cherry picked from commit 89374b9107)
2024-11-15 00:29:10 +01:00
Miro Hrončok
4133370dea CI: Use poetry-core in python-clikit.spec for EL10 compatibility
(cherry picked from commit 4a4614d13a)
2024-11-15 00:29:10 +01:00
Miro Hrončok
388f35a082 CI: Use flit_core in python-entrypoints.spec for EL10 compatibility
(cherry picked from commit 32a3b5613f)
2024-11-15 00:29:10 +01:00
Miro Hrončok
07644782c4 CI: Use tomli rather than toml in fake-requirements.spec
toml is deprecated and not available on EL10.

(cherry picked from commit dddc9bf556)
2024-11-14 17:18:28 +01:00
Lumir Balhar
e161cd449e Mark the license in the specfile as SPDX formula
(cherry picked from commit c8abf80acd)
2024-11-14 17:18:21 +01:00
Miro Hrončok
e4aa6401af CI: There is no EPEL 10 Next, use plain EPEL mock chroots on RHEL 10+
(cherry picked from commit 6f1ac1b126)
2024-11-14 17:18:03 +01:00
Miro Hrončok
fdb5b80341 Extend rpmlintrc to filer out further non-errors
We got:

    pyproject-srpm-macros.noarch: W: unexpanded-macro Summary(C) %pyproject_buildrequires
    pyproject-srpm-macros.noarch: W: unexpanded-macro %description -l C %pyproject_buildrequires
    pyproject-srpm-macros.noarch: W: unexpanded-macro %description -l C %generate_buildrequires
    pyproject-rpm-macros.noarch: E: spelling-error ('cfg', '%description -l en_US cfg -> cf, cg, cog')
    pyproject-rpm-macros.noarch: E: spelling-error ('toml', '%description -l en_US toml -> tom, tome, toms')
    pyproject-rpm-macros.noarch: E: spelling-error ('setuptools', '%description -l en_US setuptools -> setup tools, setup-tools, footstools')
    pyproject-rpm-macros.src: E: spelling-error ('cfg', '%description -l en_US cfg -> cf, cg, cog')
    pyproject-rpm-macros.src: E: spelling-error ('toml', '%description -l en_US toml -> tom, tome, toms')
    pyproject-rpm-macros.src: E: spelling-error ('setuptools', '%description -l en_US setuptools -> setup tools, setup-tools, footstools')
    pyproject-srpm-macros.noarch: E: spelling-error ('buildrequires', 'Summary(en_US) buildrequires -> build requires, build-requires, requirements')
    pyproject-srpm-macros.noarch: E: spelling-error ('buildrequires', '%description -l en_US buildrequires -> build requires, build-requires, requirements')
    pyproject-srpm-macros.noarch: W: no-documentation

(cherry picked from commit 1278dd8dbd)
2024-11-14 17:17:50 +01:00
Miro Hrončok
082234e671 CI: Make python-pluggy build on Fedora 41+
(cherry picked from commit 7c4ffdcf84)
2024-11-14 17:16:35 +01:00
Miro Hrončok
bc854977a6 CI: Allow platformdirs 4 in python-virtualenv.spec
(cherry picked from commit 3539b832c8)
2024-11-14 17:16:08 +01:00
Miro Hrončok
4669de1250 Add a provisional RPM Declarative Buildsystem (RPM 4.20+)
(cherry picked from commit e7b37d02f8)
2024-11-14 17:16:04 +01:00
Fedora Release Engineering
c8de77f22e Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
(cherry picked from commit bc3d8013a4)
2024-11-14 17:15:59 +01:00
Miro Hrončok
4dc9dd6f33 Revert the temporary workaround for RPM 4.20 alpha 2 leaking \x1f (unit separators)
This reverts commit 996ac31b46.

(cherry picked from commit 436695615e)
2024-11-14 17:15:53 +01:00
Miro Hrončok
1bcb45eb11 Properly escape weird characters from paths in %{pyproject_files} (RPM 4.19+ only)
(cherry picked from commit 6d455af4dc)
2024-11-14 17:15:49 +01:00
Cristian Le
244da58cb9 %pyproject_extras_subpkg: Allow passing -a or -A to %python_extras_subpkg
Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
(cherry picked from commit d74914ec13)
2024-11-14 17:15:46 +01:00
Miro Hrončok
7309d3a880 Add a temporary workaround for RPM 4.20 alpha 2 leaking \x1f (unit separators)
Strip them.
This workaround is safe with RPM < 4.20 or when RPM is fixed.

(cherry picked from commit 996ac31b46)
2024-11-14 17:15:42 +01:00
Miro Hrončok
40437462c3 README: Add a missing link
(cherry picked from commit d0a66a2871)
2024-11-14 17:15:37 +01:00
Miro Hrončok
8763e77d15 CI: Regardless of the package manager, use dnf.conf in mock config
After https://github.com/rpm-software-management/mock/pull/1332

We saw:

    ERROR: Config error: /tmp/fedora-39-x86_64-ci.cfg: '{% if releasever|int >= 40 %}dnf5{% else %}dnf{% endif %}.conf'

We cannot use the templated value of package_manager in a key.

The rawhide mock config uses dnf.conf anyway, despite using dnf5.

Reported to mock in https://github.com/rpm-software-management/mock/issues/1357

(cherry picked from commit fa7c91c65d)
2024-11-14 17:15:33 +01:00
Miro Hrončok
2f641d6866 Revert "CI: Use DNF 4 in mock to workaround dnf5#1084"
This reverts commit 1d00ed8155.

https://github.com/rpm-software-management/dnf5/issues/1084 is fixed
(cherry picked from commit 3667fcd240)
2024-11-14 17:15:29 +01:00
Miro Hrončok
3ba66c0c6c Document why we generate a dependency on wheel when the default build backend is used
(cherry picked from commit a069958530)
2024-11-14 17:15:24 +01:00
Miro Hrončok
345517d213 Run tests with Python 3.12 in %check (RHEL 9 specific)
Also, add a Python 3.12 CI job (isort_c9s already contains that as well).

Resolves: RHEL-22803
2024-01-26 11:48:54 +01:00
Miro Hrončok
29eb590e45 Namespace pyproject-rpm-macros generated text files with %{python3_pkgversion} 2024-01-26 11:36:24 +01:00
Miro Hrončok
188276960b CI: Skip httpbin %tox on F40+ 2024-01-26 11:19:37 +01:00
Miro Hrončok
f8b0e925e8 Fix %pyproject_buildrequires -w when the build backend is already installed and pip isn't
Fixes: https://bugzilla.redhat.com/2169855
2024-01-26 11:19:37 +01:00
Miro Hrončok
9afde6e68e Show a better error message when %pyproject_install finds no wheel
Fixes: https://bugzilla.redhat.com/2242452
2024-01-26 11:19:37 +01:00
Miro Hrončok
b5c55d6167 Prevent incorrect usage of %pyproject_buildrequires -R with -x/-e/-t
Fixes: https://bugzilla.redhat.com/2244282
2024-01-26 11:19:37 +01:00
Miro Hrončok
d62ed44b6e CI: Use DNF 4 in mock to workaround dnf5#1084
mock-core-configs-39.3 switched the package manager for Fedora 40 to dnf5
  https://fedoraproject.org/wiki/Changes/BuildWithDNF5

dnf5 builddep cannot handle BuildRequires with square brackets,
e.g. with Python extras, leading to errors like:

  No match for argument: python3dist(setuptools-scm[toml]) >= 5
  No match for argument: python3dist(raven[flask])
  No match for argument: python3dist(ini2toml[lite]) >= 0.9

This is reported: https://github.com/rpm-software-management/dnf5/issues/1084

Until it is fixed, we explicitly use the "dnf" (i.e. DNF 4) package manager in mock,
even on Fedora 40+.
2024-01-26 11:19:37 +01:00
Miro Hrončok
22918dd2a6 Add the -l/-L flag to %pyproject_save_files
- The -l flag can be used to assert at least 1 License-File was detected
- The -L flag explicitly disables this check (which remains the default)

Co-Authored-By: Maxwell G <maxwell@gtmx.me>
2024-01-26 11:19:37 +01:00
Miro Hrončok
7f8db987f3 Fix a typo in an error message 2024-01-26 11:19:37 +01:00
Miro Hrončok
7e0207e048 Fix a typo in the latest changelog entry 2024-01-26 11:19:37 +01:00
Miro Hrončok
fa2855f6ce Fix handling of tox 4 provision without tox minversion
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2240590

The added test actually blows up without the fix with both tox 4 or tox 3,
so perhaps this bug also existed with tox 3.
2024-01-26 11:19:37 +01:00
Miro Hrončok
d95890489a Communicate loudly that this does not work with old RPM
I have seen several folks building this package in a RHEL 8 environment.
This won't prevent them doing so, but at least they will be forced to make changes,
acknowledging the fact that what they are doing has consequences.
2024-01-26 11:19:37 +01:00
Karolina Surma
47cfbcf6e3 Add %_pyproject_check_import_allow_no_modules
Macro which allows to pass the import check even if no Python modules
are detected in the package.
Only to be used in the automated environments.

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2024-01-26 11:19:35 +01:00
Carl George
39dc109d06 Fix PEP number typo 2024-01-26 11:16:14 +01:00
Miro Hrončok
3f1dd1c441 Use %rpmversion to check if we are on RPM 4.19+ 2024-01-26 11:15:16 +01:00