Commit Graph

98 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
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
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
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
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
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
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
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
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
Miro Hrončok
3f1dd1c441 Use %rpmversion to check if we are on RPM 4.19+ 2024-01-26 11:15:16 +01:00
Miro Hrončok
e7332c16ab CI: Don't treat DeprecationWarnings in setuptools_scm's %check as errors 2024-01-26 11:15:16 +01:00
Miro Hrončok
a0c94e93cf CI: Update setuptools to make it build with Python 3.12
This still works on Fedora 37/38. EL 9 uses a different setuptools version for tests.
2024-01-26 11:15:16 +01:00
Miro Hrončok
ff6ed86bff CI: Update poetry-core to workaround a weird FTBFS on Fedora 39+
This still builds on previous Fedoras and EPEL 9.
2024-01-26 11:15:16 +01:00
Miro Hrončok
a594a93c9b CI: Update ipykernel to a version that no longer uses the imp module
This still works on Fedora 37 and 38. The c9s package skips this test.
2024-01-26 11:15:16 +01:00
Miro Hrončok
d24b6f418d CI: Apply a FTBFS fix from Fedora 39 to the virtualenv spec 2024-01-26 11:15:16 +01:00
Miro Hrončok
d578e3b8dc CI: Make pytest build on Fedora 37 to 39 as well as EPEL 9 2024-01-26 11:15:16 +01:00
Miro Hrončok
31f99e7ad0 CI: Run mock in verbose mode to see the logs 2024-01-26 11:15:16 +01:00
Miro Hrončok
ab6c5538e5 CI: Run a build of pyproject-rpm-macros.spec --with tox_tests (RHEL 9 specific)
Related: rhbz#2208971
2023-06-01 21:24:22 +02:00
Miro Hrončok
e8933acb12 CI: Run a couple of Python 3.11 builds (RHEL 9 specific)
Related: rhbz#2208971
2023-06-01 21:24:22 +02:00
Miro Hrončok
6a97abbde7 Accept multiple values for the same config settings
Related: rhbz#2208971
2023-06-01 21:24:22 +02:00
7f75263357 Allow passing config_settings to the build backend
Related: rhbz#2208971
2023-05-31 21:37:01 +02:00
Miro Hrončok
d5a5919a27 Fix literal % handling in %{pyproject_files} on RPM 4.19
RPM 4.19 now requires 2 %s to escape a single literal % in the filelist.

The test has been adjusted to actually run our code
instead of only verifying the assumptions.

Related: rhbz#2208971
2023-05-31 18:21:18 +02:00
Miro Hrončok
9e4b88057b CI: Make python-virtualenv.spec EL9-compatible
Related: rhbz#2208971
2023-05-30 13:11:41 +02:00
Miro Hrončok
e9b491535c Redirect stdout to stderr via Shell
Dependencies are recorded to a text file that is catted at the end.

This should prevent subtle bugs like https://bugzilla.redhat.com/2183519 in the future.

Related: rhbz#2208971
2023-05-30 10:43:35 +02:00
Lumir Balhar
e828b8291a Remove .dist-info directory at the end of %pyproject_buildrequires
An incomplete .dist-info directory in $PWD can confuse tests in %check.
For example, virtualenv uses importlib.metadata to load its
entry points and it does not work when it finds a virtualenv...dist-info without them.

Related: rhbz#2208971
2023-05-30 10:37:26 +02:00
Miro Hrončok
d46b0e5b01 CI: Unskip 1 skipped package and update comments for the remaining 2
Packages were introduced to EPEL9 in the meantime.

Related: rhbz#2168193
2023-02-13 16:42:58 +01:00
Miro Hrončok
1a404c23b3 CI: Adjust spec conditionals for F35 EOL
Also, use %elif instead of a nested %if.

Related: rhbz#2168193
2023-02-13 16:42:58 +01:00
Miro Hrončok
159b22e742 Add pyproject-srpm-macros with a minimal %pyproject_buildrequires macro
pyproject-srpm-macros is intended to be installed in the default buildroot.

That way, no explicit BuildRequires for pyproject-rpm-macros are required,
as long as %pyproject_buildrequires is used in %generate_buildrequires.

When only pyproject-srpm-macros is installed, the minimal implementation of
%pyproject_buildrequires generates a dependency on pyproject-rpm-macros.
When pyproject-rpm-macros is installed, it overrides the implementation
of %pyproject_buildrequires with the full one.

Note that in Fedora, pyproject-rpm-macros is required by python3-devel,
but not in RHEL.
This allows us to keep pyproject-rpm-macros in the RHEL CRB repository.

Related: rhbz#2168193
2023-02-13 16:42:58 +01:00
Miro Hrončok
251f8e97c9 CI specs: Never use ! ... as a check (followup)
This is a followup of 6015300d34

This particular instance was not discovered before due to the macro.

Related: rhbz#2168193
2023-02-13 16:42:58 +01:00
Miro Hrončok
eb8a225689 CI: Adjust %toxenv tests for tox 4
Related: rhbz#2168193
2023-02-13 16:42:58 +01:00
Miro Hrončok
a6c5229070 CI: Manually BR pkg_resources from dns-lexicon to fix FTBFS
setuptools (pkg_resources) were transitively pulled in by tox

Related: rhbz#2168193
2023-02-13 16:42:58 +01:00
Miro Hrončok
81dd6d1601 CI: Keep patches near the specs to ease using the script from other dist-gits
That way, if a package (such as python-tox) uses it,
the patches in dist-git are available.
In the future, it also allows us to add patches without URLs to our tested spec files.

Related: rhbz#2168193
2023-02-13 16:42:58 +01:00
Miro Hrončok
4c1e725938 CI: Adjust setuptools versions to make the CI mockbuilds work on Fedora 36 and 38
Related: rhbz#2168193
2023-02-13 16:42:58 +01:00
Karolina Surma
14b3f4b9c3 Filter discovered modules to match the given %pyproject_save_files globs
When certain modules are deliberately not included into the built RPM,
they shouldn't be listed in the list of qualified module names which are
used by %pyproject_check_import to test importability of the
distribution.

Related: rhbz#2168193
2023-02-13 16:42:57 +01:00
Miro Hrončok
064e6f283c %pyproject_save_files: Support License-Files installed into the *Root License Directory* from PEP 369
Files still need to be marked as License-File to be considered %license,
but if their path in METADATA is specified relative to dist-info/licenses,
they are correctly recognised.

This makes License-Files specified by hatchling 1.9.0+ marked as %license.

Related: rhbz#2168193
2023-02-13 16:42:39 +01:00