Repository: cvxgrp/diffcp (language: python)

Issue:
Py310 continued



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 2c50083..9194c0a 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -25,22 +25,13 @@ jobs:
       fail-fast: false
       matrix:
         os: [ ubuntu-18.04, macos-10.15, windows-2019 ]
-        python-version: [ 3.6, 3.7, 3.8, 3.9 ]
+        python-version: [ 3.6, 3.7, 3.8, 3.9, "3.10" ]
 
     env:
-      RUNNER_OS: ${{ matrix.os }}
       PYTHON_VERSION: ${{ matrix.python-version }}
-      PYPI_SERVER: ${{ secrets.PYPI_SERVER }}
-      PYPI_USER: ${{ secrets.PYPI_USER }}
-      PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
 
     steps:
       - uses: actions/checkout@v2
-      - name: Set Additional Envs
-        run: |
-          echo "PYTHON_SUBVERSION=$(echo $PYTHON_VERSION | cut -c 3-)" >> $GITHUB_ENV
-          echo "DEPLOY_PYPI_SOURCE=$( [[ $PYTHON_VERSION == 3.8 && $RUNNER_OS == 'macOS' ]] && echo 'True' || echo 'False' )" >> $GITHUB_ENV
-          echo "DEPLOY=$( [[ $GITHUB_EVENT_NAME == 'push' && $GITHUB_REF == 'refs/tags'* ]] && echo 'True' || echo 'False' )" >> $GITHUB_ENV
       - uses: conda-incubator/setup-miniconda@v2
         with:
           auto-update-conda: true
@@ -53,20 +44,52 @@ jobs:
             conda install scipy=1.3 numpy=1.16 mkl cvxpy scs pytest
           elif [[ "$PYTHON_VERSION" == "3.9" ]]; then
             conda install scipy=1.5 numpy=1.19 mkl cvxpy scs pytest
+          elif [[ "$PYTHON_VERSION" == "3.10" ]]; then
+            conda install scipy=1.7 numpy=1.21 mkl cvxpy scs pytest
           fi
           python setup.py install
 
       - name: Test
         run: |
           pytest
+          rm -rf build/
+
+  build_wheels:
+    needs: build
+
+    runs-on: ${{ matrix.os }}
+    strategy:
+      fail-fast: false
+      matrix:
+        os: [ ubuntu-18.04, macos-10.15, windows-2019 ]
+        python-version: [ 3.6, 3.7, 3.8, 3.9, "3.10" ]
+
+    env:
+      RUNNER_OS: ${{ matrix.os }}
+      PYTHON_VERSION: ${{ matrix.python-version }}
+      PYPI_SERVER: ${{ secrets.PYPI_SERVER }}
+      PYPI_USER: ${{ secrets.PYPI_USER }}
+      PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
+
+    steps:
+
+      - uses: actions/checkout@v2
+      - uses: actions/setup-python@v2
+        with:
+          python-version: ${{ matrix.python-version }}
+      - name: Set Additional Envs
+        shell: bash
+        run: |
+          echo "PYTHON_SUBVERSION=$(echo $PYTHON_VERSION | cut -c 3-)" >> $GITHUB_ENV
+          echo "DEPLOY_PYPI_SOURCE=$( [[ $PYTHON_VERSION == 3.8 && $RUNNER_OS == 'macOS' ]] && echo 'True' || echo 'False' )" >> $GITHUB_ENV
+          echo "DEPLOY=$( [[ $GITHUB_EVENT_NAME == 'push' && $GITHUB_REF == 'refs/tags'* ]] && echo 'True' || echo 'False' )" >> $GITHUB_ENV        
 
       - name: Build wheels
         if: ${{env.DEPLOY == 'True'}}
         env:
           CIBW_BUILD: "cp3${{env.PYTHON_SUBVERSION}}-*"
-          CIBW_SKIP: "*-win32 *-manylinux_i686"
-          CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_24
-        uses: joerick/cibuildwheel@v1.11.0
+          CIBW_SKIP: "*-win32 *_i686"
+        uses: joerick/cibuildwheel@v2.3.1
 
       - name: Build source
         if: ${{env.DEPLOY == 'True' && env.DEPLOY_PYPI_SOURCE == 'True'}}


Test patch:
diff --git a/tests/test_cone_prog_diff.py b/tests/test_cone_prog_diff.py
index bda6782..28cbf46 100644
--- a/tests/test_cone_prog_diff.py
+++ b/tests/test_cone_prog_diff.py
@@ -131,9 +131,9 @@ def test_proj_exp():
                           cp.norm(var[3:6] - x[3:6]) +
                           cp.norm(var[6:9] - x[6:9]))
         prob = cp.Problem(obj, constr)
-        prob.solve(solver="SCS", eps=1e-12)
+        prob.solve(solver="SCS", eps=1e-12, max_iters=10_000)
         p = cone_lib._proj(x, cone_lib.EXP, dual=False)
-        np.testing.assert_allclose(p, var.value, atol=1e-6)
+        np.testing.assert_allclose(p, var.value, atol=1e-4, rtol=1e-7)
         # x + Pi_{exp}(-x) = Pi_{exp_dual}(x)
         p_dual = cone_lib._proj(x, cone_lib.EXP_DUAL, dual=False)
         var = cp.Variable(9)
diff --git a/tests/test_scs.py b/tests/test_scs.py
index e972ef3..7e1041e 100644
--- a/tests/test_scs.py
+++ b/tests/test_scs.py
@@ -61,8 +61,8 @@ def test_warm_start():
 
 def test_threading():
     np.random.seed(0)
-    test_rtol = 1e-4
-    test_atol = 1e-9
+    test_rtol = 1e-3
+    test_atol = 1e-8
     m = 20
     n = 10
     As, bs, cs, cone_dicts = [], [], [], []
@@ -91,4 +91,4 @@ def test_threading():
                 i][-1](results[i][0], results[i][1], results[i][2])
             np.testing.assert_allclose(dA.todense(), dAs[i].todense(), rtol=test_rtol, atol=test_atol)
             np.testing.assert_allclose(dbs[i], db, rtol=test_rtol, atol=test_atol)
-            np.testing.assert_allclose(dcs[i], dc, rtol=test_rtol, atol=test_atol)
\ No newline at end of file
+            np.testing.assert_allclose(dcs[i], dc, rtol=test_rtol, atol=test_atol)