bodono / scs-python

Python interface for SCS
MIT License
41 stars 33 forks source link

use flexible numpy version range at build time #39

Closed naphatkrit closed 3 years ago

naphatkrit commented 3 years ago

all that matters is the first minor version (e.g. 1.19.0 vs. 1.19.5 is no difference from abi interface perspective), so use a flexible version so that pip can choose to use the latest possible version. This speeds up builds for 3.9 as pre-built numpy wheel exists for 1.19.5 but not 1.19.0.

bodono commented 3 years ago

Does this put an upper bound on the numpy version? Surely we don't want to force people to downgrade their numpy?

naphatkrit commented 3 years ago

Nope, this is a build time only requirement. It does impacted what people have installed, pip will fetch two separate copies of bumpy, one for build and one for install.

On Tue, May 18, 2021 at 1:20 PM bodono @.***> wrote:

Does this put an upper bound on the numpy version? Surely we don't want to force people to downgrade their numpy?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bodono/scs-python/pull/39#issuecomment-843123362, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGR5LMZZORWYSGMDVZAGJDTOJLSHANCNFSM45CNARNA .

naphatkrit commented 3 years ago

as an example, I was still able to install numpy 1.20.3 with this patch:

root@docker-desktop:/# pip install 'numpy>=1.20,<1.21' /code/scs-python/dist/scs-2.1.3.tar.gz
Processing /code/scs-python/dist/scs-2.1.3.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting numpy<1.21,>=1.20
  Downloading numpy-1.20.3-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.4 MB)
     |████████████████████████████████| 15.4 MB 18.8 MB/s
Collecting scipy>=0.13.2
  Downloading scipy-1.6.3-cp39-cp39-manylinux1_x86_64.whl (27.3 MB)
     |████████████████████████████████| 27.3 MB 23.6 MB/s
Building wheels for collected packages: scs
  Building wheel for scs (PEP 517) ... done
  Created wheel for scs: filename=scs-2.1.3-cp39-cp39-linux_x86_64.whl size=497111 sha256=0d11766dfe6f3195a7e09b582fe93e2c5cfadc4ec4ef65c03a1d7ccfc1910cd4
  Stored in directory: /root/.cache/pip/wheels/8a/2f/fb/55369ac87dd166f1ad18a2d2a7f458bddcf551b5aa6a2779bd
Successfully built scs
Installing collected packages: numpy, scipy, scs
Successfully installed numpy-1.20.3 scipy-1.6.3 scs-2.1.3
WARNING: Running pip as root will break packages and permissions. You should install packages reliably by using venv: https://pip.pypa.io/warnings/venv
root@docker-desktop:/# pip freeze
numpy==1.20.3
scipy==1.6.3
scs @ file:///code/scs-python/dist/scs-2.1.3.tar.gz