Skip to content

Commit 045f919

Browse files
committed
Fix test formatting to comply with packaging 26.0+
1 parent 07ffbb5 commit 045f919

File tree

5 files changed

+35
-26
lines changed

5 files changed

+35
-26
lines changed

tests/backend/metadata/test_core.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,7 @@ def test_direct_reference_allowed(self, isolation):
11631163
},
11641164
)
11651165

1166-
assert metadata.core.dependencies == ["proj@ git+https://github.com/org/proj.git@v1"]
1166+
assert metadata.core.dependencies == ["proj @ git+https://github.com/org/proj.git@v1"]
11671167

11681168
def test_context_formatting(self, isolation, uri_slash_prefix):
11691169
metadata = ProjectMetadata(
@@ -1176,7 +1176,7 @@ def test_context_formatting(self, isolation, uri_slash_prefix):
11761176
)
11771177

11781178
normalized_path = str(isolation).replace("\\", "/")
1179-
assert metadata.core.dependencies == [f"proj@ file:{uri_slash_prefix}{normalized_path}"]
1179+
assert metadata.core.dependencies == [f"proj @ file:{uri_slash_prefix}{normalized_path}"]
11801180

11811181
def test_correct(self, isolation):
11821182
metadata = ProjectMetadata(
@@ -1343,7 +1343,7 @@ def test_context_formatting(self, isolation, uri_slash_prefix):
13431343
)
13441344

13451345
normalized_path = str(isolation).replace("\\", "/")
1346-
assert metadata.core.optional_dependencies == {"foo": [f"proj@ file:{uri_slash_prefix}{normalized_path}"]}
1346+
assert metadata.core.optional_dependencies == {"foo": [f"proj @ file:{uri_slash_prefix}{normalized_path}"]}
13471347

13481348
def test_direct_reference_allowed(self, isolation):
13491349
metadata = ProjectMetadata(
@@ -1358,7 +1358,7 @@ def test_direct_reference_allowed(self, isolation):
13581358
},
13591359
)
13601360

1361-
assert metadata.core.optional_dependencies == {"foo": ["proj@ git+https://github.com/org/proj.git@v1"]}
1361+
assert metadata.core.optional_dependencies == {"foo": ["proj @ git+https://github.com/org/proj.git@v1"]}
13621362

13631363
def test_correct(self, isolation):
13641364
metadata = ProjectMetadata(

tests/backend/metadata/test_spec.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def test_dependencies(self):
216216
Requires-Dist: bar==5; extra == 'feature2'
217217
Requires-Dist: foo==1; (python_version < '3') and extra == 'feature2'
218218
Provides-Extra: feature3
219-
Requires-Dist: baz@ file:///path/to/project ; extra == 'feature3'
219+
Requires-Dist: baz @ file:///path/to/project ; extra == 'feature3'
220220
"""
221221
assert project_metadata_from_core_metadata(core_metadata) == {
222222
"name": "My.App",
@@ -225,7 +225,7 @@ def test_dependencies(self):
225225
"optional-dependencies": {
226226
"feature1": ['bar==5; python_version < "3"', "foo==1"],
227227
"feature2": ["bar==5", 'foo==1; python_version < "3"'],
228-
"feature3": ["baz@ file:///path/to/project"],
228+
"feature3": ["baz @ file:///path/to/project"],
229229
},
230230
}
231231

@@ -990,7 +990,7 @@ def test_all(self, constructor, helpers, temp_dir):
990990
Requires-Dist: bar==5; extra == 'feature2'
991991
Requires-Dist: foo==1; (python_version < '3') and extra == 'feature2'
992992
Provides-Extra: feature3
993-
Requires-Dist: baz@ file:///path/to/project ; extra == 'feature3'
993+
Requires-Dist: baz @ file:///path/to/project ; extra == 'feature3'
994994
Description-Content-Type: text/markdown
995995
996996
test content
@@ -1459,7 +1459,7 @@ def test_all(self, constructor, helpers, temp_dir):
14591459
Requires-Dist: bar==5; extra == 'feature2'
14601460
Requires-Dist: foo==1; (python_version < '3') and extra == 'feature2'
14611461
Provides-Extra: feature3
1462-
Requires-Dist: baz@ file:///path/to/project ; extra == 'feature3'
1462+
Requires-Dist: baz @ file:///path/to/project ; extra == 'feature3'
14631463
Description-Content-Type: text/markdown
14641464
14651465
test content
@@ -1898,7 +1898,7 @@ def test_all(self, constructor, temp_dir, helpers):
18981898
Requires-Dist: bar==5; extra == 'feature2'
18991899
Requires-Dist: foo==1; (python_version < '3') and extra == 'feature2'
19001900
Provides-Extra: feature3
1901-
Requires-Dist: baz@ file:///path/to/project ; extra == 'feature3'
1901+
Requires-Dist: baz @ file:///path/to/project ; extra == 'feature3'
19021902
Description-Content-Type: text/markdown
19031903
19041904
test content
@@ -2364,7 +2364,7 @@ def test_all(self, constructor, temp_dir, helpers):
23642364
Requires-Dist: bar==5; extra == 'feature2'
23652365
Requires-Dist: foo==1; (python_version < '3') and extra == 'feature2'
23662366
Provides-Extra: feature3
2367-
Requires-Dist: baz@ file:///path/to/project ; extra == 'feature3'
2367+
Requires-Dist: baz @ file:///path/to/project ; extra == 'feature3'
23682368
Description-Content-Type: text/markdown
23692369
23702370
test content

tests/cli/env/test_show.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -451,15 +451,15 @@ def test_context_formatting(hatch, helpers, temp_dir, config_file):
451451
+======+=========+==============+=======================+
452452
| foo | virtual | pydantic | BAR=FOO_BAR |
453453
+------+---------+--------------+-----------------------+
454-
Matrices
455-
+---------+---------+------------+------------------------+
456-
| Name | Type | Envs | Dependencies |
457-
+=========+=========+============+========================+
458-
| default | virtual | py39-9000 | foo@ {root:uri}/../foo |
459-
| | | py39-3.14 | |
460-
| | | py310-9000 | |
461-
| | | py310-3.14 | |
462-
+---------+---------+------------+------------------------+
454+
Matrices
455+
+---------+---------+------------+-------------------------+
456+
| Name | Type | Envs | Dependencies |
457+
+=========+=========+============+=========================+
458+
| default | virtual | py39-9000 | foo @ {root:uri}/../foo |
459+
| | | py39-3.14 | |
460+
| | | py310-9000 | |
461+
| | | py310-3.14 | |
462+
+---------+---------+------------+-------------------------+
463463
"""
464464
)
465465

tests/env/plugin/test_interface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,7 @@ def test_context_formatting(self, isolation, isolated_data_dir, platform, temp_a
11941194
)
11951195

11961196
normalized_path = str(isolation).replace("\\", "/")
1197-
assert environment.dependencies == ["dep2", f"proj@ file:{uri_slash_prefix}{normalized_path}", "dep1"]
1197+
assert environment.dependencies == ["dep2", f"proj @ file:{uri_slash_prefix}{normalized_path}", "dep1"]
11981198

11991199
def test_project_dependencies_context_formatting(
12001200
self, temp_dir, isolated_data_dir, platform, temp_application, uri_slash_prefix
@@ -1244,7 +1244,7 @@ def test_project_dependencies_context_formatting(
12441244
)
12451245

12461246
normalized_parent_path = str(temp_dir.parent).replace("\\", "/")
1247-
expected_dep = f"sibling-project@ file:{uri_slash_prefix}{normalized_parent_path}/sibling-project"
1247+
expected_dep = f"sibling-project @ file:{uri_slash_prefix}{normalized_parent_path}/sibling-project"
12481248

12491249
# Verify the dependency was formatted correctly
12501250
assert expected_dep in environment.dependencies

tests/helpers/templates/licenses/__init__.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,18 @@
194194
195195
Copyright (c) <year> <copyright holders>
196196
197-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
198-
199-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
200-
201-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
197+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
198+
associated documentation files (the "Software"), to deal in the Software without restriction, including
199+
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
200+
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
201+
following conditions:
202+
203+
The above copyright notice and this permission notice shall be included in all copies or substantial
204+
portions of the Software.
205+
206+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
207+
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
208+
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
209+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
210+
USE OR OTHER DEALINGS IN THE SOFTWARE.
202211
"""

0 commit comments

Comments
 (0)