Skip to content

Commit ecfbf2d

Browse files
author
Martin Belanger
committed
Build: Fix Github actions
The environment used to run GitHub actions has been updated upstream, which breaks the build. This is mainly due to the use of pip. That is, the use of upstream pip and not the one provided by Debian through apt-get install python3-pip. This updates all the build scripts to use the standard Debian packages (if available) and not rely on "pip install". Signed-off-by: Martin Belanger <[email protected]>
1 parent 944929e commit ecfbf2d

8 files changed

Lines changed: 39 additions & 29 deletions

File tree

.github/workflows/meson-test.yml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,31 @@ jobs:
1515
- name: "CHECKOUT: nvme-stas"
1616
uses: actions/checkout@v4
1717

18-
- name: "INSTALL: Overall dependencies"
18+
- name: "INSTALL: build packages"
1919
run: |
2020
sudo apt update
21-
sudo apt-get install --yes --quiet python3-pip cmake iproute2
22-
sudo python3 -m pip install --upgrade pip
23-
sudo python3 -m pip install --upgrade wheel meson ninja
21+
sudo apt-get install --yes --quiet meson ninja-build cmake
2422
25-
- name: "INSTALL: nvme-stas dependencies"
23+
- name: "INSTALL: python packages"
2624
run: |
27-
sudo apt-get install --yes --quiet docbook-xml docbook-xsl xsltproc libglib2.0-dev libgirepository1.0-dev libsystemd-dev
28-
sudo apt-get install --yes --quiet python3-systemd python3-pyudev python3-lxml
29-
python3 -m pip install --upgrade dasbus pylint pyflakes PyGObject
30-
python3 -m pip install --upgrade vermin pyfakefs importlib-resources
25+
sudo apt update
26+
sudo apt-get install --yes --quiet python3-pip python3-wheel pylint pyflakes3 python3-systemd python3-pyudev python3-lxml python3-dasbus python3-gi python3-importlib-resources python3-pyfakefs
27+
28+
- name: "INSTALL: documentation packages"
29+
run: |
30+
sudo apt update
31+
sudo apt-get install --yes --quiet docbook-xml docbook-xsl xsltproc
32+
33+
- name: "INSTALL: remaining debian packages"
34+
run: |
35+
sudo apt update
36+
sudo apt-get install --yes --quiet iproute2 libglib2.0-dev libgirepository1.0-dev libsystemd-dev
37+
38+
- name: "INSTALL: pip packages"
39+
run: |
40+
sudo pip install vermin --break-system-packages
3141
32-
- name: "INSTALL: libnvme dependencies"
42+
- name: "INSTALL: libnvme packages (needed to build libnvme)"
3343
run: |
3444
sudo apt-get install --yes --quiet swig libjson-c-dev
3545
@@ -54,8 +64,7 @@ jobs:
5464

5565
- name: "Generate coverage report"
5666
run: |
57-
python3 -m pip install --upgrade pytest
58-
python3 -m pip install --upgrade pytest-cov
67+
sudo apt-get install python3-pytest python3-pytest-cov
5968
echo $( pwd )
6069
cp -r .build/staslib/* ./staslib/.
6170
pytest --cov=./staslib --cov-report=xml test/test-*.py

.github/workflows/pylint.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
python-version: ["3.7", "3.8", "3.9", "3.10"]
29+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
3030

3131
steps:
3232
- name: "CHECKOUT: nvme-stas"
@@ -37,12 +37,15 @@ jobs:
3737
with:
3838
python-version: ${{ matrix.python-version }}
3939

40-
- name: "INSTALL: additional packages"
40+
- name: "INSTALL: apt-get packages"
4141
run: |
4242
sudo apt update
43-
sudo apt-get install --yes --quiet python3-pip cmake libgirepository1.0-dev libsystemd-dev python3-systemd swig libjson-c-dev || true
44-
sudo python3 -m pip install --upgrade pip wheel meson ninja
45-
python3 -m pip install --upgrade dasbus pylint pyflakes PyGObject lxml pyudev
43+
sudo apt-get install --yes --quiet meson ninja-build cmake libgirepository1.0-dev libsystemd-dev swig libjson-c-dev
44+
sudo apt-get install --yes --quiet python3-wheel python3-systemd python3-pyudev python3-dasbus python3-gi python3-lxml pylint pyflakes3 python3-pyflakes python3-tomli
45+
46+
- name: "INSTALL: pip packages"
47+
run: |
48+
sudo pip install PyGObject --break-system-packages
4649
4750
- name: "BUILD: [libnvme, nvme-stas]"
4851
uses: BSFishy/[email protected]
@@ -60,12 +63,12 @@ jobs:
6063
echo -e "Build Directory:\n$(ls -laF .build)"
6164
python3 -VV
6265
python3 -m site
63-
python3 -m pylint --version
66+
pylint --version
6467
echo "pyflakes $(python3 -m pyflakes --version)"
6568
6669
- name: Pylint
6770
run: |
68-
python3 -m pylint -j 0 --rcfile=test/pylint.rc .build/stacctl .build/stacd .build/stafctl .build/stafd .build/stasadm .build/staslib
71+
pylint -j 0 --rcfile=test/pylint.rc .build/stacctl .build/stacd .build/stafctl .build/stafd .build/stasadm .build/staslib
6972
7073
- name: Pyflakes
7174
if: always()

.readthedocs.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ build:
2020
- xsltproc
2121
- pandoc
2222
jobs:
23-
post_install:
24-
- pip3 install lxml
2523
pre_build:
2624
- meson .build -Dreadthedocs=true || cat .build/meson-logs/meson-log.txt
2725
- ninja -C .build

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ black:
7070
black --diff --color --line-length 120 --skip-string-normalization --extend-exclude="(subprojects|debian|.build)" .
7171

7272
# Coverage requirements:
73-
# pip install coverage
73+
# apt-get install python3-coverage
7474
.PHONY: coverage
7575
coverage: stas
7676
cd ${BUILD-DIR} && ./coverage.sh

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ The following packages must be installed to use **`stafd`**/**`stacd`**
9696
sudo apt-get install -y python3-pyudev python3-systemd python3-gi
9797
sudo apt-get install -y python3-dasbus # Ubuntu 22.04
9898
OR:
99-
sudo pip3 install dasbus # Ubuntu 20.04
99+
sudo pip install dasbus # Ubuntu 20.04 (may require --break-system-packages)
100100
```
101101

102102
**RPM packages (tested on Fedora 34..35 and SLES15):**

TESTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ $ sudo ./nvmet.py clean
184184
This requires the [Python coverage package](https://coverage.readthedocs.io/en/6.4.1/), which can be installed as follows:
185185

186186
```bash
187-
$ sudo pip install coverage
187+
$ sudo apt-get install python3-coverage
188188
```
189189

190190
Note that this test cannot be run while `stafd` and `stacd` are running. Make sure to stop `stafd` and `stacd` if they are running (`systemctl stop [stafd|stacd]`). You may also need to mask those services (`systemctl mask [stafd|stacd]`) if coverage fails to start.

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ endif
5151
missing_runtime_mods = false
5252
py_modules_reqd = [
5353
['libnvme', 'Install python3-libnvme (deb/rpm)'],
54-
['dasbus', 'Install python3-dasbus (deb/rpm) OR pip3 install dasbus'],
54+
['dasbus', 'Install python3-dasbus (deb/rpm) OR pip install dasbus'],
5555
['pyudev', 'Install python3-pyudev (deb/rpm)'],
5656
['systemd', 'Install python3-systemd (deb/rpm)'],
5757
['gi', 'Install python3-gi (deb) OR python3-gobject (rpm)'],

utils/nvmet/nvmet.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
'ports': [
77
{
88
'id': 1,
9-
'adrfam': 'ipv6',
10-
'traddr': '::',
11-
#'adrfam': 'ipv4',
12-
#'traddr': '0.0.0.0',
9+
#'adrfam': 'ipv6',
10+
#'traddr': '::',
11+
'adrfam': 'ipv4',
12+
'traddr': '0.0.0.0',
1313
'trsvcid': 8009,
1414
'trtype': 'tcp',
1515
}

0 commit comments

Comments
 (0)