Commit Graph

334 Commits

Author SHA1 Message Date
Miro Hrončok
5e1a6e91f0 Update comment wrt setuptools not putting licenses in licenses/ directory 2025-04-11 19:23:18 +02:00
Miro Hrončok
c1326723a9 Fix reverted conditional in %pyproject_buildrequires -t/-e Fedora version comparison 2025-03-21 14:49:58 +01:00
Miro Hrončok
fb7bcbb068 Allow %pyproject_buildrequires -t/-e without tox config on Fedora 40-42
This still does not allow %tox without tox config.
2025-03-21 12:08:13 +00:00
Miro Hrončok
d3dfd5fdb2 Make %pyproject_buildrequires -t/-e and %tox fail when no suitable tox configuration exists
Since tox 4, tox does not fail without configuration
(tox.ini, or tox section in setup.cfg/pyproject.toml).

As a result, packages that use %pyproject_buildrequires with -t or -e
without having a tox confuration
only generate additional BuildRequires on tox & tox-current-env itself.

More dangerously, %tox without tox configuration does nothing (and succeeds).
This behavior is dangerous and warrants an announced breakage.

Packagers of ~100 affected Fedora packages were informed about the problem earlier in
https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/thread/ZSHSHZKVA4XJQBJD7FMMCALKN4UP5SAJ/

There will be a further announcement and warning about this change.

EPEL 9 packages are not affected,
EPEL 9 has tox 3 which fails without config by default.

The change used a newly added option for tox-current-env: --assert-config.
This was added in tox-current-env 0.0.16:
https://github.com/fedora-python/tox-current-env/pull/89
2025-03-21 12:08:13 +00:00
Lumir Balhar
d1c632d76c Make dependencies in test_data order-independent
When updating setuptools from 74 to 76, order of extras has changed.
The order of the output is not considered stable and does not need to be asserted.
2025-03-17 08:20:11 +01:00
Miro Hrončok
e9f7ceb420 CI: Update the tested pluggy
Fedora 43 no longer has pytest 7.
2025-03-14 10:13:07 +01:00
Tomas Orsava
caad857e1a Mention ELN/CentOS Stream version needed for the Declarative Build System 2025-03-06 18:25:23 +01:00
Karolina Surma
b2862d315f PEP 639 is now accepted, remove the note about its provisional status 2025-02-27 13:44:24 +01:00
Miro Hrončok
ac4f008073 CI: Convert all test spec License tags to SPDX
python-ldap is a SPDX tag: https://spdx.org/licenses/python-ldap.html
2025-02-05 16:17:50 +01:00
Miro Hrončok
aac6644d02 Add the -M flag to %pyproject_save_files
- The flag can be used to indicate no Python modules should be saved

The change wrt users using '*' was necessary,
as `glob` was undefined when `module_globs` was empty.
2025-02-05 16:17:50 +01:00
Fedora Release Engineering
79d31f177e Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-18 11:18:54 +00:00
Miro Hrončok
ee9d130fdc Deprecate the provisional -w flag for %pyproject_buildrequires
The option was provisional, so it had no compatibility guarantees.
We keep the option anyway: there will be no removals just for the sake of removals.

All remaining usages in Fedora Rawhide have open Pull Requests to replace it with -p,
or remove it entirely.

Examples:

 https://src.fedoraproject.org/rpms/python-scikit-misc/pull-request/13
 https://src.fedoraproject.org/rpms/python-traitlets/pull-request/8
 https://src.fedoraproject.org/rpms/packit/pull-request/1402
2024-12-03 21:43:58 +01:00
Miro Hrončok
c1de18f683 Accept arbitrary options from %pyproject_buildrequires in pyproject-srpm-macros
This way, when we add new options to the actual macro in pyproject-rpm-macros,
spec files that use them are parsable with the old pyproject-srpm-macros package.

Last time, when we added the -g option in 1.16.0,
it took at least a week for Fedora CI to be able to parse a spec file with it,
as pyproject-srpm-macros 1.16.0+ needed to actually be installed on the CI systems.

Next time this happens, the new option will be parsable with older versions of pyproject-rpm-macros

Note that the (-) syntax is not supported yet on RPM 4.16 in RHEL 9.
I'd use an expression to keep the literal set of flags for older RPM versions:

    %pyproject_buildrequires(%[v"0%{?rpmversion}" >= v"4.19" ? "-" : "rRxtNwpe:g:C:"])

But macro options are not processed as macros:
https://github.com/rpm-software-management/rpm/issues/3440

As a result, this is not compatible with RHEL 9 and cannot be backported to it.
Unless the (-) syntax is backported:
https://issues.redhat.com/browse/RHEL-67161
https://gitlab.com/redhat/centos-stream/rpms/rpm/-/merge_requests/60
2024-12-03 12:58:44 +01:00
Miro Hrončok
d0e32d9246 CI: Rename in-tree patches to make them nicer in a single directory 2024-12-03 11:31:09 +01:00
Lukáš Zachar
cd00547996 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.

Cherry-picked from https://gitlab.com/redhat/centos-stream/rpms/pyproject-rpm-macros/-/merge_requests/25

Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
2024-12-02 13:34:42 +01:00
Miro Hrončok
665fd2456d CI: Simplify spec conditionals wrt Fedora 39 going EOL 2024-11-20 13:29:25 +01:00
Miro Hrončok
a69fb4e183 CI: %{pyproject_build_lib} changed on EL9
The actual value is still OK, but the tests were too strict.
2024-11-15 14:41:41 +01:00
Miro Hrončok
1532f1893f 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
2024-11-13 14:01:09 +01:00
Miro Hrončok
4ddd57c537 Fixup the version-release 2024-11-07 17:14:52 +01:00
Miro Hrončok
20b7ac63f3 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
2024-11-07 13:00:47 +01:00
Miro Hrončok
8baa94160c %pyproject_buildrequires: Add support for dependency groups (PEP 735), via tox configuration 2024-11-06 13:31:41 +01:00
Miro Hrončok
307d2bef63 %pyproject_buildrequires: Add support for dependency groups (PEP 735), via the -g flag 2024-11-05 11:31:33 +01:00
Miro Hrončok
80d9abe0f4 Minor documentation clarification wrt -p/-w 2024-11-05 11:31:03 +01:00
Miro Hrončok
beceb2c94b PEP 639 is provisional, no longer a draft 2024-11-03 10:00:34 +01:00
Karolina Surma
bc6cb55227 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.
2024-10-04 09:54:08 +02:00
Miro Hrončok
c7553b2c7d Even when %_auto_set_build_flags is disabled, set all compiler flags when building wheels
- Fixes: rhbz#2293616
2024-09-23 15:53:23 +02:00
Miro Hrončok
8a41ec5715 Don't generate a dependency on pip when %pyproject_buildrequires -N is used
- Fixes: rhbz#2294510
2024-09-23 14:39:00 +02:00
Karolina Surma
9f43e2a760 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.
2024-09-23 11:48:20 +02:00
Miro Hrončok
ab3dc0126a CI: Update setuptools_scm to a version that can be tested on EL9, EL10, Fedora 39-42 2024-09-07 12:42:44 +02:00
Miro Hrončok
459cda2e67 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.
2024-09-07 12:42:44 +02:00
Miro Hrončok
89374b9107 CI: python-virtualenv: Drop an unused dependency on python3-flaky
We don't have flaky in EL 10 yet.
2024-09-07 12:42:44 +02:00
Miro Hrončok
4a4614d13a CI: Use poetry-core in python-clikit.spec for EL10 compatibility 2024-09-07 12:42:44 +02:00
Miro Hrončok
32a3b5613f CI: Use flit_core in python-entrypoints.spec for EL10 compatibility 2024-09-07 12:42:44 +02:00
Miro Hrončok
049eb198d0 CI: Make python-pytest.spec build on EL 10 (but not on EL 9 anymore) 2024-09-07 12:42:44 +02:00
Miro Hrončok
dddc9bf556 CI: Use tomli rather than toml in fake-requirements.spec
toml is deprecated and not available on EL10.
2024-09-07 12:42:44 +02:00
Lumir Balhar
c8abf80acd Mark the license in the specfile as SPDX formula 2024-09-05 21:41:19 +00:00
Miro Hrončok
6f1ac1b126 CI: There is no EPEL 10 Next, use plain EPEL mock chroots on RHEL 10+ 2024-08-20 11:47:19 +02:00
Miro Hrončok
1278dd8dbd 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
2024-08-05 23:22:26 +00:00
Miro Hrončok
7c4ffdcf84 CI: Make python-pluggy build on Fedora 41+ 2024-08-05 18:21:41 +02:00
Miro Hrončok
3539b832c8 CI: Allow platformdirs 4 in python-virtualenv.spec 2024-07-25 11:54:55 +02:00
Miro Hrončok
e7b37d02f8 Add a provisional RPM Declarative Buildsystem (RPM 4.20+) 2024-07-25 11:54:55 +02:00
Fedora Release Engineering
bc3d8013a4 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-19 08:56:55 +00:00
Miro Hrončok
436695615e Revert the temporary workaround for RPM 4.20 alpha 2 leaking \x1f (unit separators)
This reverts commit 996ac31b46.
2024-07-03 16:03:03 +02:00
Miro Hrončok
6d455af4dc Properly escape weird characters from paths in %{pyproject_files} (RPM 4.19+ only) 2024-07-02 23:53:19 +02:00
Cristian Le
d74914ec13 %pyproject_extras_subpkg: Allow passing -a or -A to %python_extras_subpkg
Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
2024-06-25 12:27:56 +02:00
Miro Hrončok
996ac31b46 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.
2024-06-04 10:46:50 +02:00
Miro Hrončok
d0a66a2871 README: Add a missing link 2024-05-22 20:38:10 +02:00
Miro Hrončok
fa7c91c65d 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
2024-04-11 13:32:17 +02:00
Miro Hrončok
3667fcd240 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
2024-02-06 10:48:01 +01:00
Miro Hrončok
a069958530 Document why we generate a dependency on wheel when the default build backend is used 2024-02-05 17:20:54 +01:00