GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add some (failing) tests for _name_from_stem. Ref #377 · python/importlib_metadata@4461855

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • importlib_metadata
    • __init__.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎importlib_metadata/__init__.py‎

Copy file name to clipboardExpand all lines: importlib_metadata/__init__.py
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,14 @@ def _normalized_name(self):
960960

961961
@staticmethod
962962
def _name_from_stem(stem):
963+
"""
964+
>>> PathDistribution._name_from_stem('foo-3.0.egg-info')
965+
'foo'
966+
>>> PathDistribution._name_from_stem('CherryPy-3.0.dist-info')
967+
'CherryPy'
968+
>>> PathDistribution._name_from_stem('face.egg-info')
969+
'face'
970+
"""
963971
_, ext = os.path.splitext(stem)
964972
if ext not in ('.dist-info', '.egg-info'):
965973
return

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.