Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete CPP backend #63

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
112 changes: 32 additions & 80 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down Expand Up @@ -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
Expand All @@ -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/[email protected]

- 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
Expand All @@ -179,10 +129,12 @@ 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'
# ensure a fresh state for cibuildwheel
rm -r build

- name: Set up QEMU # For aarch64, see https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation
if: runner.os == 'Linux'
Expand All @@ -191,7 +143,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*"
Expand All @@ -206,21 +158,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-${{ env.CVXPY_BASE_SUFFIX }}${{ matrix.os }}-${{ matrix.python-version }}
path: ./wheelhouse
2 changes: 1 addition & 1 deletion continuous_integration/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion cvxpy/atoms/affine/affine_atom.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import cvxpy.lin_ops.lin_op as lo
import cvxpy.lin_ops.lin_utils as lu
import cvxpy.utilities as u
from cvxpy import canonInterface
from cvxpy.atoms.atom import Atom
from cvxpy.cvxcore.python import canonInterface
from cvxpy.expressions.constants import Constant
from cvxpy.utilities import performance_utils as perf

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,7 @@ def get_problem_matrix(linOps,
default_canon_backend = get_default_canon_backend()
canon_backend = default_canon_backend if not canon_backend else canon_backend

if canon_backend == s.CPP_CANON_BACKEND:
from cvxpy.cvxcore.python.cppbackend import build_matrix
return build_matrix(id_to_col, param_to_size, param_to_col, var_length, constr_length, linOps)

elif canon_backend in {s.SCIPY_CANON_BACKEND, s.RUST_CANON_BACKEND,
if canon_backend in {s.SCIPY_CANON_BACKEND, s.RUST_CANON_BACKEND,
s.NUMPY_CANON_BACKEND}:
param_size_plus_one = sum(param_to_size.values())
output_shape = (np.int64(constr_length)*np.int64(var_length+1),
Expand Down
6 changes: 0 additions & 6 deletions cvxpy/cvxcore/.bumpversion.cfg

This file was deleted.

23 changes: 0 additions & 23 deletions cvxpy/cvxcore/.gitignore

This file was deleted.

75 changes: 0 additions & 75 deletions cvxpy/cvxcore/OLD_README.md

This file was deleted.

Loading
Loading