Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
I
importlib_metadata
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 10
    • Issues 10
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 3
    • Merge Requests 3
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • python-devs
  • importlib_metadata
  • Issues
  • #111

Closed
Open
Opened Feb 17, 2020 by Tzu-ping Chung@uranusjr

Expose interface to locate a physical .dist-info / .egg-info directory by distribution name

#23 (closed) discussed whether it’d be possible to make the distribution’s _path attribute public. While I understand the rational behind not exposing it, IMO there are cases when a tool wants to find a distribution on disk. One example would be project tools wanting to perform a “clean” operation that cleans up previously-built package metadata.

Under those circumstances, the need is not to find a Distribution, and then locate it on disk (this does not make sense), but to find a dist/egg-info directory on disk (and then turn it into a Distributon; this is already possible with #90 (closed)). One way to do that would be to add an interface to do something like

def locate_dist_dir(name):
    for path in MetadataPathFinder._search_paths(sys.path):
        if Distribution.at(path).metadata['Name'] == name:
            yield path
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: python-devs/importlib_metadata#111