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

Pin setuptools version to fix installation with pip #1951

Merged
merged 2 commits into from Nov 22, 2022

Conversation

piiq
Copy link
Contributor

@piiq piiq commented Nov 21, 2022

Description

This PR pins the setuptools version to the latest version that's used in the project's CI.
Resolves #1950 that was introduced due to pypa/setuptools#3693

Type of change

  • New feature (backwards compatible)
  • New feature (breaking API changes)
  • Bug fix
  • Other (Documentation, CI, ...)

Contribution checklist

  • [ ] Add our license to new files.
  • Check that your code adheres to our coding style.
  • [ ] Write unittests.
  • Run the unittests and check that they’re passing.
  • Run the benchmarks to make sure your change doesn’t introduce a regression.

Test procedure:

  • Install package from source with python setup.py develop && pip install .
  • Run unit tests with cd cvxpy/tests && pytest
  • Run benchmarks with ``

Test results:

  • Unit tests: 852 passed, 289 skipped, 543 warnings in 41.25s
  • Benchmark: 9 passed, 3 skipped, 1 warning in 6.43s

@CLAassistant
Copy link

CLAassistant commented Nov 21, 2022

CLA assistant check
All committers have signed the CLA.

@piiq
Copy link
Contributor Author

piiq commented Nov 21, 2022

@phschiele @SteveDiamond I would appreciate a review and let me know if there is anything I can do to have this patch released to pypi

@SteveDiamond
Copy link
Collaborator

@piiq can you clarify more what happened? I saw your link, but is this bug in setuptools going to be fixed soon, or is this a permanent problem due to deprecation?

@github-actions
Copy link

github-actions bot commented Nov 22, 2022

Benchmarks that have stayed the same:

   before           after         ratio
 [475c2d43]       [fdf67278]
      25.8±0s          26.3±0s     1.02  cvar_benchmark.CVaRBenchmark.time_compile_problem
      18.6±0s          18.8±0s     1.01  qp_1611_benchmark.QP1611Benchmark.time_compile_problem
      8.31±0s          8.37±0s     1.01  huber_regression.HuberRegression.time_compile_problem
      8.01±0s          8.05±0s     1.00  semidefinite_programming.SemidefiniteProgramming.time_compile_problem
      8.46±0s          8.49±0s     1.00  optimal_advertising.OptimalAdvertising.time_compile_problem
      3.74±0s          3.74±0s     1.00  simple_LP_benchmarks.SimpleFullyParametrizedLPBenchmark.time_compile_problem
      40.0±0s          39.6±0s     0.99  sdp_segfault_1132_benchmark.SDPSegfault1132Benchmark.time_compile_problem
      21.1±0s          20.6±0s     0.98  simple_LP_benchmarks.SimpleLPBenchmark.time_compile_problem
      9.88±0s          9.61±0s     0.97  svm_l1_regularization.SVMWithL1Regularization.time_compile_problem
      1.65±0s          1.58±0s     0.96  simple_LP_benchmarks.SimpleScalarParametrizedLPBenchmark.time_compile_problem

@piiq
Copy link
Contributor Author

piiq commented Nov 22, 2022

Thanks for the reply @SteveDiamond

If i understand correctly it's a permanent problem due to deprecation on the setuptools side that the numpy maintainers are not planning to adjust to. From this comment in a numpy issue thread I understood that numpy does not and will not support setuptools>60, but all versions up to the 65.5.0 were ok.

For cvxpy the problem is that it breaks the build process of SCS when installing with pip on a platform for which wheels with pre-built SCS binaries are not provided.

I've explicitly pinned the versions in pyproject.toml, setup.py and setup.cfg to be lower than the highest version that's installed onto the build system in continuous_integration/install_dependencies.sh. This solves the failing build issue because this pinned setuptools version is lower than 65.5.0.

For a test that the patch works as expected on an Apple Silicon machine I run pip install cvxpy or pip install git+https://github.com/cvxpy/cvxpy.git@master and see the SCS build fail and I run pip install git+https://github.com/piiq/cvxpy.git@bugfix/pin-setuptools and see that the build succeeds

setup.cfg Show resolved Hide resolved
@SteveDiamond SteveDiamond added backport bugfix to 1.2 next patch Not yet included in a patch labels Nov 22, 2022
@SteveDiamond SteveDiamond merged commit 73cac2d into cvxpy:master Nov 22, 2022
This was referenced Nov 22, 2022
@SteveDiamond SteveDiamond removed the next patch Not yet included in a patch label Nov 23, 2022
@piiq piiq deleted the bugfix/pin-setuptools branch November 23, 2022 08:41
@bodono
Copy link
Contributor

bodono commented Nov 23, 2022

By the way, I accepted this PR that makes a similar fix to SCS a few days ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package no longer installable from pip
5 participants