Repository: cvxpy/cvxpy (language: cpp)

Issue:
Source Distribution (sdist) publishing broken
**Describe the bug**
As of the 1.5.3 release, source distributions are no longer being published to pypi.

It appears this was broken in 69e3e6c95b3908a6d3e897d7ba665379c20191af, which removed the `single_action_config` matrix entries that were being used to build/publish sdists.

Sdist builds are keyed on the `SINGLE_ACTION_CONFIG` env var
https://github.com/cvxpy/cvxpy/blob/fc92b6937e0fb95ce96f10cd56f4c67cc5045e18/.github/workflows/build.yml#L114-L118

Which is set from the similarly-named matrix variable:
https://github.com/cvxpy/cvxpy/blob/fc92b6937e0fb95ce96f10cd56f4c67cc5045e18/.github/workflows/build.yml#L82


**To Reproduce**
Visit [pypi](https://pypi.org/project/cvxpy/#files) and observe no files available under the "Source Distributions header.

**Expected behavior**
Source distribution expected to be available, e.g. [this example from the 1.5.2 release](https://pypi.org/project/cvxpy-base/1.5.2/#files)

**Version**
 - OS: Any
 - CVXPY Version: 1.5.3

**Additional context**
Add any other context about the problem here.



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index ddf8bf3317..b45f67e941 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -30,11 +30,21 @@ jobs:
       matrix:
         os: [ ubuntu-20.04, macos-12, windows-2022 ]
         python-version: [ 3.9, "3.10", "3.11", "3.12" ]
+        include:
+          # These are intended to just add their extra parameter to existing matrix combinations;
+          # see https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrixinclude
+          - os: ubuntu-20.04
+            python-version: 3.12
+            openmp: "True"
+            single_action_config: false
+          - os: macos-12
+            python-version: 3.12
+            single_action_config: true
 
     env:
       RUNNER_OS: ${{ matrix.os }}
       PYTHON_VERSION: ${{ matrix.python-version }}
-      SINGLE_ACTION_CONFIG: "${{ matrix.single_action_config == 'True' && 'True' || 'False' }}"
+      SINGLE_ACTION_CONFIG: "${{ matrix.single_action_config && 'True' || 'False' }}"
       USE_OPENMP: "${{ matrix.openmp == 'True' && 'True' || 'False' }}"
       MOSEK_CI_BASE64: ${{ secrets.MOSEK_CI_BASE64 }}
 
@@ -75,14 +85,23 @@ jobs:
       matrix:
         os: [ ubuntu-20.04, macos-12, windows-2022 ]
         python-version: [ 3.9, "3.10", "3.11", "3.12" ]
+        build-cvxpy-base: [ true, false ]  # whether to build cvxpy-base (true) or regular cvxpy (false)
+        include:
+          # This is intended to just add the single_action_config parameter to one existing combination;
+          # see https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrixinclude
+          - os: ubuntu-20.04
+            python-version: 3.12
+            single_action_config: true
 
     env:
       RUNNER_OS: ${{ matrix.os }}
       PYTHON_VERSION: ${{ matrix.python-version }}
-      SINGLE_ACTION_CONFIG: "${{ matrix.single_action_config == 'True' }}"
+      SINGLE_ACTION_CONFIG: "${{ matrix.single_action_config }}"
+      PIP_INSTALL: "${{ matrix.python-version == '3.11' }}"
       PYPI_SERVER: ${{ secrets.PYPI_SERVER }}
       PYPI_USER: ${{ secrets.PYPI_USER }}
-      PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
+      PYPI_PASSWORD: ${{ matrix.build-cvxpy-base && secrets.PYPI_BASE_PASSWORD || secrets.PYPI_PASSWORD }}
+      CVXPY_BASE_SUFFIX: ${{ matrix.build-cvxpy-base && 'base-' || '' }}
 
     steps:
       - uses: actions/checkout@v4
@@ -96,77 +115,8 @@ jobs:
           echo "PYTHON_SUBVERSION=$(echo $PYTHON_VERSION | cut -c 3-)" >> $GITHUB_ENV
           echo "DEPLOY=$( [[ $GITHUB_EVENT_NAME == 'push' && $GITHUB_REF == 'refs/tags'* ]] && echo 'True' || echo 'False' )" >> $GITHUB_ENV
 
-      - name: Set up QEMU  # For aarch64, see https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation
-        if: runner.os == 'Linux'
-        uses: docker/setup-qemu-action@v3
-        with:
-          platforms: all
-
-      - name: Build wheels
-        if: ${{github.event_name == 'push' && env.USE_OPENMP != 'True'}}
-        env:
-          CIBW_BUILD: "cp3${{env.PYTHON_SUBVERSION}}-*"
-          CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*"
-          CIBW_ARCHS_MACOS: x86_64 universal2
-          CIBW_ARCHS_LINUX: auto aarch64
-        uses: pypa/cibuildwheel@v2.19.1
-
-      - name: Build source
-        if: ${{github.event_name == 'push' && env.SINGLE_ACTION_CONFIG == 'True'}}
-        run: |
-          pip install build
-          python -m build --sdist -o wheelhouse
-
-      - name: Check wheels
-        if: ${{github.event_name == 'push' &&  env.USE_OPENMP != 'True'}}
-        shell: bash
-        run: |
-          python -m pip install --upgrade twine
-          twine check wheelhouse/*
-
-      - name:  Release to pypi
-        if: ${{env.DEPLOY == 'True' &&  env.USE_OPENMP != 'True'}}
-        shell: bash
-        run: |
-          twine upload --skip-existing --repository-url $PYPI_SERVER wheelhouse/* -u $PYPI_USER -p $PYPI_PASSWORD
-
-      - name: Upload artifacts to github
-        if: ${{github.event_name == 'push' && env.USE_OPENMP != 'True'}}
-        uses: actions/upload-artifact@v4
-        with:
-          name: wheels-${{ matrix.os }}-${{ matrix.python-version }}
-          path: ./wheelhouse
-
-  build_cvxpy-base:
-    needs: build
-
-    runs-on: ${{ matrix.os }}
-    strategy:
-      fail-fast: false
-      matrix:
-        os: [ ubuntu-20.04, macos-12, windows-2022 ]
-        python-version: [ 3.9, "3.10", "3.11", "3.12" ]
-
-    env:
-      PYTHON_VERSION: ${{ matrix.python-version }}
-      SINGLE_ACTION_CONFIG: "${{ matrix.single_action_config == 'True' }}"
-      PIP_INSTALL: "${{ matrix.pip_install == 'True' }}"
-      PYPI_SERVER: ${{ secrets.PYPI_SERVER }}
-      PYPI_USER: ${{ secrets.PYPI_USER }}
-      PYPI_BASE_PASSWORD: ${{ secrets.PYPI_BASE_PASSWORD }}
-
-    steps:
-      - uses: actions/checkout@v4
-      - uses: actions/setup-python@v5
-        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=$( [[ $GITHUB_EVENT_NAME == 'push' && $GITHUB_REF == 'refs/tags'* ]] && echo 'True' || echo 'False' )" >> $GITHUB_ENV
-
       - name: Adapt pyproject.toml
+        if: ${{matrix.build-cvxpy-base}}
         shell: bash
         run: |
           # Mac has a different syntax for sed -i, this works across oses
@@ -179,7 +129,7 @@ jobs:
           rm -rf pyproject.toml.bak setup.py.bak
 
       - name: Verify that we can build by pip-install on each OS.
-        if: ${{env.PIP_INSTALL == 'True'}}
+        if: ${{matrix.build-cvxpy-base && env.PIP_INSTALL == 'True'}}
         run: |
           pip install . pytest cplex
           pytest cvxpy/tests/test_conic_solvers.py -k 'TestCPLEX'
@@ -191,7 +141,7 @@ jobs:
           platforms: all
 
       - name: Build wheels
-        if: ${{github.event_name == 'push'}}
+        if: ${{github.event_name == 'push' && env.USE_OPENMP != 'True'}}
         env:
           CIBW_BUILD: "cp3${{env.PYTHON_SUBVERSION}}-*"
           CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*"
@@ -206,21 +156,21 @@ jobs:
           python -m build --sdist -o wheelhouse
 
       - name: Check wheels
+        if: ${{github.event_name == 'push' && env.USE_OPENMP != 'True'}}
         shell: bash
-        if: ${{github.event_name == 'push'}}
         run: |
           python -m pip install --upgrade twine
           twine check wheelhouse/*
 
       - name: Release to pypi
+        if: ${{env.DEPLOY == 'True' && env.USE_OPENMP != 'True'}}
         shell: bash
-        if: ${{env.DEPLOY == 'True'}}
         run: |
-          twine upload --skip-existing --repository-url $PYPI_SERVER wheelhouse/* -u $PYPI_USER -p $PYPI_BASE_PASSWORD
+          twine upload --skip-existing --repository-url $PYPI_SERVER wheelhouse/* -u $PYPI_USER -p $PYPI_PASSWORD
 
       - name: Upload artifacts to github
-        if: ${{github.event_name == 'push'}}
+        if: ${{github.event_name == 'push' && env.USE_OPENMP != 'True'}}
         uses: actions/upload-artifact@v4
         with:
-          name: wheels-base-${{ matrix.os }}-${{ matrix.python-version }}
+          name: wheels-${CVXPY_BASE_SUFFIX}${{ matrix.os }}-${{ matrix.python-version }}
           path: ./wheelhouse
diff --git a/continuous_integration/install_dependencies.sh b/continuous_integration/install_dependencies.sh
index 6d4385b43b..d2591f53fd 100644
--- a/continuous_integration/install_dependencies.sh
+++ b/continuous_integration/install_dependencies.sh
@@ -9,7 +9,7 @@ conda config --set remote_connect_timeout_secs 30.0
 conda config --set remote_max_retries 10
 conda config --set remote_backoff_factor 2
 conda config --set remote_read_timeout_secs 120.0
-conda install mkl pip pytest hypothesis openblas "setuptools>65.5.1"
+conda install mkl pip pytest pytest-cov hypothesis openblas "setuptools>65.5.1"
 conda install ecos scs osqp cvxopt proxsuite daqp
 python -m pip install coptpy gurobipy piqp clarabel
 


Test patch: