|
11 | 11 | from vcs_versioning._fallback_workdir import ( |
12 | 12 | ArchivedWorkdir, |
13 | 13 | MetadataWorkdir, |
14 | | - PkgInfoWorkdir, |
15 | 14 | StaticWorkdir, |
16 | 15 | ) |
17 | 16 | from vcs_versioning._scm_metadata import ( |
@@ -130,16 +129,6 @@ def test_list_tracked_files_scoped_to_project_root(self, tmp_path: Path) -> None |
130 | 129 |
|
131 | 130 |
|
132 | 131 | class TestDiscoverWorkdirFallback: |
133 | | - def test_discovers_pkginfo(self, tmp_path: Path) -> None: |
134 | | - (tmp_path / "PKG-INFO").write_text( |
135 | | - "Metadata-Version: 2.1\nName: pkg\nVersion: 3.0.0\n", |
136 | | - encoding="utf-8", |
137 | | - ) |
138 | | - config = Configuration(relative_to=str(tmp_path / "pyproject.toml")) |
139 | | - result = discover_workdir(config) |
140 | | - assert result is not None |
141 | | - assert isinstance(result, PkgInfoWorkdir) |
142 | | - |
143 | 132 | def test_discovers_git_archival(self, tmp_path: Path) -> None: |
144 | 133 | (tmp_path / ".git_archival.txt").write_text( |
145 | 134 | "node: abc1234\nref-names: HEAD\n", |
@@ -219,40 +208,6 @@ def test_mismatched_project_path_raises(self, tmp_path: Path) -> None: |
219 | 208 | discover_workdir(config) |
220 | 209 |
|
221 | 210 |
|
222 | | -class TestFallbackPriority: |
223 | | - @pytest.mark.issue(1431) |
224 | | - def test_unprocessed_archival_falls_through_to_pkginfo( |
225 | | - self, tmp_path: Path |
226 | | - ) -> None: |
227 | | - """Unprocessed .git_archival.txt must not shadow a valid PKG-INFO. |
228 | | -
|
229 | | - PyPI sdists contain both files: a .git_archival.txt with raw |
230 | | - ``$Format:...`` placeholders (never substituted because the sdist |
231 | | - was built by setuptools, not ``git archive``) and a PKG-INFO with |
232 | | - the correct version. Before the fix, the archival fallback was |
233 | | - stashed as the sole candidate and its ``get_scm_version()`` returned |
234 | | - None, causing a LookupError. |
235 | | - """ |
236 | | - (tmp_path / ".git_archival.txt").write_text( |
237 | | - "node: $Format:%H$\n" |
238 | | - "node-date: $Format:%cI$\n" |
239 | | - "describe-name: $Format:%(describe:tags=true)$\n" |
240 | | - "ref-names: $Format:%D$\n", |
241 | | - encoding="utf-8", |
242 | | - ) |
243 | | - (tmp_path / "PKG-INFO").write_text( |
244 | | - "Metadata-Version: 2.1\nName: my-pkg\nVersion: 1.2.3\n", |
245 | | - encoding="utf-8", |
246 | | - ) |
247 | | - config = Configuration(relative_to=str(tmp_path / "pyproject.toml")) |
248 | | - result = discover_workdir(config) |
249 | | - assert result is not None |
250 | | - assert isinstance(result, PkgInfoWorkdir) |
251 | | - version = result.get_scm_version() |
252 | | - assert version is not None |
253 | | - assert str(version.tag) == "1.2.3" |
254 | | - |
255 | | - |
256 | 211 | class TestFallbackWorkdirDiscoveryFactories: |
257 | 212 | def test_discover_archival_git(self, tmp_path: Path) -> None: |
258 | 213 | from vcs_versioning._fallback_workdir import discover_archival |
|
0 commit comments