Skip to content

Commit

Permalink
Add tests on Ubuntu 24.04.
Browse files Browse the repository at this point in the history
Also build tarball on Ubuntu 24.04 which has Cython 3.0.8.
  • Loading branch information
tdb committed Jun 3, 2024
1 parent a24dcc3 commit e52337c
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 78 deletions.
124 changes: 54 additions & 70 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# Copyright (C) 2019-2023 Tim Bishop

variables:
PYSG_VERSION: $CI_COMMIT_SHORT_SHA
# https://peps.python.org/pep-0440/ doesn't allow the hash a version number
#PYSG_VERSION: $CI_COMMIT_SHORT_SHA
PYSG_VERSION: 0

stages:
- build
Expand All @@ -20,7 +22,7 @@ include:

pystatgrab-distfile:
stage: build
image: ubuntu:22.04
image: ubuntu:24.04
script:
- apt-get update
- DEBIAN_FRONTEND=noninteractive apt-get -y install python3-dev pkg-config libstatgrab-dev cython3 python3-setuptools
Expand Down Expand Up @@ -100,6 +102,23 @@ libstatgrab-ubuntu2204:
- libstatgrab-ubuntu2204
expire_in: 1 week

libstatgrab-ubuntu2404:
stage: build
image: ubuntu:24.04
script:
- apt-get update
- DEBIAN_FRONTEND=noninteractive apt-get -y install autoconf automake libtool pkg-config git build-essential
- git clone https://github.com/libstatgrab/libstatgrab.git libstatgrab-master
- cd libstatgrab-master
- ./autogen.sh
- ./configure --prefix=`cd .. && pwd`/libstatgrab-ubuntu2404 --disable-man
- make
- make install
artifacts:
paths:
- libstatgrab-ubuntu2404
expire_in: 1 week

libstatgrab-centos7:
stage: build
image: centos:7
Expand Down Expand Up @@ -413,6 +432,39 @@ ubuntu2204-python3-libstatgrab-devel-setuptools:
- PYSTATGRAB_VERSION=$PYSG_VERSION PKG_CONFIG_PATH=../libstatgrab-ubuntu2204/lib/pkgconfig python3 setup.py install
- LD_LIBRARY_PATH=../libstatgrab-ubuntu2204/lib python3 -m unittest discover -v

# No Python 2 on Ubuntu 24.04

# No distutils in Python 3.12 on Ubuntu 24.04

ubuntu2404-python3-libstatgrab-distrib-setuptools:
stage: test
image: ubuntu:24.04
dependencies:
- pystatgrab-distfile
script:
- apt-get update
- DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential python3-dev pkg-config python3-setuptools libstatgrab-dev
- tar -zxvf dist/pystatgrab-$PYSG_VERSION.tar.gz
- cd pystatgrab-$PYSG_VERSION
- PYSTATGRAB_VERSION=$PYSG_VERSION python3 setup.py build
- PYSTATGRAB_VERSION=$PYSG_VERSION python3 setup.py install
- python3 -m unittest discover -v

ubuntu2404-python3-libstatgrab-devel-setuptools:
stage: test
image: ubuntu:24.04
dependencies:
- pystatgrab-distfile
- libstatgrab-ubuntu2404
script:
- apt-get update
- DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential python3-dev pkg-config python3-setuptools
- tar -zxvf dist/pystatgrab-$PYSG_VERSION.tar.gz
- cd pystatgrab-$PYSG_VERSION
- PYSTATGRAB_VERSION=$PYSG_VERSION PKG_CONFIG_PATH=../libstatgrab-ubuntu2404/lib/pkgconfig python3 setup.py build
- PYSTATGRAB_VERSION=$PYSG_VERSION PKG_CONFIG_PATH=../libstatgrab-ubuntu2404/lib/pkgconfig python3 setup.py install
- LD_LIBRARY_PATH=../libstatgrab-ubuntu2404/lib python3 -m unittest discover -v

centos7-python2-libstatgrab-distrib:
stage: test
image: centos:7
Expand Down Expand Up @@ -471,19 +523,6 @@ centos7-python3-libstatgrab-devel:
- LD_LIBRARY_PATH=../libstatgrab-centos7/lib python3 -m unittest discover -v

# No libstatgrab-devel in Rocky 8
#rocky8-python2-libstatgrab-distrib:
# stage: test
# image: rockylinux:8
# dependencies:
# - pystatgrab-distfile
# script:
# - dnf -y install epel-release
# - dnf -y install gcc python2-devel pkgconfig libstatgrab-devel
# - tar -zxvf dist/pystatgrab-$PYSG_VERSION.tar.gz
# - cd pystatgrab-$PYSG_VERSION
# - PYSTATGRAB_VERSION=$PYSG_VERSION python2 setup.py build
# - PYSTATGRAB_VERSION=$PYSG_VERSION python2 setup.py install
# - python2 -m unittest discover -v

rocky8-python2-libstatgrab-devel:
stage: test
Expand All @@ -499,21 +538,6 @@ rocky8-python2-libstatgrab-devel:
- PYSTATGRAB_VERSION=$PYSG_VERSION PKG_CONFIG_PATH=../libstatgrab-rocky8/lib/pkgconfig python2 setup.py install
- LD_LIBRARY_PATH=../libstatgrab-rocky8/lib python2 -m unittest discover -v

# No libstatgrab-devel in Rocky 8
#rocky8-python3-libstatgrab-distrib:
# stage: test
# image: rockylinux:8
# dependencies:
# - pystatgrab-distfile
# script:
# - dnf -y install epel-release
# - dnf -y install gcc python3-devel pkgconfig libstatgrab-devel
# - tar -zxvf dist/pystatgrab-$PYSG_VERSION.tar.gz
# - cd pystatgrab-$PYSG_VERSION
# - PYSTATGRAB_VERSION=$PYSG_VERSION python3 setup.py build
# - PYSTATGRAB_VERSION=$PYSG_VERSION python3 setup.py install
# - python3 -m unittest discover -v

rocky8-python3-libstatgrab-devel:
stage: test
image: rockylinux:8
Expand All @@ -529,48 +553,8 @@ rocky8-python3-libstatgrab-devel:
- LD_LIBRARY_PATH=../libstatgrab-rocky8/lib python3 -m unittest discover -v

# No Python 2 on Rocky 9
#rocky9-python2-libstatgrab-distrib:
# stage: test
# image: rockylinux:9
# dependencies:
# - pystatgrab-distfile
# script:
# - dnf -y install epel-release
# - dnf -y install gcc python2-devel pkgconfig libstatgrab-devel
# - tar -zxvf dist/pystatgrab-$PYSG_VERSION.tar.gz
# - cd pystatgrab-$PYSG_VERSION
# - PYSTATGRAB_VERSION=$PYSG_VERSION python2 setup.py build
# - PYSTATGRAB_VERSION=$PYSG_VERSION python2 setup.py install
# - python2 -m unittest discover -v
#
#rocky9-python2-libstatgrab-devel:
# stage: test
# image: rockylinux:9
# dependencies:
# - pystatgrab-distfile
# - libstatgrab-rocky9
# script:
# - yum -y install gcc python2-devel pkgconfig
# - tar -zxvf dist/pystatgrab-$PYSG_VERSION.tar.gz
# - cd pystatgrab-$PYSG_VERSION
# - PYSTATGRAB_VERSION=$PYSG_VERSION PKG_CONFIG_PATH=../libstatgrab-rocky9/lib/pkgconfig python2 setup.py build
# - PYSTATGRAB_VERSION=$PYSG_VERSION PKG_CONFIG_PATH=../libstatgrab-rocky9/lib/pkgconfig python2 setup.py install
# - LD_LIBRARY_PATH=../libstatgrab-rocky9/lib python2 -m unittest discover -v

# No libstatgrab-devel in Rocky 9
#rocky9-python3-libstatgrab-distrib:
# stage: test
# image: rockylinux:9
# dependencies:
# - pystatgrab-distfile
# script:
# - dnf -y install epel-release
# - dnf -y install gcc python3-devel pkgconfig libstatgrab-devel
# - tar -zxvf dist/pystatgrab-$PYSG_VERSION.tar.gz
# - cd pystatgrab-$PYSG_VERSION
# - PYSTATGRAB_VERSION=$PYSG_VERSION python3 setup.py build
# - PYSTATGRAB_VERSION=$PYSG_VERSION python3 setup.py install
# - python3 -m unittest discover -v

rocky9-python3-libstatgrab-devel:
stage: test
Expand Down
25 changes: 17 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,26 @@ def pkg_config(*args):

try:
import Cython.Distutils
from Cython.Build import cythonize
cmdclass = {"build_ext": Cython.Distutils.build_ext}
statgrab_src = ["statgrab.pyx"]
ext_modules = cythonize(
[Extension(
"statgrab",
["statgrab.pyx"],
extra_compile_args = cflags.decode("utf-8").split(),
extra_link_args = libs.decode("utf-8").split(),
)],
language_level="3str",
)
except ImportError:
# Cython is not installed; use the shipped copy of statgrab.c.
cmdclass = {}
statgrab_src = ["statgrab.c"]
ext_modules = [Extension(
"statgrab",
["statgrab.c"],
extra_compile_args = cflags.decode("utf-8").split(),
extra_link_args = libs.decode("utf-8").split()
)]

# setup information
setup(name = "pystatgrab",
Expand All @@ -90,10 +104,5 @@ def pkg_config(*args):
"Topic :: System :: Monitoring",
],
cmdclass = cmdclass,
ext_modules = [Extension(
"statgrab",
statgrab_src,
extra_compile_args = cflags.decode('utf-8').split(),
extra_link_args = libs.decode('utf-8').split(),
)],
ext_modules = ext_modules,
)

0 comments on commit e52337c

Please # to comment.