mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-12-09 12:23:48 +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:
@@ -27,7 +27,7 @@ stages:
|
|||||||
- meson build -Ddriver_libvirtd=disabled "--prefix=$VROOT" "--libdir=$LIBDIR"
|
- meson build -Ddriver_libvirtd=disabled "--prefix=$VROOT" "--libdir=$LIBDIR"
|
||||||
- ninja -C build install
|
- ninja -C build install
|
||||||
- popd
|
- popd
|
||||||
- $PYTHON -m build
|
- $PYTHON -m build -n -x
|
||||||
- $PYTHON -m venv test-venv --system-site-packages --symlinks
|
- $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 pip install dist/libvirt_python*.whl
|
||||||
- test-venv/bin/python -m pytest tests
|
- test-venv/bin/python -m pytest tests
|
||||||
@@ -44,7 +44,25 @@ stages:
|
|||||||
script:
|
script:
|
||||||
- export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
|
- export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
|
||||||
- export CFLAGS="-Werror"
|
- 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
|
- $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 pip install dist/libvirt_python*.whl
|
||||||
- test-venv/bin/python -m pytest tests
|
- test-venv/bin/python -m pytest tests
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
# Native build jobs
|
# Native build jobs
|
||||||
|
|
||||||
x86_64-centos-stream-8:
|
x86_64-centos-stream-8:
|
||||||
extends: .native_build_job
|
extends: .native_setuppy_build_job
|
||||||
needs:
|
needs:
|
||||||
- job: x86_64-centos-stream-8-container
|
- job: x86_64-centos-stream-8-container
|
||||||
optional: true
|
optional: true
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ targets:
|
|||||||
centos-stream-8:
|
centos-stream-8:
|
||||||
jobs:
|
jobs:
|
||||||
- arch: x86_64
|
- arch: x86_64
|
||||||
|
template: .native_setuppy_build_job
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1 hour
|
expire_in: 1 hour
|
||||||
paths:
|
paths:
|
||||||
|
|||||||
Reference in New Issue
Block a user