-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Error installing package using poetry or using pip with --use-pep517 flag. PEP 517, 518, 621 and 631 compliance #447
Comments
I tried to fix it myself https://github.com/mihaiblidaru/Surprise/tree/pep517_compliant_package but I am reluctant to open a pull-request yet because this slightly changes how the package is build and how the project dependencies are maintained. Before
Now
The generated package is a (almost) byte level copy of the one that you can download from pypi today, but it can be installed with the |
I'm also using poetry, but with docker using |
Another alternative would be to have pre-built python wheels on pypi that to not require building at installation which would also eliminate the requirement to have a C compiler installed |
Encountered the same issue. As I see it the problem is not in absence of I have no idea how to fix it on my side, without forking the repo 🤔 |
It like this issue is resolved now https://github.com/NicolasHug/Surprise/blob/master/pyproject.toml#L37 |
Description
Error installing
scikit-surprise
usingpoetry
. Poetry is a python packaging and dependency management tool that I intended to use for my project.Upon further investigation I discovered that the error is triggered by the
--use-pep517
flag thatpoetry
passes topip
during installation. The full comand that poetry executes is:I found no workaround, there is no way to configure if
poetry
executespip
with or without the--use-pep517
flag.The package installation fails because the package is not PEP 517 compliant. PEP 517 (and extended in PEP 518, 621, 631) requires a project to have a
pyproject.toml
file which contains package metadata (that right now is mainly defined in setup.py) that includes a mandatory section where you can define build dependencies. Another change added in PEP 517 is that packages are build in isolation, that is, pip(or other front-end) builds the package in a isolated environment that only has the project build dependencies installed).The installation fails because right now
pip
has no idea thatnumpy
(orcython
) has to be installed in the isolated environment before building, because that requirement it's not specified in any file.While I understand that it's would be imposible to acomodate for all dependency managers in the world, PEP 517 seems to be pretty standard nowadays. It seem python packaging is moving away from the old setup.py file as it is a not very standardized, uniform way to manage project dependencies or build packages.
Steps/Code to Reproduce
Adding the package to a poetry managed project fails.
# Poetry poetry add scikit-surprise
Also using pip with
--use-pep517
flag directly from online pypi repo.# Or using pip pip3 install --use-pep517 --no-cache-dir scikit-surprise
Expected Results
Package is installed successfully.
Actual Results
The error trace from
poetry
Very long error trace
Versions
The surprise version I tried to install is 1.1.3 as shown in the error trace above.
The text was updated successfully, but these errors were encountered: