Commit Graph

102 Commits

Author SHA1 Message Date
Miro Hrončok
a4d05ba2c2 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.
2023-01-20 21:57:49 +01:00
Miro Hrončok
03e6d054b8 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.
2023-01-14 23:57:54 +01:00
Miro Hrončok
d311a522b7 CI: Adjust %toxenv tests for tox 4 2023-01-14 23:57:54 +01:00
Miro Hrončok
2c69069593 CI: Manually BR pkg_resources from dns-lexicon to fix FTBFS
setuptools (pkg_resources) were transitively pulled in by tox
2023-01-14 23:57:54 +01:00
Miro Hrončok
e5c4bb2455 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.
2023-01-09 17:27:31 +01:00
Miro Hrončok
cb40ce3612 CI: Adjust setuptools versions to make the CI mockbuilds work on Fedora 36 and 38 2022-12-15 18:40:24 +01:00
Karolina Surma
516e1511a7 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.
Resolves: https://bugzilla.redhat.com/2127958
2022-10-03 13:22:48 +02:00
Miro Hrončok
92ad52e5d4 %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.
2022-09-19 18:22:03 +02:00
Miro Hrončok
b2bb5439dc CI: Invoke mock with --isolation=simple to workaround problems with systemd-nspawn
See https://pagure.io/fedora-ci/general/issue/217
2022-08-17 16:57:03 +02:00
Miro Hrončok
db73e5a026 CI: Apply the hack in python-ldap.spec also on RHEL 9 2022-08-16 16:33:33 +02:00
Miro Hrončok
c839a6f8aa 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.
2022-08-16 16:33:19 +02:00
Karolina Surma
3d854401bd CI: Patch httpbin to build it in Rawhide with werkzeug 2022-08-10 09:12:40 +02:00
Miro Hrončok
111dd87a26 Fix CI tests for setuptools 61+ 2022-07-14 23:50:38 +02:00
Miro Hrončok
5b7df3cdd7 %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.
2022-06-17 11:03:18 +02:00
Owen W. Taylor
946c8726cf %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/

Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
2022-06-08 14:11:27 +02:00
Miro Hrončok
e31d5d5683 CI and docs: Remove Fedora 34 conditionals and mentions
Fedora 34 is end of life.
2022-06-06 05:51:34 +00:00
Miro Hrončok
dbe0eb9497 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
2022-05-06 14:02:36 +02:00
Miro Hrončok
40f6765e0e 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.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2076994
2022-04-29 12:42:37 +02:00
Miro Hrončok
2998811594 CI: More retrying for dnf, apparently 5 times 20 seconds is not enough 2022-04-27 10:34:30 +02:00
Miro Hrončok
6d0900f5b5 %pyproject_save_files: Support nested directories in dist-info 2022-04-27 10:34:03 +02:00
Miro Hrončok
6015300d34 CI specs: Never use ! ... as a check
See https://lists.fedoraproject.org/archives/list/packaging@lists.fedoraproject.org/thread/TFQGD7CSTD5WVKVT3WDIGF5D6DID5NK6/
2022-04-12 14:58:09 +02:00
Miro Hrončok
8e9b0a2a0d CI: Move one %files section to test different order 2022-03-22 18:59:53 +01:00
Miro Hrončok
50b5e637bf CI: Make most of the tests work on EPEL 9 2022-03-17 17:59:38 +01:00
Miro Hrončok
ed8ae6b328 CI: Determine mock chroot for centos-stream+epel, try not to break Fedora 2022-03-17 17:03:02 +01:00
Miro Hrončok
b88716ab8b CI tests: Workaround python-ldap missing support fro OpenLDAP 2.5+ 2022-02-22 20:49:52 +01:00
Miro Hrončok
e82e802470 CI tests: Sed ipykernel to declare missing dependency on ipython_genutils 2022-02-22 20:35:52 +01:00
Miro Hrončok
5cffd20919 Make the whitespace identical to c9s to avoid further conflicts 2022-02-02 21:24:10 +01:00
Karolina Surma
c3a20e9a33 Include compressed manpages correctly in the RPM package
Compressed manpages have different extension than those listed in the RECORD file,
so they were not recognized when %%pyproject_save_files '+auto' flag
was provided.
To enable the path recognition, if the manpage extension matches the one
listed in brp-compres, the extension is removed, and an asterisk is now added
to the manpages filenames.
Source: https://docs.fedoraproject.org/en-US/packaging-guidelines/#_manpages
Fixes: https://bugzilla.redhat.com/2033254
2022-01-20 19:57:47 +01:00
Miro Hrončok
8c8afba774 %pyproject_buildrequires: Make -r (include runtime) the default, use -R to opt-out
See the proposal:
https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/thread/2R6NKELTHAWE6PI3CCZBVW5PMGO5VPDG/

 - -N now implies -R
 - the macro still guards against -Nr and now also against -Rr
2022-01-18 17:50:00 +01:00
Miro Hrončok
55905e4681 Define provisional %pyproject_build_lib 2021-12-10 12:40:50 +01:00
Miro Hrončok
25646ef7c1 CI tests: Update setuptools_scm to fix FTBFS on rawhide 2021-11-29 16:52:09 +01:00
Miro Hrončok
d5f4f199b6 CI tests: Remove Fedora 33 compatibility shims, as F33 reaches EOL 2021-11-29 15:12:43 +01:00
Karolina Surma
c1baa534b6 Introduce %%pyproject_check_import
%%pyproject_save_files newly saves also a list of importable modules.
The list is used by %%pyproject_check_import to invoke the import test
on each module name.
%%pyproject_check_import accepts two options:
-t: filter only top-level modules
-e: exclude module names matching the given glob from the import check
2021-10-29 08:40:42 +02:00
Miro Hrončok
cefe82ed0d CI: Update the dns-lexiocn package so it also builds on Fedora 36+ 2021-10-25 16:24:32 +02:00
Miro Hrončok
6bbba680f4 Fedora CI: Update pytest so it still builds on Fedora 36 with pluggy 1.0 2021-09-09 12:12:13 +02:00
Tomas Hrnciar
5169e0e340 Automatically detect LICENSE files and mark them with %license macro 2021-07-23 13:30:43 +02:00
Miro Hrončok
8588098b34 Rename %_pyproject_ghost_distinfo and %_pyproject_record to indicate they are private 2021-07-23 10:01:13 +02:00
Miro Hrončok
f8a3343abc %pyproject_buildrequires now fails when it encounters an invalid requirement
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1983053
2021-07-23 10:00:01 +02:00
Miro Hrončok
49b58d7869 CI tests: Skip failing tests of python-httpbin
The tests are failing on Fedora 35+ for reasons beyond pyproject-rpm-macros.
2021-07-17 00:29:04 +02:00
Miro Hrončok
d204ac14cd Escape weird paths generated by %pyproject_save_files 2021-07-13 11:29:19 +02:00
Miro Hrončok
639beeeaac CI tests: Update pytest's patch for Python 3.10.0b4+ 2021-07-13 01:29:48 +02:00
Tomas Hrnciar
d6ad9a778a Generate BuildRequires from file
%pyproject_buildrequires macro now accepts multiple file names to load
additional dependencies from them.

New option -N was added to disable automatical generation of requirements
in case package does not use build system. Option -N cannot be used in
combination with options -r, -e, -t, -x.

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2021-07-08 13:08:04 +02:00
Miro Hrončok
5470f5688e Avoid leaking %{_pyproject_builddir} to pytest collection
Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1935212

Requires a %pytest change: https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/102
2021-06-28 14:07:29 +02:00
Miro Hrončok
46e4eb4bcd CI tests: Make python-pytest.spec build with Python 3.10+
Preserve compatibility with Fedora 33.
2021-06-17 13:08:36 +02:00
Miro Hrončok
29157c19b0 Set %_pyproject_wheeldir and %_pyproject_builddir relative to the source tree, not $PWD
This allows users to do:

    %build
    cd somewhere
    %pyproject_wheel
    cd -
    cd somewhere_else
    %pyproject_wheel
    cd -

    %install
    %pyproject_install

Without a need to copy paste the wheels to a common location.

This is in fact a breaking change, I'll make sure to adapt the affected packages in Fedora.
2021-05-27 21:28:01 +02:00
Miro Hrončok
c95238388a Don't leak $TMPDIR outside of pyproject macros
During %install, the BRB scripts might be affected by it
2021-05-27 21:28:01 +02:00
Miro Hrončok
c0c09a476a Cleanup the tests (and docs) for Fedora 32 EOL 2021-05-27 21:27:39 +02:00
Miro Hrončok
11021cf250 CI: Update requests version to work with chardet 4 (needed for Fedora 34+) 2021-02-07 21:26:32 +01:00
Miro Hrončok
cc5688e49d Include nested __pycache__ directories in %pyproject_save_files 2021-02-07 20:05:47 +01:00
Miro Hrončok
26bb3cb4d1 Tests: Update setuptools_scm to fix a problem with pytest 6.2 2021-02-04 12:41:09 +01:00