Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-103661: Apply bugfix from importlib_metadata 6.5.1 and restore test.#103681

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jaraco merged 1 commit intopython:mainfromjaraco:bugfix/103661
Apr 22, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletionsLib/importlib/metadata/__init__.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -516,27 +516,29 @@ def _read_files_egginfo_installed(self):
"""
Read installed-files.txt and return lines in a similar
CSV-parsable format as RECORD: each file must be placed
relative to the site-packages directory, and must also be
relative to the site-packages directory and must also be
quoted (since file names can contain literal commas).

This file is written when the package is installed by pip,
but it might not be written for other installation methods.
Hence, even if we can assume that this file is accurate
when it exists, we cannot assume that it always exists.
Assume the file is accurate if it exists.
"""
text = self.read_text('installed-files.txt')
#We need to prepend the .egg-info/ subdir to the lines in this file.
# But this subdir is only availablein thePathDistribution's self._path
#which is not easily accessible from this base class...
#Prepend the .egg-info/ subdir to the lines in this file.
# But this subdir is only availablefromPathDistribution's
#self._path.
subdir = getattr(self, '_path', None)
if not text or not subdir:
return
with contextlib.suppress(Exception):
ret = [
str((subdir / line).resolve().relative_to(self.locate_file('')))
for line in text.splitlines()
]
return map('"{}"'.format, ret)

paths = (
(subdir / name)
.resolve()
.relative_to(self.locate_file('').resolve())
.as_posix()
for name in text.splitlines()
)
return map('"{}"'.format, paths)

def _read_files_egginfo_sources(self):
"""
Expand Down
13 changes: 1 addition & 12 deletionsLib/test/test_importlib/test_metadata_api.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,23 +76,12 @@ def test_for_top_level(self):
expect_content,
)

@staticmethod
def _workaround_103661(tests):
"""
Skip failing test for now is it's failing on buildbot workers.
See https://github.com/python/cpython/issues/103661.
"""
import platform
if platform.system() == 'Windows':
tests.remove(('egg_with_no_modules-pkg', '\n'))
return tests

def test_read_text(self):
tests = [
('egginfo-pkg', 'mod\n'),
('egg_with_no_modules-pkg', '\n'),
]
for pkg_name, expect_content inself._workaround_103661(tests):
for pkg_name, expect_content in tests:
with self.subTest(pkg_name):
top_level = [
path for path in files(pkg_name) if path.name == 'top_level.txt'
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp