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

The yanked flag should not be ignored #146

Open
whitphx opened this issue Oct 22, 2024 · 6 comments
Open

The yanked flag should not be ignored #146

whitphx opened this issue Oct 22, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@whitphx
Copy link

whitphx commented Oct 22, 2024

Currently micropip.install() ignores the yanked flag and even installs the yanked version.
For example, as of 2024-10-22, micropip.install("python-multipart") installs 0.0.13 even though the version is yanked.

CleanShot 2024-10-22 at 14 10 10@2x

>>> import micropip
>>> await micropip.install("python-multipart")
>>> import python_multipart
>>> python_multipart.__version__
'0.0.13'

As a reference, pip deals with the yank flag properly, as the yanked python-multipart==0.0.13 is ignored as below for example.

.venv ❯ pip install python-multipart
Collecting python-multipart
  Obtaining dependency information for python-multipart from https://files.pythonhosted.org/packages/f5/0b/c316262244abea7481f95f1e91d7575f3dfcf6455d56d1ffe9839c582eb1/python_multipart-0.0.12-py3-none-any.whl.metadata
  Downloading python_multipart-0.0.12-py3-none-any.whl.metadata (1.9 kB)
Downloading python_multipart-0.0.12-py3-none-any.whl (23 kB)
Installing collected packages: python-multipart
Successfully installed python-multipart-0.0.12
@hoodmane hoodmane added the bug Something isn't working label Oct 22, 2024
@hoodmane
Copy link
Member

Thanks for the report! Sounds like it's probably a quick fix.

@ryanking13
Copy link
Member

Thanks for the report. The Simple JSON API contains "yanked" flag, so it would be possible to use that flag to skip the package.

Are you interested in making a PR?

@whitphx
Copy link
Author

whitphx commented Oct 22, 2024

Thanks, yes I would like to give it a try.

@whitphx
Copy link
Author

whitphx commented Oct 22, 2024

I drafted a PR. Can you take a look?

@whitphx
Copy link
Author

whitphx commented Oct 22, 2024

Sorry but implementing https://peps.python.org/pep-0592/#installers into the current code would be complicated and requires more code changes, and I think the core maintainer should do it.
Let me close my PR and hand it over.
fyi, pypa/pip does it like this: https://github.com/pypa/pip/blob/6958e28f366f00373343efcd5a7e776a810cb133/src/pip/_internal/resolution/resolvelib/factory.py#L314-L344

@ryanking13
Copy link
Member

ryanking13 commented Oct 25, 2024

@whitphx Sure. Thanks for the code pointer. Let me take it over and have a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants