Skip to content

Commit

Permalink
CI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jsouter committed Sep 11, 2024
1 parent 4822ac8 commit 4b76b8d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Upload Sdist
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}-${{ matrix.python }}
name: dist
path: dist/*

build:
Expand All @@ -56,6 +56,11 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
python: [cp37, cp38, cp39, cp310]

exclude:
# MacOS 14.4.1 for arm64 doesn't support Python < 3.8
- os: macos-latest
python: "cp37"

include:
# Put coverage and results files in the project directory for mac
- os: macos-latest
Expand All @@ -69,6 +74,9 @@ jobs:
- os: ubuntu-latest
cov_file: /output/coverage.xml
results_file: /output/pytest-results.xml
# MacOS 13 required for Python < 3.8
- os: macos-13
python: "cp37"

name: build/${{ matrix.os }}/${{ matrix.python }}
runs-on: ${{ matrix.os }}
Expand All @@ -84,7 +92,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.7"
python-version: "3.12"

- name: Install Python Dependencies
# Pin cibuildwheel due to https://github.com/pypa/cibuildwheel/issues/962
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ jobs:

steps:
- name: Checkout Source
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
# require history to get back to last tag for version number of branches
fetch-depth: 0
submodules: true

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.7"
python-version: "3.12"

- name: Install Python Dependencies
run: |
Expand Down
9 changes: 6 additions & 3 deletions tests/test_autosave.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from conftest import get_multiprocessing_context, select_and_recv
from softioc import autosave, builder, softioc, device_core
from softioc import autosave, builder, softioc, device_core, asyncio_dispatcher
from unittest.mock import patch
import pytest
import threading
Expand Down Expand Up @@ -356,7 +356,8 @@ def check_all_record_types_save_properly(device_name, autosave_dir, conn):
builder.WaveformIn("WaveformIn", [1, 2, 3, 4], autosave=True)
builder.WaveformOut("WaveformOut", [1, 2, 3, 4], autosave=True)
builder.LoadDatabase()
softioc.iocInit()
dispatcher = asyncio_dispatcher.AsyncioDispatcher()
softioc.iocInit(dispatcher)
# wait long enough to ensure one save has occurred
time.sleep(2)
with open(autosave_dir / f"{device_name}.softsav", "r") as f:
Expand Down Expand Up @@ -403,7 +404,8 @@ def check_autosave_field_names_contain_device_prefix(
builder.SetDeviceName(device_name)
builder.aOut("AFTER", autosave=["VAL", "EGU"])
builder.LoadDatabase()
softioc.iocInit()
dispatcher = asyncio_dispatcher.AsyncioDispatcher()
softioc.iocInit(dispatcher)
time.sleep(2)
with open(tmp_path / f"{device_name}.softsav", "r") as f:
saved = yaml.full_load(f)
Expand All @@ -427,6 +429,7 @@ def test_autosave_field_names_contain_device_prefix(tmp_path):
def test_context_manager_thread_safety(tmp_path):
autosave.configure(tmp_path, DEVICE_NAME)
in_cm_event = threading.Event()

def create_pv_in_thread(name):
in_cm_event.wait()
builder.aOut(name, autosave=False)
Expand Down

0 comments on commit 4b76b8d

Please sign in to comment.