We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d327a70 commit da1b282Copy full SHA for da1b282
CHANGES.rst
@@ -20,6 +20,9 @@ development at the same time, such as 4.5.x and 5.0.
20
Unreleased
21
----------
22
23
+- When checking if a file mapping resolved to a file that exists, we weren't
24
+ considering files in .whl files. This is now fixed, closing `issue 1511`_.
25
+
26
- File pattern rules were too strict, forbidding plus signs and curly braces in
27
directory and file names. This is now fixed, closing `issue 1513`_.
28
@@ -29,6 +32,7 @@ Unreleased
29
32
- The PyPy wheel now installs on PyPy 3.7, 3.8, and 3.9, closing `issue 1510`_.
30
33
31
34
.. _issue 1510: https://github.com/nedbat/coveragepy/issues/1510
35
+.. _issue 1511: https://github.com/nedbat/coveragepy/issues/1511
36
.. _issue 1512: https://github.com/nedbat/coveragepy/issues/1512
37
.. _issue 1513: https://github.com/nedbat/coveragepy/issues/1513
38
coverage/files.py
@@ -160,7 +160,7 @@ def zip_location(filename):
160
name is in the zipfile.
161
162
"""
163
- for ext in ['.zip', '.egg', '.pex']:
+ for ext in ['.zip', '.whl', '.egg', '.pex']:
164
zipbase, extension, inner = filename.partition(ext + sep(filename))
165
if extension:
166
zipfile = zipbase + ext
@@ -473,7 +473,7 @@ def map(self, path, exists=source_exists):
473
if not exists(new):
474
self.debugfn(
475
f"Rule {original_pattern!r} changed {path!r} to {new!r} " +
476
- f"which doesn't exist, continuing"
+ "which doesn't exist, continuing"
477
)
478
continue
479
tests/test_files.py
@@ -86,13 +86,16 @@ def test_relative_dir_for_root(self, curdir, sep):
86
("a/b/c/foo.py", "a/b/c/foo.py", True),
87
("a/b/c/foo.py", "a/b/c/bar.py", False),
88
("src/files.zip", "src/files.zip/foo.py", True),
89
+ ("src/files.whl", "src/files.whl/foo.py", True),
90
("src/files.egg", "src/files.egg/foo.py", True),
91
("src/files.pex", "src/files.pex/foo.py", True),
92
("src/files.zip", "src/morefiles.zip/foo.py", False),
93
("src/files.pex", "src/files.pex/zipfiles/files.zip/foo.py", True),
94
]
95
96
def test_source_exists(self, to_make, to_check, answer):
97
+ # source_exists won't look inside the zipfile, so it's fine to make
98
+ # an empty file with the zipfile name.
99
self.make_file(to_make, "")
100
assert files.source_exists(to_check) == answer
101
0 commit comments