Skip to content

Commit

Permalink
Upgrade Python version and minor fixes (#75)
Browse files Browse the repository at this point in the history
* Upgrade supported Python versions (drop 3.10, include 3.12, 3.13)

* Host of small fixes to let tests pass on a new clone and MacOS
  • Loading branch information
chrisvanrun authored Jan 6, 2025
1 parent 56b947f commit 3d02250
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- published

env:
MINIMUM_PYTHON_VERSION: '3.10'
MINIMUM_PYTHON_VERSION: '3.11'

jobs:
precommit:
Expand All @@ -32,7 +32,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion grand_challenge_forge/generation_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def copy_and_render(
# Create directories in the output path
current_output_dir.mkdir(parents=True, exist_ok=True)

for file in files:
for file in sorted(files):
source_file = root / file
output_file = current_output_dir / file

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ cleanup() {
# Ensure permissions are set correctly on the output
# This allows the host user (e.g. you) to access and handle these files
docker run --rm \
--platform=linux/amd64 \
--quiet \
--volume "$OUTPUT_DIR":/output \
--entrypoint /bin/sh \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% include 'sym_template.j2' %}

This file was deleted.

10 changes: 6 additions & 4 deletions tests/test_evaluate_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ def forever_process(*_):
time.sleep(1)


def stop_children(process, interval):
def stop_children(process_pid, interval):
stopped = False
while not stopped:
process = psutil.Process(process.pid)
process = psutil.Process(process_pid)
children = process.children(recursive=True)
if children:
for child in children:
Expand Down Expand Up @@ -110,7 +110,9 @@ def test_prediction_processing_catching_killing_of_child_processes():
def add_child_terminator(*args, **kwargs):
process = _start_pool_worker(*args, **kwargs)
nonlocal child_stopper
child_stopper = Process(target=partial(stop_children, process, 0.5))
child_stopper = Process(
target=partial(stop_children, process.pid, 0.5)
)
child_stopper.start() # Hasta la vista, baby
return process

Expand All @@ -121,5 +123,5 @@ def add_child_terminator(*args, **kwargs):
fn=forever_process, predictions=predictions
)
finally:
if child_stopper:
if child_stopper and child_stopper.is_alive():
child_stopper.terminate()

0 comments on commit 3d02250

Please sign in to comment.