Commit Graph

77 Commits

Author SHA1 Message Date
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
Maxwell G 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
Miro Hrončok 8c8a3ad80b CI: Invoke mock with --isolation=simple to workaround problems with systemd-nspawn
See https://pagure.io/fedora-ci/general/issue/217

Related: rhbz#2117571
2022-08-17 16:57:15 +02:00
Miro Hrončok a438f38c28 CI: Apply the hack in python-ldap.spec also on RHEL 9
Related: rhbz#2117571
2022-08-16 16:31:33 +02:00
Miro Hrončok 804d83af30 CI: On CentOS Stream, use EPEL Next, not EPEL proper
Also, make sure to never pull from EPEL's Koji repo,
as is also exposes RHEL packages in the metadata, but they error 403.

    [MIRROR] libgcrypt-1.10.0-4.el9_0.x86_64.rpm: Status code: 403 for https://infrastructure.fedoraproject.org/repo/rhel/rhel9/x86_64/rhel-9-for-x86_64-baseos-rpms/Packages/l/libgcrypt-1.10.0-4.el9_0.x86_64.rpm

We just pull from the CentOS Stream Koji repo and EPEL Next Koji repo.
See the mock config for centos-stream+epel-next-9.

Related: rhbz#2117571
2022-08-16 16:31:33 +02:00
Karolina Surma a81b91497f CI: Patch httpbin to build it in Rawhide with werkzeug
Related: rhbz#2117571
2022-08-11 13:05:53 +02:00
Miro Hrončok 9899e0fa03 Fix CI tests for setuptools 61+
Related: rhbz#2117571
2022-08-11 13:05:53 +02:00
Miro Hrončok 589556411f %pyproject_buildrequires: Support Package information on ELF objects
When extension modules are built in %pyproject_buildrequires,
we need to create the package note file.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2097535

This is tested via python-ldap -- %pyproject_buildrequires -w fails without the fix.

Neither python-markupsafe nor python-mistune can be used as a test
because they only warn when the extension module cannot be built
because they fallback to pure Python.

Related: rhbz#2117571
2022-08-11 13:05:50 +02:00
Owen W. Taylor 681cc65e49 %pyproject_install: pass %{_prefix} explicitly to pip install
This makes things work for %{_prefix} other than user, when combined
with a change in python-rpm-macros to the definition of python3_sitelib/python3_sitearch.

https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/thread/KEQMMNJ4HTTHSQLK6P4DJJTVPA36SS3W/

Related: rhbz#2117571

Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
2022-08-11 12:57:19 +02:00
Miro Hrončok e082e4a71a CI and docs: Remove Fedora 34 conditionals and mentions
Fedora 34 is end of life.

Related: rhbz#2117571
2022-08-11 12:57:01 +02:00
Miro Hrončok 295b331296 CI: Enable hatchling test for Fedora 35 and EPEL 9
https://bodhi.fedoraproject.org/updates/FEDORA-2022-c0d0bd9fa8
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2022-b15c2993fe

Related: rhbz#2117571
2022-08-11 12:56:14 +02:00
Miro Hrončok 235e0c94a6 Allow building wheels in %pyproject_buildrequires to support other build backends
The hook is optional, see https://www.python.org/dev/peps/pep-0517/#prepare-metadata-for-build-wheel

> If a build frontend needs this information and the method is not defined,
> it should call build_wheel and look at the resulting metadata directly.

This is not yet automatically detected because the feature is provisional.
Use `%pyproject_buildrequires -w` to opt-in.

Resolves: rhbz#2060109
2022-05-06 12:19:26 +02:00
Miro Hrončok a02a1ae59f CI: More retrying for dnf, apparently 5 times 20 seconds is not enough
Related: rhbz#2060109
2022-05-06 12:19:08 +02:00
Miro Hrončok d7bc2a357f %pyproject_save_files: Support nested directories in dist-info
Related: rhbz#2060109
2022-05-06 12:19:08 +02:00
Miro Hrončok 0b9b782c5c CI specs: Never use `! ...` as a check
See https://lists.fedoraproject.org/archives/list/packaging@lists.fedoraproject.org/thread/TFQGD7CSTD5WVKVT3WDIGF5D6DID5NK6/

Related: rhbz#2060109
2022-05-06 12:18:50 +02:00
Miro Hrončok 44772c3c74 CI: Install EPEL packages via full URL to support running tests on real RHEL
Resolves: rhbz#2065590
2022-03-23 16:46:15 +01:00
Miro Hrončok a9aa69f463 CI: Move one %files section to test different order
Related: rhbz#2060109
2022-03-23 15:13:17 +01:00
Miro Hrončok 797cac8d85 CI: Make most of the tests work on EPEL 9
Resolves: rhbz#2065590
2022-03-18 10:50:33 +01:00
Miro Hrončok 3e4bfeffd8 CI: Skip some tests that would be to useless with reduced dependencies
Resolves: rhbz#2065590
2022-03-18 10:50:33 +01:00
Miro Hrončok fc08e7cf3e CI: Determine mock chroot for centos-stream+epel, try not to break Fedora
Resolves: rhbz#2065590
2022-03-18 10:50:30 +01:00
Miro Hrončok 76dc49fd1e CI: Enable EPEL Next
The ansible thing that installs packages does that one by one.

Hence, the assumption is that by installing epel-next-release first,
mock should be available next.

Resolves: rhbz#2065590
2022-03-18 10:50:16 +01:00
Miro Hrončok 3c5fe19ca1 CI tests: Workaround python-ldap missing support fro OpenLDAP 2.5+
Related: rhbz#2060109
2022-03-02 18:33:45 +01:00
Miro Hrončok 600c6d59a7 CI tests: Sed ipykernel to declare missing dependency on ipython_genutils
Related: rhbz#2060109
2022-03-02 18:33:25 +01:00