Skip to content

Commit 0ebfd63

Browse files
radoeringabn
authored andcommitted
chore: update json fixtures and improve generate script so that it produces the same results on Linux and Windows
1 parent 6f6fd70 commit 0ebfd63

File tree

47 files changed

+95
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+95
-2
lines changed

tests/repositories/fixtures/pypi.org/generate.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def generate_distribution_hashes_fixture(files: list[ReleaseFileMetadata]) -> No
159159
)
160160

161161
fixture_py.write_text(
162-
f"""# this file is generated by {Path(__file__).relative_to(FIXTURE_PATH.parent.parent)}
162+
f"""# this file is generated by {Path(__file__).relative_to(FIXTURE_PATH.parent.parent).as_posix()}
163163
from __future__ import annotations
164164
165165
import dataclasses
@@ -294,9 +294,10 @@ def process_metadata_file(self, link: Link) -> None:
294294
metadata["description"], ""
295295
)
296296

297+
kwargs = {"newline": "\n"} if sys.version_info >= (3, 10) else {}
297298
FIXTURE_PATH_REPOSITORIES_PYPI.joinpath(
298299
"metadata", f"{link.filename}.metadata"
299-
).write_text(content, encoding="utf-8")
300+
).write_text(content, encoding="utf-8", **kwargs)
300301

301302
def copy_as_is(self, link: Link) -> ReleaseFileMetadata:
302303
dst = FIXTURE_PATH_REPOSITORIES_PYPI / "dists" / link.filename

tests/repositories/fixtures/pypi.org/json/attrs/17.4.0.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
"home_page": "http://www.attrs.org/",
3434
"keywords": "class,attribute,boilerplate",
3535
"license": "MIT",
36+
"license_expression": null,
37+
"license_files": null,
3638
"maintainer": "",
3739
"maintainer_email": "",
3840
"name": "attrs",

tests/repositories/fixtures/pypi.org/json/black/19.10b0.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
"home_page": "https://github.com/psf/black",
3131
"keywords": "automation formatter yapf autopep8 pyfmt gofmt rustfmt",
3232
"license": "MIT",
33+
"license_expression": null,
34+
"license_files": null,
3335
"maintainer": "",
3436
"maintainer_email": "",
3537
"name": "black",

tests/repositories/fixtures/pypi.org/json/black/21.11b0.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
"home_page": "https://github.com/psf/black",
3333
"keywords": "automation formatter yapf autopep8 pyfmt gofmt rustfmt",
3434
"license": "MIT",
35+
"license_expression": null,
36+
"license_files": null,
3537
"maintainer": "",
3638
"maintainer_email": "",
3739
"name": "black",

tests/repositories/fixtures/pypi.org/json/cleo/1.0.0a5.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
"home_page": "https://github.com/python-poetry/cleo",
2525
"keywords": "cli,commands",
2626
"license": "MIT",
27+
"license_expression": null,
28+
"license_files": null,
2729
"maintainer": "",
2830
"maintainer_email": "",
2931
"name": "cleo",

tests/repositories/fixtures/pypi.org/json/clikit/0.2.4.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
"home_page": "https://github.com/sdispater/clikit",
2727
"keywords": "packaging,dependency,poetry",
2828
"license": "MIT",
29+
"license_expression": null,
30+
"license_files": null,
2931
"maintainer": "Sébastien Eustace",
3032
"maintainer_email": "sebastien@eustace.io",
3133
"name": "clikit",

tests/repositories/fixtures/pypi.org/json/colorama/0.3.9.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
"home_page": "https://github.com/tartley/colorama",
3535
"keywords": "color colour terminal text ansi windows crossplatform xplatform",
3636
"license": "BSD",
37+
"license_expression": null,
38+
"license_files": null,
3739
"maintainer": null,
3840
"maintainer_email": null,
3941
"name": "colorama",

tests/repositories/fixtures/pypi.org/json/discord-py/2.0.0.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
"home_page": "https://github.com/Rapptz/discord.py",
3232
"keywords": "",
3333
"license": "MIT",
34+
"license_expression": null,
35+
"license_files": null,
3436
"maintainer": "",
3537
"maintainer_email": "",
3638
"name": "discord.py",

tests/repositories/fixtures/pypi.org/json/filecache/0.81.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
"home_page": "https://github.com/ubershmekel/filecache",
2727
"keywords": "",
2828
"license": "",
29+
"license_expression": null,
30+
"license_files": null,
2931
"maintainer": "",
3032
"maintainer_email": "",
3133
"name": "filecache",

tests/repositories/fixtures/pypi.org/json/funcsigs/1.0.2.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
"home_page": "http://funcsigs.readthedocs.org",
3434
"keywords": null,
3535
"license": "ASL",
36+
"license_expression": null,
37+
"license_files": null,
3638
"maintainer": null,
3739
"maintainer_email": null,
3840
"name": "funcsigs",

0 commit comments

Comments
 (0)