Skip to content

Commit

Permalink
Update github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasah committed Jan 14, 2025
1 parent b8af585 commit 060c679
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 30 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout tag/branch"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"
with: { fetch-depth: 0, submodules: "true" }
- name: "Setup Python"
uses: "actions/setup-python@v3"
uses: "actions/setup-python@v5"
with:
python-version: "3.9"
python-version: "3.12"

- name: "Install build dependencies"
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
tool: [black, lint, typing]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: 3.12
- name: Install dependencies
run: pip install -U tox
- name: Run Tox
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout tag/branch"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"
- name: "Setup Python"
uses: "actions/setup-python@v3"
uses: "actions/setup-python@v5"
with:
python-version: "3.9"
python-version: "3.12"

- name: "Install build dependencies"
run: |
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ jobs:
strategy:
matrix:
include:
- name: py37
python: 3.7
tox: py37
- name: py38
python: 3.8
tox: py38
- name: py39
python: 3.9
coverage: true
Expand All @@ -30,6 +24,12 @@ jobs:
- name: py311
python: "3.11"
tox: py311
- name: py312
python: "3.12"
tox: py312
- name: py313
python: "3.13"
tox: py313

steps:
- uses: "actions/checkout@v2"
Expand Down
3 changes: 2 additions & 1 deletion docs/source/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,5 @@ func
enums
GSa
QHub
qhub
qhub
qualname
12 changes: 3 additions & 9 deletions src/zhinst/toolkit/driver/devices/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,9 @@ def _version_string_to_tuple(version: str) -> t.Tuple[int, int, int]:
Returns:
Version as a tuple of ints
"""
version_split = version.split(".")
result = [0] * max(3, len(version_split))
for i, value in enumerate(version_split):
try:
result[i] = int(value)
except ValueError:
if i < 3: # ignore dev versions
result[i] = 0
return result[0], result[1], result[2]
return tuple(
int(v) if v.isdigit() else 0 for v in version.split(".")[:3]
) # type: ignore

@staticmethod
def _check_python_versions(
Expand Down
2 changes: 1 addition & 1 deletion src/zhinst/toolkit/driver/modules/shfqa_sweeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def _create_nodetree(self) -> NodeTree:
for config_class, parent_name in self._config_classes.items():
for parameter, default_value in asdict(config_class()).items():
node = (
f"/{parent_name[0]}/{self._renamed_nodes.get(parameter,parameter)}"
f"/{parent_name[0]}/{self._renamed_nodes.get(parameter, parameter)}"
)
try:
info[node] = raw_info[node]
Expand Down
4 changes: 2 additions & 2 deletions src/zhinst/toolkit/waveform.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ def to_wave_str(i: int) -> str:
if marker is None:
return f"placeholder({wave_length}, false, false)"
return (
f"placeholder({wave_length}, {marker_to_bool(i*2)}, "
+ f"{marker_to_bool(i*2+1)})"
f"placeholder({wave_length}, {marker_to_bool(i * 2)}, "
+ f"{marker_to_bool(i * 2 + 1)})"
)

w1_assign = to_wave_str(0)
Expand Down
5 changes: 5 additions & 0 deletions tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ def test_version_string_to_tuple_old():
assert test_version == (25, 1, 2586)


def test_version_string_to_tuple_dev():
test_version = BaseInstrument._version_string_to_tuple("25.1.dev2586")
assert test_version == (25, 1, 0)


def test_version_string_to_tuple_invalid():
test_version = BaseInstrument._version_string_to_tuple("25.1.2586.4.8.d")
assert test_version == (25, 1, 2586)
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py37, py38, py39, py310, py311, lint, typing
envlist = py39, py310, py311, py312, py313, lint, typing
skip_missing_interpreters = true
skipsdist = true
# pyproject.toml: To use a PEP 517 build-backend you are required to configure tox to use an isolated_build
Expand All @@ -13,7 +13,7 @@ allowlist_externals =
flake8
scripts/zhinst_toolkit_symlink.py
deps =
py{37,38,39,310,311}: -rrequirements.txt
py{39,310,311,312,313}: -rrequirements.txt
pytest-cov
commands =
{envpython} -m pip install .
Expand Down

0 comments on commit 060c679

Please sign in to comment.