Skip to content

Remove all globbed dist-infos in editable self-installs#3742

Closed
nickray wants to merge 1 commit into
python-poetry:masterfrom
nickray:remove-stale-editable-dist-infos
Closed

Remove all globbed dist-infos in editable self-installs#3742
nickray wants to merge 1 commit into
python-poetry:masterfrom
nickray:remove-stale-editable-dist-infos

Conversation

@nickray
Copy link
Copy Markdown

@nickray nickray commented Mar 1, 2021

Pull Request Check List

Resolves: #2918, #3741, partially #2855.

  • Added tests for changed code.
  • Updated documentation for changed code.

Depends on: python-poetry/poetry-core#137

The SitePackages class seems not quite made for globbing. Appreciate pointers if there is a better way..

This depends on python-poetry/poetry-core#137 to avoid code duplication, might be easier to just implement the method from there here.

@nickray nickray force-pushed the remove-stale-editable-dist-infos branch 5 times, most recently from 1407dcd to 6acb4dd Compare March 4, 2021 10:03
@nickray
Copy link
Copy Markdown
Author

nickray commented Mar 4, 2021

This was mostly good to go, until a change in poetry-core/master broke the poetry/master build. How to proceed?

@nickray nickray force-pushed the remove-stale-editable-dist-infos branch from 6acb4dd to 322b546 Compare March 4, 2021 10:29
@nickray nickray force-pushed the remove-stale-editable-dist-infos branch from 322b546 to 2c5ee7f Compare March 4, 2021 10:31
Copy link
Copy Markdown
Member

@abn abn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could add a find_glob method to SitePackages. That might be the clean way forward.

dist_info_paths = [
Path(dist_info)
for site_package_dir in self._env.site_packages.writable_candidates
for dist_info in site_package_dir.glob(builder.dist_info_glob)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the glob is only really required for an editable builder; you can construct it here.

Copy link
Copy Markdown
Author

@nickray nickray Mar 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can, sure. If I do, though, the glob "{}-*.dist-info".format(escaped_name) depends on implementation details of core (structure of format string, implementation of escape_name(self._package.name)), which I felt was iffy.

@fredrikaverpil
Copy link
Copy Markdown
Contributor

This issue is of interest to me, is there anything I can do to help?

@fredrikaverpil
Copy link
Copy Markdown
Contributor

@stephsamson @abn maybe this should be closed now that #3900 was merged?

@abn
Copy link
Copy Markdown
Member

abn commented Apr 11, 2021

Superseded by #3900.

Thanks @fredrikaverpil

@abn abn closed this Apr 11, 2021
@nickray nickray deleted the remove-stale-editable-dist-infos branch April 13, 2021 19:48
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 1, 2024

This pull request 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 Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[1.1.0b2] Bumping version leaves orphaned dist-info in site-packages

3 participants