-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Expose interface to locate a physical .dist-info / .egg-info directory by distribution name #111
Comments
In GitLab by @jaraco on Mar 9, 2020, 22:34 Yes, I'd like to expose this information. The real trick is describing for other loaders what to present (if anything) for this property. |
In GitLab by @blueyed on Mar 17, 2020, 12:42 Note that using I also wanted to mention that with https://gitlab.com/python-devs/importlib_metadata/-/merge_requests/114 I've added a new |
In GitLab by @uranusjr on Jun 14, 2020, 21:27 Either return |
In GitLab by @jaraco on Sep 23, 2020, 15:53
I'm afraid I still don't understand the distinction between these two options. I think what you want here is something like: def locate_dist_dir(name):
dist, = metadata.Distribution.discover(name=name)
return dist._path if isinstance(getattr(dist, '_path', None), metadata.pathlib.Path) else None Perhaps
(uses one) WDYT? |
In GitLab by @uranusjr on Sep 23, 2020, 16:34 The impression I got from from !23 was that exposing A |
Looking at this again, I'm pretty sure
I think we have two options.
I think I'll go for option 1 for now, for pip's purposes, until something more is needed. |
I can see that pip never used the
I'm removing the protection I added for it. |
…6.0 to version 6.7.0 Barry Warsaw (1): gh-98040: Backport python/cpython#98059 Jason R. Coombs (21): Remove unnecessary and incorrect copyright notice. Fixes jaraco/skeleton#78. Replace flake8 with ruff. Fixes jaraco/skeleton#79 and sheds debt. 👹 Feed the hobgoblins (delint). Make substitution fields more prominent and distinct from true 'skeleton' references. (#71) Suppress EncodingWarning in build.env. Ref pypa/build#615. Remove reference to EncodingWarning as it doesn't exist on some Pythons. Inline the NullFinder behavior. Add docstring to test_integration to give some context. Remove Python 2 compatibility in _compat.NullFinder. Move test_interleaved_discovery from test_integration to test_main. Remove test_search_dist_dirs as it was never used. Ref python/importlib_metadata#111. Extract _topmost and _get_toplevel_name functions. Extract _topmost and _get_toplevel_name functions. Capture that _get_toplevel_name can return None. Streamline the test to check one expectation (the standard dist-info expectation is handled by other tests above. Inline the symlink setup. Consolidate PackageDistributions tests. Update _path to jaraco.path 3.6 with symlink support. Utilize the new Symlink in preparing the test case. Update changelog. Remove '__init__.py', not needed. Johan Herland (2): Add test to demonstrate issue with symlinked packages Attempt to fix issue with symlinked packages
In GitLab by @uranusjr on Feb 17, 2020, 20:29
#23 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 aDistributon
; this is already possible with #90). One way to do that would be to add an interface to do something likeThe text was updated successfully, but these errors were encountered: