-
Notifications
You must be signed in to change notification settings - Fork 3k
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
pip fails to install projects that have a setup.py and pyproject.toml and there is no documentation on best practices I can locate #7874
Comments
The arrangement you have in sqlalchemy looks fine, so I'd expect the current version of pip to work fine with it. However, pip version 19.0 is out of date, and I believe there was a bug which is what you are seeing. Please can you check with the current version of pip? |
It's weird. I'm using the python:3.5.2 docker container. Removed the poetry.lock file, sqlalchemy and re-added it. For bitbucket-pipelines I also had to clear my cache. |
more problems reported, again, users all use --no-use-pep517 and that resolves.....can this problem be fixed in pip? when pip looks in pyproject.toml and sees nothing, that should mean, hey we aren't pep517...no ? sqlalchemy/alembic#672 |
@zzzeek As noted above, I believe this has been fixed in current versions of pip. Can you provide a reproducible case with the current version of pip and we'll definitely look into it, because this should not be happening. But without a way of reproducing it, it's hard to know what's (still) unfixed here :-( |
Update: Apologies, I may be misremembering the sequence of events here. This code looks like we do use PEP 517 if But I guess the question is then why does using PEP 517 break your project? We default to the Getting a reproducible test case is still likely to be the best way forward. #6453 (and related issues around that time) is what I was recalling - it appears that the main issue at the time was editable mode, which isn't relevant (as far as I can see) in this case. |
Hi @pfmoore. Regarding
I guess that the problem here is that trying pep517 then falling back to setup.py still has side effects, event if ideally it should not. |
The problem here is that in the long term, we will be removing the "directly invoke So what I'd much rather do is to identify the issue here now, and ensure that PEP 517 works for you, while still having the "escape hatch" of Of the two cases you mention, you say that sqlalchemy/sqlalchemy#5207 is a broken pip, so I assume that's not our issue (let me know if that's incorrect!). And sqlalchemy/alembic#672 seems to be someone trying to build and install but not having wheel and setuptools available in their offline wheel store, so they can't set up the build environment (which needs setuptools and wheel installed). That's nothing to do with PEP 517 - it's build isolation that's the issue here - we set up an isolated build environment and install the needed tools to do the build in there. So the solution there is simply to add wheel to the offline wheel store, surely? |
Thanks for clarifying. I did not know that the aim was to make pep517 mandatory. Right now I cannot identify a specific issue, other that pep517 does things differently so new assumptions are required in the install environment. The only suggestion I have at the moment it that pip could suggest trying Edit: note that the better errors are also be useful without suggesting the |
IIUC we are saying that pip has made a silent behavioral change such that new practices such as "add wheel to the offline wheel store" are now required for users environments where this was not required before, and that this new, silent requirement crops up as a result of the pyproject.toml file being present in our packages, and can only be bypassed to have pip behave the old way by using a flag called --no-use-pep517 that users will not generally be familiar with. This sounds like it is a fully backwards incompatible change that was added to pip, AFAICT, assuming SQLAlchemy has broken no best practice by adding a pyproject.toml file. Basically, if running |
This is almost certainly a bug in whatever debian does to I can reproduce this by running debian:unstable in a docker container and doing:
This fails because of a broken I can then fix the problem by installing pip from PyPI:
So I would say that this is not a regression in I think this issue can be closed and hopefully someone can report it to Debian? |
As a workaround, I suggest people who run into this issue use I believe that using a virtual environment will also solve this problem, though I believe Debian messes around with the virtualenv packaging as well 🤷♂️ Using the system python: almost always a bad idea! |
we have not identified that sqlalchemy/alembic#672 is debian specific. the user has not provided the OS in use. |
also sqlalchemy/alembic#672 is using a virtual environment already. |
@zzzeek That looks like a very different problem. I have commented in the issue, but again I see no reason to believe that's a problem with |
I've also come across this problem in Debian testing/bullseye trying to install Pelican inside a virtual environment.
In this case, a solution has been to force reinstalling pip:
I hope this helps to shed some light on the issue. |
Looks like this is resolved! Closing! |
For additional information, this has been filed as a Debian bug since it is present on Debian-supplied pip only (as mentioned in #9746). To follow up this bug, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=954256 |
Environment
Description
multiple users are reporting that they cannot install SQLAlchemy because it has added a pyproject.toml file. The reason this file was added is becasue it is documented as a best practice for black configuration and for no other purpose.
I do not know why the builds are failing on various environments (Debian, Poetry) or who is doing what wrong. However I am not going to remove the pyproject.toml file until I can get some clarity on what the best practice is for having setup.py and pyproject.toml at the same time is, or if it should never be done, or alterantively if SQLAlhcemy can indeed upgrade to "pep517" in some way such that my users are not complaining.
Related issues:
sqlalchemy/sqlalchemy#5209
sqlalchemy/sqlalchemy#5207
python-poetry/poetry#2197
The text was updated successfully, but these errors were encountered: