crit: add requirements.txt for pip>=20.1

When building with pip version 20.0.2 or older, the pip install
command creates a temporary directory and copies all files from
./crit. This results in the following error message:

    ModuleNotFoundError: No module named 'pycriu'

This error appears because the symlink 'pycriu' uses a relative path
that becomes invalid '../lib/py/'.

The '--no-build-isolation' option for pip install is needed to enable
the use of pre-installed dependencies (e.g., protobuf) during build.

The '--ignore-installed' option for pip is needed to avoid an error when
crit is already installed. For example, crit is installed in the GitHub
CI environment as part of the criu OBS package as a dependency for
podman.

Distributions such as Arch Linux have adopted an externally managed
python installation in compliance with PEP 668 [1] that prevents pip
from breaking the system by either installing packages to the system or
locally in the home folder. The '--break-system-packages' [2] option
allows pip to modify an externally managed Python installation.

[1] https://peps.python.org/pep-0668/
[2] https://pip.pypa.io/en/stable/cli/pip_uninstall/

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
This commit is contained in:
Radostin Stoyanov 2023-06-18 14:20:04 +02:00 committed by Andrei Vagin
parent f5d06571c5
commit 376f3d1800
3 changed files with 33 additions and 4 deletions

View file

@ -1,2 +1,3 @@
[build-system]
requires = ["setuptools"]
# Minimum requirements for the build system to execute.
requires = ["setuptools", "wheel"] # PEP 508 specifications.

7
crit/requirements.txt Normal file
View file

@ -0,0 +1,7 @@
# We need pip version 20.1 or newer to correctly build with 'pycriu' symlink.
# - Building of local directories with pip 20.1 or newer is done in place,
# instead of a temporary location containing a copy of the directory tree.
# (https://github.com/pypa/pip/issues/7555)
pip>=20.1
setuptools>=42.0.0
wheel