Skip to content

Commit ee12f7f

Browse files
author
Martin Belanger
committed
Fixing GitHub workflows
Signed-off-by: Martin Belanger <[email protected]>
1 parent 65f525b commit ee12f7f

4 files changed

Lines changed: 84 additions & 23 deletions

File tree

.github/workflows/meson-test.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
meson-build:
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-24.04
1414
steps:
1515
- name: "CHECKOUT: nvme-stas"
1616
uses: actions/checkout@v4
@@ -22,22 +22,19 @@ jobs:
2222
2323
- name: "INSTALL: python packages"
2424
run: |
25-
sudo apt update
2625
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
2726
2827
- name: "INSTALL: documentation packages"
2928
run: |
30-
sudo apt update
3129
sudo apt-get install --yes --quiet docbook-xml docbook-xsl xsltproc
3230
3331
- name: "INSTALL: remaining debian packages"
3432
run: |
35-
sudo apt update
3633
sudo apt-get install --yes --quiet iproute2 libglib2.0-dev libgirepository1.0-dev libsystemd-dev
3734
3835
- name: "INSTALL: pip packages"
3936
run: |
40-
sudo pip install vermin --break-system-packages
37+
pip install vermin
4138
4239
- name: "INSTALL: libnvme packages (needed to build libnvme)"
4340
run: |

.github/workflows/pylint.yml

Lines changed: 74 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,27 @@ jobs:
2020
recursive: true
2121
ignore: DL3041
2222

23-
python-lint:
23+
python-black:
24+
if: ${{ !github.event.act }} # skip during local actions testing
25+
name: python-black formatter
2426
runs-on: ubuntu-latest
27+
steps:
28+
- name: "CHECKOUT: nvme-stas"
29+
uses: actions/checkout@v4
30+
31+
- name: "BLACK"
32+
33+
with:
34+
options: "--check --diff --color --line-length 120 --skip-string-normalization --extend-exclude (subprojects|debian|.build)"
35+
src: "."
36+
37+
python-lint-Jammy:
38+
runs-on: ubuntu-22.04
2539

2640
strategy:
2741
fail-fast: false
2842
matrix:
29-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
43+
python-version: ["3.9", "3.10"]
3044

3145
steps:
3246
- name: "CHECKOUT: nvme-stas"
@@ -41,11 +55,12 @@ jobs:
4155
run: |
4256
sudo apt update
4357
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
58+
sudo apt-get install --yes --quiet python3-wheel python3-systemd python3-pyudev python3-dasbus python3-gi python3-lxml pyflakes3 python3-tomli
4559
4660
- name: "INSTALL: pip packages"
4761
run: |
48-
sudo pip install PyGObject --break-system-packages
62+
pip install pylint --upgrade
63+
pip install PyGObject --upgrade
4964
5065
- name: "BUILD: [libnvme, nvme-stas]"
5166
uses: BSFishy/[email protected]
@@ -64,27 +79,69 @@ jobs:
6479
python3 -VV
6580
python3 -m site
6681
pylint --version
67-
echo "pyflakes $(python3 -m pyflakes --version)"
82+
echo "pyflakes3 $(pyflakes3 --version)"
6883
69-
- name: Pylint
70-
run: |
71-
pylint -j 0 --rcfile=test/pylint.rc .build/stacctl .build/stacd .build/stafctl .build/stafd .build/stasadm .build/staslib
84+
#- name: Pylint
85+
# run: |
86+
# pylint --rcfile=test/pylint.rc .build/stacctl .build/stacd .build/stafctl .build/stafd .build/stasadm .build/staslib
7287

7388
- name: Pyflakes
7489
if: always()
7590
run: |
76-
python3 -m pyflakes .build/stacctl .build/stacd .build/stafctl .build/stafd .build/stasadm .build/staslib
91+
pyflakes3 .build/stacctl .build/stacd .build/stafctl .build/stafd .build/stasadm .build/staslib
92+
93+
python-lint-Noble:
94+
runs-on: ubuntu-24.04
95+
96+
strategy:
97+
fail-fast: false
98+
matrix:
99+
python-version: ["3.11", "3.12", "3.13"]
77100

78-
python-black:
79-
if: ${{ !github.event.act }} # skip during local actions testing
80-
name: python-black formatter
81-
runs-on: ubuntu-latest
82101
steps:
83102
- name: "CHECKOUT: nvme-stas"
84103
uses: actions/checkout@v4
85104

86-
- name: "BLACK"
87-
uses: psf/[email protected].0
105+
- name: Set up Python ${{ matrix.python-version }}
106+
uses: actions/[email protected].0
88107
with:
89-
options: "--check --diff --color --line-length 120 --skip-string-normalization --extend-exclude (subprojects|debian|.build)"
90-
src: "."
108+
python-version: ${{ matrix.python-version }}
109+
110+
- name: "INSTALL: apt-get packages"
111+
run: |
112+
sudo apt update
113+
sudo apt-get install --yes --quiet meson ninja-build cmake libgirepository1.0-dev libsystemd-dev swig libjson-c-dev
114+
sudo apt-get install --yes --quiet python3-wheel python3-systemd python3-pyudev python3-dasbus python3-gi python3-lxml pylint pyflakes3 python3-tomli
115+
116+
#- name: "INSTALL: pip packages"
117+
# run: |
118+
# pip install pylint
119+
# pip install PyGObject
120+
121+
- name: "BUILD: [libnvme, nvme-stas]"
122+
uses: BSFishy/[email protected]
123+
with:
124+
action: build
125+
directory: .build
126+
setup-options: --buildtype=release --sysconfdir=/etc --prefix=/usr -Dlibnvme:buildtype=release -Dlibnvme:sysconfdir=/etc -Dlibnvme:prefix=/usr -Dlibnvme:python=enabled -Dlibnvme:libdbus=disabled -Dlibnvme:openssl=disabled -Dlibnvme:json-c=disabled -Dlibnvme:keyutils=disabled
127+
128+
- name: Set PYTHONPATH
129+
run: |
130+
echo "PYTHONPATH=.build:.build/subprojects/libnvme:/usr/lib/python3/dist-packages" >> $GITHUB_ENV
131+
132+
- name: Show test environment
133+
run: |
134+
echo -e "Build Directory:\n$(ls -laF .build)"
135+
python3 -VV
136+
python3 -m site
137+
pylint --version
138+
echo "pyflakes3 $(pyflakes3 --version)"
139+
140+
- name: Pylint
141+
run: |
142+
pylint --jobs=0 --rcfile=test/pylint.rc .build/stacctl .build/stacd .build/stafctl .build/stafd .build/stasadm .build/staslib
143+
144+
- name: Pyflakes
145+
if: always()
146+
run: |
147+
pyflakes3 .build/stacctl .build/stacd .build/stafctl .build/stafd .build/stasadm .build/staslib

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ endif
3838
purge:
3939
ifneq ("$(wildcard ${BUILD-DIR})","")
4040
rm -rf ${BUILD-DIR}
41+
meson subprojects purge --confirm
4142
endif
4243

4344
.PHONY: install

meson.build

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,13 @@ if want_man or want_html or want_readthedocs
3939
buildtime_modules += ['lxml']
4040
endif
4141

42-
python3 = import('python').find_installation('python3', modules:buildtime_modules)
42+
# On older systems we had to invoke Python 3 as "python3". On newer systems,
43+
# Python 2 has been completely deprecated and Python 3 is simply named "python".
44+
pymod = import('python')
45+
python3 = pymod.find_installation('python3', modules:buildtime_modules, required:false)
46+
if not python3.found()
47+
python3 = pymod.find_installation('python', modules:buildtime_modules)
48+
endif
4349
python_version = python3.language_version()
4450
python_version_req = '>=3.6'
4551
if not python_version.version_compare(python_version_req)

0 commit comments

Comments
 (0)