Repository: tskit-dev/msprime (language: python)

Issue:
Python 3.11 wheels
It would be great to have wheels for Python 3.11


Discussion / hints:
Yes, I need to get the whole tskit ecosystem on 3.11, especially now numba is released.

Fix patch:
diff --git a/.github/workflows/docker/shared.env b/.github/workflows/docker/shared.env
index 8e088f14d..0b031b88d 100644
--- a/.github/workflows/docker/shared.env
+++ b/.github/workflows/docker/shared.env
@@ -3,5 +3,6 @@ PYTHON_VERSIONS=(
     cp38-cp38
     cp37-cp37m
     cp310-cp310
+    cp311-cp311
 )
 GSL_VERSION=2.6
diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml
index d46883876..7b203f530 100644
--- a/.github/workflows/wheels.yml
+++ b/.github/workflows/wheels.yml
@@ -15,7 +15,7 @@ jobs:
     runs-on: macos-latest
     strategy:
       matrix:
-        python: [3.7, 3.8, 3.9, "3.10"]
+        python: [3.7, 3.8, 3.9, "3.10", 3.11]
     steps:
       - name: Checkout
         uses: actions/checkout@v2
@@ -66,7 +66,7 @@ jobs:
       - name: Build wheels in docker
         shell: bash
         run: |
-          docker run --rm -v `pwd`:/project -w /project quay.io/pypa/manylinux2010_x86_64 bash .github/workflows/docker/buildwheel.sh
+          docker run --rm -v `pwd`:/project -w /project quay.io/pypa/manylinux2014_x86_64 bash .github/workflows/docker/buildwheel.sh
 
       - name: Upload Wheels
         uses: actions/upload-artifact@v2
@@ -79,7 +79,7 @@ jobs:
     runs-on: macos-latest
     strategy:
       matrix:
-        python: [3.7, 3.8, 3.9, "3.10"]
+        python: [3.7, 3.8, 3.9, "3.10", 3.11]
     steps:
       - name: Download wheels
         uses: actions/download-artifact@v2
@@ -93,8 +93,7 @@ jobs:
         run: |
           python -VV
           # Install the local wheel
-          pip install msprime
-          pip uninstall --yes msprime
+          pip install numpy newick>=1.3.0 tskit>=0.5.2 demes>=0.2
           pip install msprime --no-index --only-binary msprime -f .
           python -c "import msprime"
           msp simulate 10 tmp.trees
@@ -106,7 +105,7 @@ jobs:
     needs: ['manylinux']
     strategy:
       matrix:
-        python: [3.7, 3.8, 3.9, "3.10"]
+        python: [3.7, 3.8, 3.9, "3.10", 3.11]
     steps:
       - name: Download wheels
         uses: actions/download-artifact@v2
diff --git a/.mergify.yml b/.mergify.yml
index 18d82cfa6..b02ef2778 100644
--- a/.mergify.yml
+++ b/.mergify.yml
@@ -5,11 +5,11 @@ queue_rules:
       - status-success=Docs
       - status-success=Lint
       - status-success=Python (3.7, macos-latest)
-      - status-success=Python (3.10, macos-latest)
+      - status-success=Python (3.11, macos-latest)
       - status-success=Python (3.7, ubuntu-latest)
-      - status-success=Python (3.10, ubuntu-latest)
+      - status-success=Python (3.11, ubuntu-latest)
       - status-success=Python (3.7, windows-latest)
-      - status-success=Python (3.10, windows-latest)
+      - status-success=Python (3.11, windows-latest)
       - "status-success=ci/circleci: build"
 pull_request_rules:
   - name: Automatic rebase, CI and merge
@@ -21,11 +21,11 @@ pull_request_rules:
       - status-success=Docs
       - status-success=Lint
       - status-success=Python (3.7, macos-latest)
-      - status-success=Python (3.10, macos-latest)
+      - status-success=Python (3.11, macos-latest)
       - status-success=Python (3.7, ubuntu-latest)
-      - status-success=Python (3.10, ubuntu-latest)
+      - status-success=Python (3.11, ubuntu-latest)
       - status-success=Python (3.7, windows-latest)
-      - status-success=Python (3.10, windows-latest)
+      - status-success=Python (3.11, windows-latest)
       - "status-success=ci/circleci: build"
       #- status-success=codecov/patch
       #- status-success=codecov/project/c-tests
diff --git a/requirements/CI-complete/requirements.txt b/requirements/CI-complete/requirements.txt
index 3b5739d6c..8aeaf55f0 100644
--- a/requirements/CI-complete/requirements.txt
+++ b/requirements/CI-complete/requirements.txt
@@ -3,7 +3,7 @@ daiquiri==3.0.1
 demes==0.2.1
 mypy==0.910 
 newick==1.3.2
-numpy==1.21.4
+numpy==1.21.6
 pytest==6.2.5
 pytest-cov==3.0.0
 pytest-xdist==2.5.0
diff --git a/setup.cfg b/setup.cfg
index c325ad1ee..4f646a6b6 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -21,6 +21,7 @@ classifiers =
     Programming Language :: Python :: 3.8
     Programming Language :: Python :: 3.9
     Programming Language :: Python :: 3.10
+    Programming Language :: Python :: 3.11
     Programming Language :: Python :: 3 :: Only
     Development Status :: 5 - Production/Stable 
     Environment :: Other Environment


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 0ba90a1e0..24bd90945 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -26,7 +26,7 @@ jobs:
     runs-on: ${{ matrix.os }}
     strategy:
       matrix:
-        python: [ 3.7, "3.10" ]
+        python: [ 3.7, 3.11 ]
         os:  [ macos-latest, ubuntu-latest, windows-latest ]
     defaults:
       run:
diff --git a/requirements/CI-tests-pip/requirements.txt b/requirements/CI-tests-pip/requirements.txt
index 4cc4ab3e2..f676c6a4a 100644
--- a/requirements/CI-tests-pip/requirements.txt
+++ b/requirements/CI-tests-pip/requirements.txt
@@ -1,12 +1,14 @@
 bintrees==2.2.0
 daiquiri==3.0.1
 newick==1.3.1
-numpy==1.21.4
+numpy==1.21.6; python_version < '3.11' # Held at 1.21.6 for Python 3.7 compatibility
+numpy==1.24.1; python_version > '3.10'
 pytest==6.2.5
 pytest-xdist==2.4.0
 # https://github.com/tskit-dev/msprime/issues/1860
 # Required by python_jsonschema_objects
 jsonschema<5.0
 python_jsonschema_objects==0.4.1
-scipy==1.7.3
+scipy==1.7.3; python_version < '3.11'
+scipy==1.9.3; python_version > '3.10'
 tskit==0.5.3
diff --git a/tests/test_ancestry.py b/tests/test_ancestry.py
index 4859ceb19..ec8c769a7 100644
--- a/tests/test_ancestry.py
+++ b/tests/test_ancestry.py
@@ -870,9 +870,7 @@ def test_debug_logging(self, caplog):
         assert len(caplog.records) == 6
         assert caplog.messages[0].startswith("model[0] {'name': 'hudson'}")
         assert caplog.messages[-1].startswith("Completed at time")
-        assert (
-            caplog.messages[2] == "time=0.312845 ancestors=2 ret=ExitReason.MAX_EVENTS"
-        )
+        assert caplog.messages[2].startswith("time=0.312845 ancestors=2 ret=")
 
     def test_debug_logging_dtwf(self, caplog):
         sim = ancestry._parse_simulate(3, Ne=10, model="dtwf")
@@ -885,7 +883,7 @@ def test_debug_logging_dtwf(self, caplog):
                 " until max time: inf"
             )
             assert caplog.messages[-1].startswith("Completed at time")
-            assert caplog.messages[2] == "time=1 ancestors=3 ret=ExitReason.MAX_EVENTS"
+            assert caplog.messages[2].startswith("time=1 ancestors=3 ret=")
 
     def test_str(self):
         sim = ancestry._parse_simulate(3)