Skip to content

Commit bd4ff5d

Browse files
committed
Play with github actions for python tests
1 parent bab9e41 commit bd4ff5d

File tree

4 files changed

+62
-6
lines changed

4 files changed

+62
-6
lines changed

.github/workflows/run_tests_ubuntu.yml

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
name: Run Ubuntu/Linux netCDF Tests
66

7-
on: [workflow_dispatch]
7+
on: [pull_request,workflow_dispatch]
88

99
env:
1010
REMOTETESTDOWN: ${{ vars.REMOTETESTDOWN }}
@@ -14,7 +14,27 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
jobs:
17-
17+
18+
build-python-tools:
19+
runs-on: ubuntu-22.04
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: actions/setup-python@v4
24+
with:
25+
python-version: '3.12'
26+
27+
- uses: astral-sh/setup-uv@v5
28+
29+
- name: Install Python tools
30+
run: |
31+
pwd
32+
ls -R
33+
uv sync --all-extras --dev
34+
35+
- name: Run python tool
36+
run: uv run testing-tools
37+
1838
build-deps-serial:
1939

2040
strategy:
@@ -243,7 +263,9 @@ jobs:
243263
## Serial, Static
244264
nc-ac-tests-oneoff-serial-static:
245265

246-
needs: build-deps-serial
266+
needs:
267+
- build-deps-serial
268+
- build-python-tools
247269

248270
strategy:
249271
matrix:
@@ -314,7 +336,7 @@ jobs:
314336
shell: bash -l {0}
315337
run: CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} make check TESTS="" -j
316338
if: ${{ success() }}
317-
339+
318340
- name: Run Tests
319341
shell: bash -l {0}
320342
run: |
@@ -332,7 +354,10 @@ jobs:
332354
##
333355
nc-ac-tests-oneoff-parallel:
334356

335-
needs: build-deps-parallel
357+
needs:
358+
- build-deps-parallel
359+
- build-python-tools
360+
336361
runs-on: ubuntu-22.04
337362

338363
strategy:
@@ -488,7 +513,7 @@ jobs:
488513
if: ${{ failure() }}
489514

490515
##
491-
# Serial, Shared
516+
# Serial, Static
492517
##
493518
nc-cmake-tests-oneoff-serial-static:
494519

pyproject.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
requires = ["setuptools", "wheel"]
2+
build-backend = "setuptools.build_meta"
3+
4+
[project]
5+
name = "zarr-python-testing-tools"
6+
version = "0.1.0"
7+
description = "Script to create Zarr datasets using zarr-python"
8+
authors = [{name = "Your Name", email = "[email protected]"}]
9+
license = {text = "MIT"}
10+
dependencies = [
11+
"zarr<3",
12+
"xarray",
13+
]
14+
15+
[tool.setuptools]
16+
packages = ["pythontools"]
17+
18+
[project.scripts]
19+
testing-tools = "pythontools.main:run"

pythontools/__init__.py

Whitespace-only changes.

pythontools/main.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#! /usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
"""
4+
Script to create Zarr datasets using zarr-python"
5+
"""
6+
import zarr, xarray as xr
7+
8+
def run ():
9+
print(f"Testing zarr-python compatibility using: zarr={zarr.__version__}")
10+
11+
if __name__ == "__main__":
12+
run()

0 commit comments

Comments
 (0)