Skip to content

Commit

Permalink
chore: update json fixtures and improve generate script so that it pr…
Browse files Browse the repository at this point in the history
…oduces the same results on Linux and Windows
  • Loading branch information
radoering committed Nov 15, 2024
1 parent 6f6fd70 commit 8b8c161
Show file tree
Hide file tree
Showing 47 changed files with 95 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/repositories/fixtures/pypi.org/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def generate_distribution_hashes_fixture(files: list[ReleaseFileMetadata]) -> No
)

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

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

def copy_as_is(self, link: Link) -> ReleaseFileMetadata:
dst = FIXTURE_PATH_REPOSITORIES_PYPI / "dists" / link.filename
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/attrs/17.4.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
"home_page": "http://www.attrs.org/",
"keywords": "class,attribute,boilerplate",
"license": "MIT",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "attrs",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/black/19.10b0.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"home_page": "https://github.com/psf/black",
"keywords": "automation formatter yapf autopep8 pyfmt gofmt rustfmt",
"license": "MIT",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "black",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/black/21.11b0.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
"home_page": "https://github.com/psf/black",
"keywords": "automation formatter yapf autopep8 pyfmt gofmt rustfmt",
"license": "MIT",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "black",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/cleo/1.0.0a5.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"home_page": "https://github.com/python-poetry/cleo",
"keywords": "cli,commands",
"license": "MIT",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "cleo",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/clikit/0.2.4.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"home_page": "https://github.com/sdispater/clikit",
"keywords": "packaging,dependency,poetry",
"license": "MIT",
"license_expression": null,
"license_files": null,
"maintainer": "Sébastien Eustace",
"maintainer_email": "[email protected]",
"name": "clikit",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/colorama/0.3.9.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
"home_page": "https://github.com/tartley/colorama",
"keywords": "color colour terminal text ansi windows crossplatform xplatform",
"license": "BSD",
"license_expression": null,
"license_files": null,
"maintainer": null,
"maintainer_email": null,
"name": "colorama",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
"home_page": "https://github.com/Rapptz/discord.py",
"keywords": "",
"license": "MIT",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "discord.py",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/filecache/0.81.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"home_page": "https://github.com/ubershmekel/filecache",
"keywords": "",
"license": "",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "filecache",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/funcsigs/1.0.2.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
"home_page": "http://funcsigs.readthedocs.org",
"keywords": null,
"license": "ASL",
"license_expression": null,
"license_files": null,
"maintainer": null,
"maintainer_email": null,
"name": "funcsigs",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/futures/3.2.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"home_page": "https://github.com/agronholm/pythonfutures",
"keywords": "",
"license": "PSF",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "futures",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/hbmqtt/0.9.6.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
"home_page": "https://github.com/beerfactory/hbmqtt",
"keywords": "",
"license": "MIT",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "hbmqtt",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"home_page": "http://importlib-metadata.readthedocs.io/",
"keywords": "",
"license": "Apache Software License",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "importlib-metadata",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
"home_page": "http://ipython.org",
"keywords": "Interactive,Interpreter,Shell,Parallel,Distributed,Web-based computing,Qt console,Embedding",
"license": "BSD",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "ipython",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/ipython/5.7.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
"home_page": "https://ipython.org",
"keywords": "Interactive,Interpreter,Shell,Embedding",
"license": "BSD",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "ipython",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/ipython/7.5.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"home_page": "https://ipython.org",
"keywords": "Interactive,Interpreter,Shell,Embedding",
"license": "BSD",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "ipython",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/isort/4.3.4.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
"home_page": "https://github.com/timothycrosley/isort",
"keywords": "Refactor",
"license": "MIT",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "isort",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/jupyter/1.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"home_page": "http://jupyter.org",
"keywords": null,
"license": "BSD",
"license_expression": null,
"license_files": null,
"maintainer": null,
"maintainer_email": null,
"name": "jupyter",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"home_page": "https://github.com/erikrose/more-itertools",
"keywords": "itertools,iterator,iteration,filter,peek,peekable,collate,chunk,chunked",
"license": "MIT",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "more-itertools",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/pastel/0.1.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
"home_page": "https://github.com/sdispater/pastel",
"keywords": "",
"license": "MIT",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "pastel",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/pluggy/0.6.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
"home_page": "https://github.com/pytest-dev/pluggy",
"keywords": "",
"license": "MIT license",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "pluggy",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
"home_page": "https://github.com/python-poetry/poetry-core",
"keywords": "packaging,dependency,poetry",
"license": "MIT",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "poetry-core",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/py/1.5.3.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"home_page": "http://py.readthedocs.io/",
"keywords": "",
"license": "MIT license",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "py",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/pylev/1.3.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"home_page": "http://github.com/toastdriven/pylev",
"keywords": null,
"license": "UNKNOWN",
"license_expression": null,
"license_files": null,
"maintainer": null,
"maintainer_email": null,
"name": "pylev",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/pytest/3.5.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
"home_page": "http://pytest.org",
"keywords": "test unittest",
"license": "MIT license",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "pytest",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/pytest/3.5.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
"home_page": "http://pytest.org",
"keywords": "test unittest",
"license": "MIT license",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "pytest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
"home_page": "https://github.com/palantir/python-language-server",
"keywords": "",
"license": "",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "python-language-server",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/pyyaml/3.13.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"home_page": "http://pyyaml.org/wiki/PyYAML",
"keywords": "",
"license": "MIT",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "PyYAML",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
"home_page": "http://python-requests.org",
"keywords": "",
"license": "Apache 2.0",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "requests",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
"home_page": "http://python-requests.org",
"keywords": "",
"license": "Apache 2.0",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "requests",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
"home_page": "http://python-requests.org",
"keywords": "",
"license": "Apache 2.0",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "requests",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
"home_page": "http://python-requests.org",
"keywords": "",
"license": "Apache 2.0",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "requests",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
"home_page": "http://python-requests.org",
"keywords": "",
"license": "Apache 2.0",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "requests",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
"home_page": "http://python-requests.org",
"keywords": "",
"license": "Apache 2.0",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "requests",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
"home_page": "https://github.com/pypa/setuptools",
"keywords": "CPAN PyPI distutils eggs package management",
"license": "",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "setuptools",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
"home_page": "https://github.com/pypa/setuptools",
"keywords": "CPAN PyPI distutils eggs package management",
"license": "",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "setuptools",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/six/1.11.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"home_page": "http://pypi.python.org/pypi/six/",
"keywords": "",
"license": "MIT",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "six",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
"home_page": "http://www.sqlalchemy.org",
"keywords": "",
"license": "MIT License",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "SQLAlchemy",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/toga/0.3.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
"home_page": "https://beeware.org/project/projects/libraries/toga/",
"keywords": "gui,widget,cross-platform,desktop,mobile,web,macOS,cocoa,iOS,android,windows,winforms,linux,gtk",
"license": "New BSD",
"license_expression": null,
"license_files": null,
"maintainer": "BeeWare Team",
"maintainer_email": "[email protected]",
"name": "toga",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/toga/0.3.0dev1.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"home_page": "http://pybee.org/toga",
"keywords": "",
"license": "New BSD",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "toga",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/toga/0.3.0dev2.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"home_page": "http://pybee.org/toga",
"keywords": "",
"license": "New BSD",
"license_expression": null,
"license_files": null,
"maintainer": "",
"maintainer_email": "",
"name": "toga",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/toga/0.4.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
"home_page": "https://beeware.org/project/projects/libraries/toga/",
"keywords": "gui,widget,cross-platform,desktop,mobile,web,macOS,cocoa,iOS,android,windows,winforms,linux,freeBSD,gtk",
"license": "New BSD",
"license_expression": null,
"license_files": null,
"maintainer": "BeeWare Team",
"maintainer_email": "[email protected]",
"name": "toga",
Expand Down
2 changes: 2 additions & 0 deletions tests/repositories/fixtures/pypi.org/json/tomlkit/0.5.2.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"home_page": "https://github.com/sdispater/tomlkit",
"keywords": "",
"license": "MIT",
"license_expression": null,
"license_files": null,
"maintainer": "Sébastien Eustace",
"maintainer_email": "[email protected]",
"name": "tomlkit",
Expand Down
Loading

0 comments on commit 8b8c161

Please sign in to comment.