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

#257: save list in memory to avoid reusing exhausted iterator #258

Merged

Conversation

jeroendecroos
Copy link
Contributor

This should resolve #257

The solution I proposed in the issue, I did not use, but I resorted to the same way this variable was handled in the other functions "generic_tags" and "cpython_tags"

The test added was also tested against the unmodified code to ensure failure.

Only tested with "tox -e py37", full environment list is still running.

@jeroendecroos
Copy link
Contributor Author

Seems some Mypy assertion failed:

packaging/tags.py:331: error: Incompatible types in assignment (expression has type "List[str]", variable has type "Optional[Iterator[str]]")
packaging/tags.py:333: error: Item "None" of "Optional[Iterator[str]]" has no attribute "__iter__" (not iterable)

At first sight it doesn't seem to be introduced by my change, I'll check later this evening to confirm or fix.

tests/test_tags.py Show resolved Hide resolved
@brettcannon brettcannon merged commit d49fdc5 into pypa:master Jan 21, 2020
@pradyunsg
Copy link
Member

@brettcannon I'll go ahead and make a bugfix release of packaging?

sthagen added a commit to sthagen/pypa-packaging that referenced this pull request Jan 22, 2020
Don't have packaging.tags.compatible_tags() reuse an iterable (pypa#258)
@brettcannon
Copy link
Member

@pradyunsg SGTM, but should that wait until that issue in the pip repo involving what to do about PyPy wheels gets resolved (i.e. whether code will get put back in to add the old wheel names on top of the new ones)?

@tomasaschan
Copy link

@brettcannon @pradyunsg Is there a timeline for when this fix might get released? If it's still blocked on something, would you mind cross-referencing that issue from here, to make it easier to track progress?

Thanks!

@pradyunsg
Copy link
Member

The relevant pip issues are: pypa/pip#7626 and pypa/pip#7629

@xavfernandez
Copy link
Member

We could release a first patch version 20.0.1 now addressing pypa/pip#7626 and still release a 20.0.2 when a decision will be taken about PyPy wheels.

@pradyunsg
Copy link
Member

I think I'm done for the day today - I'll do all the release packaging+pip work tomorrow.

@pradyunsg
Copy link
Member

packaging==20.1 has now been released. :)

Following the precedence set by packaging 17.0/17.1, I've bumped the minor version number, instead of adding a patch number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

packaging.tags.compatible_tags is not re-creating a new iterator
6 participants