1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-12-07 04:23:47 +03:00

gitlab: stop using a venv when creating source/binary dist

The change to use 'python -m build' in

  commit 333c8bef2b
  Author: Erik Skultety <eskultet@redhat.com>
  Date:   Tue Jun 20 12:19:40 2023 +0200

    ci: Drop direct 'setup.py' usage

resulted in the CI jobs all downloading latest setuptools and
deps from pypi and running builds with them in a venv. IOW we
ceased testing against the setuptools/wheel packages provided
by the distro, which is the whole point of the CI.

Passing the '-n -x' flags to 'python -m build' tells it to stop
using a venv and not to check dependancies, thus letting it
use what we pre-installed in the container.

This doesn't work on CentOS Stream 8, however, so we revert to
using the old setup.py approach. This is a short term issue,
since Stream 8 is EOL at the end of May, so we'll be deleting
all the Stream 8 jobs across libvirt CI very soon.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé
2024-04-25 10:23:10 +01:00
parent e2a8524bc8
commit c647a8ba2a
3 changed files with 22 additions and 3 deletions

View File

@@ -27,7 +27,7 @@ stages:
- meson build -Ddriver_libvirtd=disabled "--prefix=$VROOT" "--libdir=$LIBDIR"
- ninja -C build install
- popd
- $PYTHON -m build
- $PYTHON -m build -n -x
- $PYTHON -m venv test-venv --system-site-packages --symlinks
- test-venv/bin/python -m pip install dist/libvirt_python*.whl
- test-venv/bin/python -m pytest tests
@@ -44,7 +44,25 @@ stages:
script:
- export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
- export CFLAGS="-Werror"
- $PYTHON -m build
- $PYTHON -m build -n -x
- $PYTHON -m venv test-venv --system-site-packages --symlinks
- test-venv/bin/python -m pip install dist/libvirt_python*.whl
- test-venv/bin/python -m pytest tests
- if test -x /usr/bin/rpmbuild && test "$RPM" != "skip" ;
then
unset CFLAGS ;
rpmbuild --clean --nodeps --define "_topdir $PWD/rpmbuild" -ta dist/libvirt-python*tar.gz ;
mv rpmbuild/RPMS/x86_64/ libvirt-python-rpms ;
fi
.native_setuppy_build_job:
extends:
- .gitlab_native_build_job
script:
- export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
- export CFLAGS="-Werror"
- $PYTHON setup.py bdist_wheel
- $PYTHON setup.py sdist
- $PYTHON -m venv test-venv --system-site-packages --symlinks
- test-venv/bin/python -m pip install dist/libvirt_python*.whl
- test-venv/bin/python -m pytest tests

View File

@@ -8,7 +8,7 @@
# Native build jobs
x86_64-centos-stream-8:
extends: .native_build_job
extends: .native_setuppy_build_job
needs:
- job: x86_64-centos-stream-8-container
optional: true

View File

@@ -11,6 +11,7 @@ targets:
centos-stream-8:
jobs:
- arch: x86_64
template: .native_setuppy_build_job
artifacts:
expire_in: 1 hour
paths: