Skip to content

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

Merged
brettcannon merged 2 commits into
pypa:masterfrom
jeroendecroos:257_compatible_tags_no_reuse_iterator
Jan 21, 2020
Merged

#257: save list in memory to avoid reusing exhausted iterator#258
brettcannon merged 2 commits into
pypa:masterfrom
jeroendecroos:257_compatible_tags_no_reuse_iterator

Conversation

@jeroendecroos

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread tests/test_tags.py
@brettcannon brettcannon merged commit d49fdc5 into pypa:master Jan 21, 2020
@pradyunsg

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

@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
Copy Markdown
Member

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

@xavfernandez

Copy link
Copy Markdown
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
Copy Markdown
Member

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

@pradyunsg

Copy link
Copy Markdown
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