bodono / scs-python

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

Opt into PEP 517 #29

Closed salvisolamartinell closed 3 years ago

salvisolamartinell commented 3 years ago

Using Python 3.6, a command like pip3 install scs fails because scs setup_requires is always populated by easy_install, installing numpy/1.20 which is incompatible with Python3.6.

The proposed solution (at https://github.com/pypa/pip/issues/9443) is that this project opts into PEP 517. A pyproject.toml file has to be created, but maybe there are other required changes. I don't have the time to check how to do it, so I leave it as an open issue.

This problem can be reproduced running docker build with the following Dockerfile (which uses an updated pip):

FROM ubuntu:18.04

RUN apt-get update && \
    apt-get install -y --no-install-recommends build-essential &&\
    apt-get install -y --no-install-recommends python3-dev python3-pip python3-setuptools && \
    pip3 install --user --ignore-installed pip && \
    ~/.local/bin/pip3 install scs

gives RuntimeError: Python version >= 3.7 required.

A workaround is installing a lower version of Numpy first, in a previous pip install command (pip3 install numpy==1.15.4 scs still fails). This works:

FROM ubuntu:18.04

RUN apt-get update && \
    apt-get install -y --no-install-recommends build-essential &&\
    apt-get install -y --no-install-recommends python3-dev python3-pip python3-setuptools && \
    pip3 install --user --ignore-installed pip && \
    ~/.local/bin/pip3 install numpy==1.15.4 && \
    ~/.local/bin/pip3 install scs
h-vetinari commented 3 years ago

This might have been solved now by #38, CC @naphatkrit

naphatkrit commented 3 years ago

Yes I believe that fixed the issue

bodono commented 3 years ago

Thanks everyone.