Skip to content

Commit

Permalink
Merge pull request #177 from rosswhitfield/python_3.11
Browse files Browse the repository at this point in the history
Add Python 3.11 to CI
  • Loading branch information
rosswhitfield authored Oct 26, 2022
2 parents 40e9e79 + 2554615 commit a51c97a
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/conda_env/environment_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:
- psutil
- mpi4py
- openmpi
- dask=2022.9.2
- dask=2022.10.0
- dakota
- coverage!=6.3
- flask=2.2.2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:
- pylint=2.15.3
- bandit=1.7.4
- codespell=2.2.1
- dask=2022.9.2
- dask=2022.10.0
- pytest
- flask=2.2.2
- configobj
3 changes: 3 additions & 0 deletions .github/workflows/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ jobs:
- os: ubuntu-latest
python-version: "3.10"
conda_env: 'linux'
- os: ubuntu-latest
python-version: "3.11"
conda_env: 'minimal'
- os: macos-latest
python-version: 3.9
conda_env: 'macos'
Expand Down
5 changes: 3 additions & 2 deletions ipsframework/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -2124,13 +2124,14 @@ def submit_dask_tasks(self, block=True, dask_nodes=1, dask_ppn=None, use_shifter
dask_nodes = 1

nthreads = dask_ppn if dask_ppn else services.get_config_param("PROCS_PER_NODE")
nworkers = "--nworkers" if self.distributed.__version__ >= "2022.10" else "--nprocs"
if use_shifter:
self.dask_workers_tid = services.launch_task(dask_nodes, os.getcwd(),
self.shifter,
"dask-worker",
"--scheduler-file",
self.dask_file_name,
"--nprocs", 1,
nworkers, 1,
"--nthreads", nthreads,
"--no-dashboard",
task_ppn=1)
Expand All @@ -2139,7 +2140,7 @@ def submit_dask_tasks(self, block=True, dask_nodes=1, dask_ppn=None, use_shifter
self.dask_worker,
"--scheduler-file",
self.dask_file_name,
"--nprocs", 1,
nworkers, 1,
"--nthreads", nthreads,
"--no-dashboard",
task_ppn=1)
Expand Down
16 changes: 11 additions & 5 deletions tests/new/test_bad_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,13 @@ def test_assign_protected_attribute(tmpdir):
with open(str(tmpdir.join('sim.log')), 'r') as f:
lines = f.readlines()

# python 3.10 includes the attribute name in the error message
assert "AttributeError: can't set attribute\n" in lines or "AttributeError: can't set attribute 'args'\n" in lines
assert "Exception: can't set attribute\n" in lines or "Exception: can't set attribute 'args'\n" in lines
# python 3.10 and 3.11 have different AttributeError messages
assert ("AttributeError: can't set attribute\n" in lines or
"AttributeError: can't set attribute 'args'\n" in lines or
"AttributeError: property 'args' of 'assign_protected_attribute' object has no setter\n" in lines)
assert ("Exception: can't set attribute\n" in lines or
"Exception: can't set attribute 'args'\n" in lines or
"Exception: property 'args' of 'assign_protected_attribute' object has no setter\n" in lines)

# remove timestamp
lines = [line[24:] for line in lines]
Expand All @@ -238,9 +242,11 @@ def test_assign_protected_attribute(tmpdir):
assert worker_call_end_event["code"] == "DRIVER__driver"
assert worker_call_end_event["eventtype"] == "IPS_CALL_END"
assert not worker_call_end_event['ok']
# python 3.10 includes the attribute name in the error message
# python 3.10 and 3.11 have different error messages
assert worker_call_end_event["comment"] in ("Error: \"can't set attribute\" Target = test@assign_protected_attribute@2:step(0)",
"Error: \"can't set attribute 'args'\" Target = test@assign_protected_attribute@2:step(0)")
"Error: \"can't set attribute 'args'\" Target = test@assign_protected_attribute@2:step(0)",
"Error: \"property 'args' of 'assign_protected_attribute' object has no setter\" "
"Target = test@assign_protected_attribute@2:step(0)")

sim_end_event = events[10]
assert sim_end_event["code"] == "Framework"
Expand Down
2 changes: 1 addition & 1 deletion tests/new/test_dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def test_dask_fake_shifter(tmpdir, monkeypatch):
assert lines[0].startswith('Running dask-scheduler --no-dashboard --scheduler-file')
assert lines[0].endswith('--port 0 in shifter\n')
assert lines[1].startswith('Running dask-worker --scheduler-file')
assert lines[1].endswith('--nprocs 1 --nthreads 0 --no-dashboard in shifter\n')
assert lines[1].endswith('1 --nthreads 0 --no-dashboard in shifter\n')


def test_dask_timeout(tmpdir):
Expand Down

0 comments on commit a51c97a

Please sign in to comment.