Skip to content

Commit

Permalink
Merge pull request #38 from jan-janssen/main
Browse files Browse the repository at this point in the history
Test Python 3.12
  • Loading branch information
jan-janssen authored Jan 19, 2024
2 parents 6f846e4 + d697417 commit 1f43994
Show file tree
Hide file tree
Showing 7 changed files with 195 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .azure-pipelines/azure-pipelines-linux.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions .ci_support/linux_64_mpimpichpython3.12.____cpython.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
c_compiler:
- gcc
c_compiler_version:
- '12'
cdt_name:
- cos6
channel_sources:
- conda-forge
channel_targets:
- conda-forge main
docker_image:
- quay.io/condaforge/linux-anvil-cos7-x86_64
libarchive:
- '3.7'
libuuid:
- '2'
lua:
- '5'
lz4_c:
- 1.9.3
mpi:
- mpich
mpich:
- '4'
ncurses:
- '6'
openmpi:
- '4'
pin_run_as_build:
python:
min_pin: x.x
max_pin: x.x
python:
- 3.12.* *_cpython
sqlite:
- '3'
target_platform:
- linux-64
zeromq:
- 4.3.5
40 changes: 40 additions & 0 deletions .ci_support/linux_64_mpiopenmpipython3.12.____cpython.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
c_compiler:
- gcc
c_compiler_version:
- '12'
cdt_name:
- cos6
channel_sources:
- conda-forge
channel_targets:
- conda-forge main
docker_image:
- quay.io/condaforge/linux-anvil-cos7-x86_64
libarchive:
- '3.7'
libuuid:
- '2'
lua:
- '5'
lz4_c:
- 1.9.3
mpi:
- openmpi
mpich:
- '4'
ncurses:
- '6'
openmpi:
- '4'
pin_run_as_build:
python:
min_pin: x.x
max_pin: x.x
python:
- 3.12.* *_cpython
sqlite:
- '3'
target_platform:
- linux-64
zeromq:
- 4.3.5
38 changes: 38 additions & 0 deletions .ci_support/migrations/python312.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
migrator_ts: 1695046563
__migrator:
migration_number: 1
operation: key_add
primary_key: python
ordering:
python:
- 3.6.* *_cpython
- 3.7.* *_cpython
- 3.8.* *_cpython
- 3.9.* *_cpython
- 3.10.* *_cpython
- 3.11.* *_cpython
- 3.12.* *_cpython # new entry
- 3.6.* *_73_pypy
- 3.7.* *_73_pypy
- 3.8.* *_73_pypy
- 3.9.* *_73_pypy
paused: false
longterm: True
pr_limit: 30
max_solver_attempts: 6 # this will make the bot retry "not solvable" stuff 6 times
exclude:
# this shouldn't attempt to modify the python feedstocks
- python
- pypy3.6
- pypy-meta
- cross-python
- python_abi
exclude_pinned_pkgs: false

python:
- 3.12.* *_cpython
# additional entries to add for zip_keys
numpy:
- 1.26
python_impl:
- cpython
14 changes: 14 additions & 0 deletions README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ source:
sha256: 3125ace7d4d3c99b362290344f97db74c06c37b5510cfcb746e1bf48e1dc1389
patches:
- centos6.patch # This patch can be removed once the conda-forge reference is updated
- python312.patch

build:
number: 0
number: 1
skip: true # [not linux]
run_exports:
- {{ pin_subpackage('flux-core', max_pin='x.x') }}
Expand Down
53 changes: 53 additions & 0 deletions recipe/python312.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
diff --git a/t/python/t0012-futures.py b/t/python/t0012-futures.py
index 4a5c187f7..fcc399b0e 100755
--- a/t/python/t0012-futures.py
+++ b/t/python/t0012-futures.py
@@ -32,10 +32,20 @@ class TestHandle(unittest.TestCase):
self.f = flux.Flux()
self.ping_payload = {"seq": 1, "pad": "stuff"}

+ @staticmethod
+ def is_subset(x, y):
+ """Return true if all keys in x are present and equal to keys in y"""
+ for key, val in x.items():
+ if key not in y:
+ raise ValueError(f"key {key} missing in {y}")
+ if y[key] != val:
+ raise ValueError(f"key {key} is not {val} (got {x[key]})")
+ return True
+
def test_01_rpc_get(self):
future = self.f.rpc("broker.ping", self.ping_payload)
resp_payload = future.get()
- self.assertDictContainsSubset(self.ping_payload, resp_payload)
+ self.assertTrue(self.is_subset(self.ping_payload, resp_payload))

def test_02_get_flux(self):
future = self.f.rpc("broker.ping", self.ping_payload)
@@ -43,7 +53,7 @@ class TestHandle(unittest.TestCase):
# force a full garbage collection pass to test that the handle is not destructed
gc.collect(2)
resp_payload = future.get()
- self.assertDictContainsSubset(self.ping_payload, resp_payload)
+ self.assertTrue(self.is_subset(self.ping_payload, resp_payload))

def test_02_future_wait_for(self):
future = self.f.rpc("broker.ping", self.ping_payload)
@@ -55,7 +65,7 @@ class TestHandle(unittest.TestCase):
self.fail(msg="future fulfillment timed out")
else:
raise
- self.assertDictContainsSubset(self.ping_payload, resp_payload)
+ self.assertTrue(self.is_subset(self.ping_payload, resp_payload))

def test_03_future_then(self):
"""Register a 'then' cb and run the reactor to ensure it runs"""
@@ -67,7 +77,7 @@ class TestHandle(unittest.TestCase):
try:
resp_payload = future.get()
cb_ran[0] = True
- self.assertDictContainsSubset(arg, resp_payload)
+ self.assertTrue(self.is_subset(arg, resp_payload))
finally:
# ensure that reactor is always stopped, avoiding a hung test
flux_handle.reactor_stop(reactor)

0 comments on commit 1f43994

Please sign in to comment.