poetry icon indicating copy to clipboard operation
poetry copied to clipboard

pip --only-binary equivalent

Open cazador481 opened this issue 3 years ago • 10 comments

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 avatar Oct 13 '22 20:10 cazador481

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 avatar Oct 13 '22 20:10 neersighted

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

jsjeannotte avatar Dec 09 '22 13:12 jsjeannotte

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

neersighted avatar Dec 09 '22 15:12 neersighted

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.

martsa1 avatar Dec 19 '22 16:12 martsa1

@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.

abi-jey avatar Feb 13 '23 14:02 abi-jey

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.

neersighted avatar Feb 13 '23 14:02 neersighted

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.

abi-jey avatar Feb 13 '23 22:02 abi-jey

"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.

neersighted avatar Feb 13 '23 22:02 neersighted

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

abi-jey avatar Feb 13 '23 23:02 abi-jey

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

neersighted avatar Feb 13 '23 23:02 neersighted

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.

unixorn avatar Mar 25 '23 20:03 unixorn

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.

neersighted avatar Mar 26 '23 02:03 neersighted

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.

cazador481 avatar Mar 27 '23 19:03 cazador481

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

samskiter avatar Mar 12 '24 09:03 samskiter

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.

dimbleby avatar Mar 13 '24 15:03 dimbleby

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[bot] avatar Apr 14 '24 00:04 github-actions[bot]