Commit Graph

240 Commits

Author SHA1 Message Date
Miro Hrončok
ae639fc020 Prefix paths of intermediate files (such as %{pyproject_files}) with NVRA
Apparently, when you repeatedly run `rpmbuild -ba`, files in %_builddir are not cleaned.
This way, we at least make sure the files are unique between different NVRAs,
so 2 unrelated builds don't share the files between each other.

Keeping files contained in the build subdirectory is the more common way of doing this,
but we cannot technically do that, because we don't know what's it gonna be (before %prep).

Should be backwards compatible, as we only modify underscore-prefixed macros and %{pyproject_files},
where the exact value should not matter to the packagers.
2022-03-22 18:22:11 +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
60d3234b01 Release final version 1.0.0
There are no code changes.
2022-03-01 17:13:12 +01:00
Lumir Balhar
3deb3f4147 Updated compatibility with tox4 2022-02-22 23:50:22 +00: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
Miro Hrončok
8d63af8708 Disable certain rpminspect inspections not relevant to this package 2022-01-27 11:48:39 +00:00
Miro Hrončok
94d7dd2955 Release version 1.0.0, first release candidate 2022-01-25 17:07:24 +01:00
Miro Hrončok
f4bbff36d2 %pyproject_buildrequires: Generate BuildRequires for this package
This package is already installed -- otherwise the macro would not even exist.

However, since python3-devel has started to Require pyproject-rpm-macros,
it is no longer possible to use `repoquery --whatrequires pyproject-rpm-macros`
to get a reliable list of packages that use the macros.

This was, all packages that use %pyproject_buildrequires will BuildRequire the macros explicitly.

(In the future, we could even include a stub version of %pyproject_buildrequires
in pyproject-srpm-macros (always installed in the buildroot),
that only echoes this package,
so packagers would not need to manually BuildRequire anything at all.)
2022-01-25 16:45:49 +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
Hunor Csomortáni
832e19f5ab
docs: Don't BuildRequire these macros in Fedora and EPEL 9
`python3-devel` already requires `pyproject-rpm-macros` in Fedora and
EPEL 9. Update the usage docs to reflect this.

Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
2022-01-13 16:29:05 +01:00
Gordon Messmer
ec5fc7a5cd Handle legacy version specifiers that would previously raise exceptions. 2021-12-19 14:09:06 -08:00
Miro Hrončok
55905e4681 Define provisional %pyproject_build_lib 2021-12-10 12:40:50 +01:00
Miro Hrončok
c80fe03b9b Require sed, as we use it 2021-12-10 12:38:37 +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
Gordon Messmer
92802d7afe Sync dependency conversion with upstream pyreq2rpm.
Improve handling of > operator, preventing post-release from satisfying most rpm requirements.
Improve handling of < operator, preventing pre-release from satisfying rpm requirement.
Improve handling of != operator with prefix matching, preventing pre-release from satisfying rpm requirements.
2021-11-03 12:46:16 +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
27e23c1e87 %pyproject_buildrequires: Accept installed pre-releases for all requirements
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2014639
2021-10-25 15:02:22 +00: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
5b8bb42933 %pyproject_save_files: Add a workaround error for spaces and [brackets]
See the added links for details.
We cannot fix this for now,
so we error out early instead of producing a broken filelist.
2021-09-09 15:56:15 +02:00
Miro Hrončok
27cff80a5f %pyproject_save_files: Expand the namespace error message, also display it with / 2021-09-09 15:56:15 +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
Benjamin A. Beasley
f8e0c247de Change “requirement file” to match “requirements file[s]” elsewhere 2021-07-25 17:37:01 -04:00
Benjamin A. Beasley
6ee7a6baea Fix two misspellings of “requirements,” one user-visible 2021-07-25 17:35:52 -04: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
5729f18ddb Fix a typo in README 2021-07-23 10:01:13 +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
Petr Viktorin
aeb21f671f Split requirements.txt parsing to its own module; test & improve it 2021-07-23 10:00:01 +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
Fedora Release Engineering
3406e9332b - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-23 04:29:49 +00:00
Miro Hrončok
196bc9049d All supported Fedoras can have dependencies on extras 2021-07-17 15:06:23 +02:00
Miro Hrončok
c3161aefe4 Explicitly require the "basic" Python RPM macros 2021-07-17 15:05:33 +02:00
Tomas Hrnciar
5b1caad68e %pyproject_buildrequires: Fallback to setuptools.build_meta:__legacy__ only if setup.py exists
Fixes: rhbz#1976459
2021-07-17 00:36:57 +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
ddaf2e9fb2 %pyproject_buildrequires: Support x.* versions
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1981558
2021-07-13 12:23:35 +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
299caacb5b Fix typos in %changelog 2021-07-13 01:30:43 +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
2abcad96dd Don't accidentally treat "~= X.0" requirement as "~= X"
Don't canonicalize the version twice.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1977060
2021-06-29 12:43:13 +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
346c9bc80a Fix a typo 2021-06-23 12:26:28 +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