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

pip --only-binary equivalent #6798

Closed
cazador481 opened this issue Oct 13, 2022 · 16 comments · Fixed by #9150
Closed

pip --only-binary equivalent #6798

cazador481 opened this issue Oct 13, 2022 · 16 comments · Fixed by #9150
Labels
area/installer Related to the dependency installer kind/feature Feature requests/implementations

Comments

@cazador481
Copy link

Please support passing the --only-binary to pip.
We have a number of packages that we would only want to use binary package with. Please add the ability to support the pip flat --only-binary.
Thanks

@cazador481 cazador481 added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Oct 13, 2022
@neersighted neersighted changed the title Support passing only-binary to pip pip --only-binary equivalent Oct 13, 2022
@neersighted
Copy link
Member

This cannot be implemented by passing a flag to pip -- the logic has to become part of Poetry.

See #365, #1316, and the implementation in #5609 for details.

@neersighted neersighted added area/installer Related to the dependency installer and removed status/triage This issue needs to be triaged labels Oct 13, 2022
@jsjeannotte
Copy link

Any update on this? We're trying to migrate from pip-tools to poetry but this is a blocker for us.

@neersighted
Copy link
Member

As you can see, no one has started to implement this feature at this time.

@martsa1
Copy link

martsa1 commented Dec 19, 2022

This feature would be beneficial when building packages for older systems, I've recently seen this when attempting to use poetry and twine from an older linux system. Installing poetry with pip and passing the only-binary flag works, but for cryptography (or other hard-to-build packages) on older systems as dependencies managed by poetry, this kind of option would be very helpful.

@abi-jey
Copy link

abi-jey commented Feb 13, 2023

@martsa1 This would also help with macosx build distributions since not all package have update to support macosx > 11

It would be a great help if this is added as part of schema dependency specification.

@neersighted , I would need some guidance on how this feature can be implemented, I will read some dev guides and reach back to you this week hopefully with a draft pr.

@neersighted
Copy link
Member

If we implement it symmetrically with no-binary, it will merely be an install-time flag to use the sdist over wheels. This is a lot easier to implement.

Poetry currently does not factor in wheel availability of any sort into solving. As a constraint on a dependency, this would require a major reengineering of the solver and may not be accepted.

I can't really provide too much guidance beyond that, as now you'd be getting into most of the work of implementing either approach. I would suggest taking the former as a first step, as it is much simpler to implement and will solve some of the use cases described.

@abi-jey
Copy link

abi-jey commented Feb 13, 2023

How would you best define"install-time"? if I read related issues there is already a no-binary config, Would that mean something like poetry config installer.no-binary "greenlet,package2"? I have tried and I think that installs package2 and greenlet from source dist.

@neersighted
Copy link
Member

neersighted commented Feb 13, 2023

"install-time" is when we pick the package files to use in poetry install. Implementation would more or less be masking sdists for select packages so that selection has to pick a wheel, or fail.

@abi-jey
Copy link

abi-jey commented Feb 13, 2023

Sorry for misunderstanding, the question is rather how should the package be marked to use sdist? via dependency specification?

@neersighted
Copy link
Member

The "symmetrical with no-binary" bit implies that we make it a configuration knob like the matching feature.

@unixorn
Copy link

unixorn commented Mar 25, 2023

A no-binary option would fix things like the problem I ran into today where nosetests wouldn't run with my python set to 3.10.

The fix I found is to install it with pip install -U nose --no-binary :all:, but I don't see a way to pass command line options to pip via poetry.

@neersighted
Copy link
Member

https://python-poetry.org/blog/announcing-poetry-1.2.0/#opting-out-of-binary-distributions; Poetry is not Pip, but we do support this, as mentioned above.

@cazador481
Copy link
Author

I wanted to clarify that this issue is for having poetry only use the binary distribution. Which is the oposite of the -no-binary option.

@samskiter
Copy link

Does PIP_ONLY_BINARY=:all: poetry install still work or do we need this ticket to be able to do this?

@dimbleby
Copy link
Contributor

poetry does not use pip to install packages, pip environment variables are irrelevant.

this should be a fairly straightforward thing for someone to contribute: follow the general pattern for the existing --no-binary flag but... do the opposite.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/installer Related to the dependency installer kind/feature Feature requests/implementations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants