Commit Graph

222 Commits

Author SHA1 Message Date
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
Major Hayden
3309d2d16d Write warning to >&2 instead of /dev/stderr
Writing to /dev/stderr with > or >> does not work properly in a mock chroot.

https://bugzilla.redhat.com/show_bug.cgi?id=1965470
2021-05-27 18:42:37 +00:00
Miro Hrončok
99ed4639da Generate BuildRequires on extras in lower case 2021-04-07 16:25:06 +02:00
Miro Hrončok
7e1a8fd079 Handle tox provision (tox.requires / tox.minversion) 2021-04-07 16:01:33 +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
Miro Hrončok
ff396611dd Generate python3dist(setuptools/wheel) BuildRequires directly from the macro
The macro already checks if pyproject.toml exists and echoes the dependency
on python3dist(toml) early. This adds an else branch to echo the default backend.

For projects without pyproject.toml, the number of installation rounds
is reduced. Previously:

 1. (python3-devel +) pip + packaging
 2. setuptools + wheel
 3. ...

Now:

 1. (python3-devel +) pip + packaging + setuptools + wheel
 2. ...

This duplicates the information about the default build backend,
because the script still needs to handle projects with pyproject.toml without
an explicit build backend option.
Hence, the script was not adapted (except a comment).
2021-02-03 12:00:58 +01:00
Miro Hrončok
06b21e1976 Generate python3dist(toml) BuildRequires directly from the macro
The macro checks if pyproject.toml exists and echoes the dependency early.

For projects with pyproject.toml, this saves one installation round.
Previously, the installation steps by %generate_buildrequires were:

 1. (python3-devel +) pip + packaging
 2. toml
 3. parsed dependencies from pyproject.toml
 4. ...

Now they are:

 1. (python3-devel +) pip + packaging + toml
 2. parsed dependencies from pyproject.toml
 3. ...

For projects without pyproject.toml, the number of rounds remains the same:

 1. (python3-devel +) pip + packaging
 2. setuptools + wheel
 3. ...

This is also more consistent:
The Python script now only outputs dependencies of the probed project,
it no longer partially outputs dependencies for itself.
2021-02-03 12:00:58 +01:00
Miro Hrončok
390b9713aa Remove support for Python 3.7 from %pyproject_buildrequires
Fedora 31 is EOL and was the last one with Python 3.7 packages.
EL 8 has Python 3.6 but doesn'T have %generate_buildrequires.
2021-02-03 12:00:58 +01:00
Fedora Release Engineering
59d092e9dd - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-27 08:56:41 +00:00
Miro Hrončok
7d98feee23 Update the description of the package to match the new README content
https://bugzilla.redhat.com/show_bug.cgi?id=1914450#c5
2021-01-15 18:47:11 +01:00
Miro Hrončok
d8b6408932 %pyproject_save_files: List all files from RECORD and their %dirs
This is done to avoid troubles with %lang files listed as duplicated.

 1. It gets rid of a warning
 2. It fixes a problem described in:
    http://lists.rpm.org/pipermail/rpm-list/2020-November/002041.html

This is a backwards incompatible change,
packages that rename or remove the installed files after %pyproject_install
might no longer be compatible with %pyproject_save_files.
2021-01-11 15:14:21 +01:00
Miro Hrončok
8a31feb8e1 CI: Allow passing extra arguments to mocktest.sh 2021-01-08 23:45:30 +01:00
Miro Hrončok
76613bd4a7 CI mock: Attempt to retry package manager action
This should be more robust when hitting:

 Errors during downloading metadata for repository 'local':
   - Status code: 404 for https://kojipkgs.fedoraproject.org/repos/rawhide/latest/x86_64/repodata/...-primary.xml.gz
   - Status code: 404 for https://kojipkgs.fedoraproject.org/repos/rawhide/latest/x86_64/repodata/...-filelists.xml.gz
2021-01-08 14:52:06 +01:00
Miro Hrončok
03fa61b26b CI: Upgrade dns-lexicon to 3.5.2, but only on Fedora 34+ 2020-12-04 10:50:59 +01:00
Miro Hrončok
32790fff20 Pass PYTHONDONTWRITEBYTECODE=1 to %tox to avoid packaged PYTEST bytecode 2020-12-04 10:50:58 +01:00
Miro Hrončok
38ef5fb85b Allow multiple -e in %pyproject_buildrequires 2020-11-04 18:35:22 +01:00
Miro Hrončok
2660031756 CI tests: Use ! grep to assert something is missing
Previously, we have used `grep -v` to assert something is *not* there.
However, that doesn't work. See for example this file:

    $ cat TEST
    line1
    line2
    line3

    $ grep -v line4 TEST
    line1
    line2
    line3
    $ echo $?
    0

This gives a false sense of correctness, however it exits will 0 with anything:

    $ grep -v line3 TEST
    line1
    line2
    $ echo $?
    0

Instead, we use `! grep` now:

    $ ! grep line4 TEST
    $ echo $?
    0

    $ ! grep line3 TEST
    line3
    $ echo $?
    1

Additionally, remove a trailing slash from one of the checks to match both cases
(with or without the slash).
2020-10-26 17:18:51 +01:00