diff --git a/pyproject.toml b/pyproject.toml index 72c31dfbea7..1d3d70c1a65 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,7 +94,10 @@ build-backend = "poetry.core.masonry.api" extend-exclude = [ "docs/*", # External to the project's coding standards - "tests/**/fixtures/*", + "tests/fixtures/git/*", + "tests/fixtures/project_with_setup*/*", + "tests/masonry/builders/fixtures/pep_561_stub_only*/*", + "tests/utils/fixtures/setups/*", ] fix = true line-length = 88 diff --git a/src/poetry/repositories/legacy_repository.py b/src/poetry/repositories/legacy_repository.py index a6557eeb7d8..a6edf66729c 100644 --- a/src/poetry/repositories/legacy_repository.py +++ b/src/poetry/repositories/legacy_repository.py @@ -1,5 +1,7 @@ from __future__ import annotations +from contextlib import suppress +from functools import cached_property from typing import TYPE_CHECKING from typing import Any @@ -11,6 +13,7 @@ from poetry.repositories.exceptions import PackageNotFound from poetry.repositories.http_repository import HTTPRepository from poetry.repositories.link_sources.html import SimpleRepositoryPage +from poetry.repositories.link_sources.html import SimpleRepositoryRootPage if TYPE_CHECKING: @@ -36,18 +39,6 @@ def __init__( super().__init__(name, url.rstrip("/"), config, disable_cache, pool_size) - @property - def packages(self) -> list[Package]: - # LegacyRepository._packages is not populated and other implementations - # implicitly rely on this (e.g. Pool.search via - # LegacyRepository.search). To avoid special-casing Pool or changing - # behavior, we stub and return an empty list. - # - # TODO: Rethinking search behaviour and design. - # Ref: https://github.com/python-poetry/poetry/issues/2446 and - # https://github.com/python-poetry/poetry/pull/6669#discussion_r990874908. - return [] - def package( self, name: str, version: Version, extras: list[str] | None = None ) -> Package: @@ -135,7 +126,29 @@ def _get_release_info( ) def _get_page(self, name: NormalizedName) -> SimpleRepositoryPage: - response = self._get_response(f"/{name}/") - if not response: + if not (response := self._get_response(f"/{name}/")): raise PackageNotFound(f"Package [{name}] not found.") return SimpleRepositoryPage(response.url, response.text) + + @cached_property + def root_page(self) -> SimpleRepositoryRootPage: + if not (response := self._get_response("/")): + self._log( + f"Unable to retrieve package listing from package source {self.name}", + level="error", + ) + return SimpleRepositoryRootPage() + + return SimpleRepositoryRootPage(response.text) + + def search(self, query: str) -> list[Package]: + results: list[Package] = [] + + for candidate in self.root_page.search(query): + with suppress(PackageNotFound): + page = self.get_page(candidate) + + for package in page.packages: + results.append(package) + + return results diff --git a/src/poetry/repositories/link_sources/html.py b/src/poetry/repositories/link_sources/html.py index 7dfbd19e061..3128b15fa1b 100644 --- a/src/poetry/repositories/link_sources/html.py +++ b/src/poetry/repositories/link_sources/html.py @@ -68,6 +68,40 @@ def _link_cache(self) -> LinkCache: return links +class SimpleRepositoryRootPage: + """ + This class represents the parsed content of a "simple" repository's root page. This follows the + specification laid out in PEP 503. + + See: https://peps.python.org/pep-0503/ + """ + + def __init__(self, content: str | None = None) -> None: + parser = HTMLPageParser() + parser.feed(content or "") + self._parsed = parser.anchors + + def search(self, query: str) -> list[str]: + results: list[str] = [] + + for anchor in self._parsed: + href = anchor.get("href") + if href and query in href: + results.append(href.rstrip("/")) + + return results + + @cached_property + def package_names(self) -> list[str]: + results: list[str] = [] + + for anchor in self._parsed: + if href := anchor.get("href"): + results.append(href.rstrip("/")) + + return results + + class SimpleRepositoryPage(HTMLPage): def __init__(self, url: str, content: str) -> None: if not url.endswith("/"): diff --git a/tests/conftest.py b/tests/conftest.py index 70ff1545cf8..119f38cfe5b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -11,6 +11,7 @@ from pathlib import Path from typing import TYPE_CHECKING from typing import Any +from typing import Iterator import httpretty import keyring @@ -62,6 +63,11 @@ from tests.types import SetProjectContext +pytest_plugins = [ + "tests.repositories.fixtures", +] + + def pytest_addoption(parser: Parser) -> None: parser.addoption( "--integration", @@ -279,7 +285,6 @@ def download_mock(mocker: MockerFixture) -> None: # Patch download to not download anything but to just copy from fixtures mocker.patch("poetry.utils.helpers.download_file", new=mock_download) mocker.patch("poetry.packages.direct_origin.download_file", new=mock_download) - mocker.patch("poetry.repositories.http_repository.download_file", new=mock_download) @pytest.fixture(autouse=True) @@ -323,7 +328,7 @@ def git_mock(mocker: MockerFixture) -> None: @pytest.fixture def http() -> Iterator[type[httpretty.httpretty]]: httpretty.reset() - with httpretty.enabled(allow_net_connect=False): + with httpretty.enabled(allow_net_connect=False, verbose=True): yield httpretty @@ -532,6 +537,12 @@ def httpretty_windows_mock_urllib3_wait_for_socket(mocker: MockerFixture) -> Non mocker.patch("urllib3.util.wait.select_wait_for_socket", returns=True) +@pytest.fixture +def disable_http_status_force_list(mocker: MockerFixture) -> Iterator[None]: + mocker.patch("poetry.utils.authenticator.STATUS_FORCELIST", []) + yield + + @pytest.fixture(autouse=True) def tmp_working_directory(tmp_path: Path) -> Iterator[Path]: with switch_working_directory(tmp_path): diff --git a/tests/console/commands/test_search.py b/tests/console/commands/test_search.py index 9255fa2f4eb..f13c4193266 100644 --- a/tests/console/commands/test_search.py +++ b/tests/console/commands/test_search.py @@ -19,12 +19,6 @@ ) -@pytest.fixture(autouse=True) -def mock_search_http_response(http: type[httpretty.httpretty]) -> None: - with FIXTURES_DIRECTORY.joinpath("search.html").open(encoding="utf-8") as f: - http.register_uri("GET", "https://pypi.org/search", f.read()) - - @pytest.fixture def tester(command_tester_factory: CommandTesterFactory) -> CommandTester: return command_tester_factory("search") diff --git a/tests/helpers.py b/tests/helpers.py index faf030e45d5..a1a63520b6f 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -43,6 +43,11 @@ from tests.types import HTTPrettyResponse FIXTURE_PATH = Path(__file__).parent / "fixtures" +FIXTURE_PATH_INSTALLATION = Path(__file__).parent / "installation" / "fixtures" +FIXTURE_PATH_DISTRIBUTIONS = FIXTURE_PATH / "distributions" +FIXTURE_PATH_REPOSITORIES = Path(__file__).parent / "repositories" / "fixtures" +FIXTURE_PATH_REPOSITORIES_LEGACY = FIXTURE_PATH_REPOSITORIES / "legacy" +FIXTURE_PATH_REPOSITORIES_PYPI = FIXTURE_PATH_REPOSITORIES / "pypi.org" # Used as a mock for latest git revision. MOCK_DEFAULT_GIT_REVISION = "9cf87a285a2d3fbb0b9fa621997b3acc3631ed24" diff --git a/tests/inspection/test_lazy_wheel.py b/tests/inspection/test_lazy_wheel.py index db149fb31c4..1a71cf0b441 100644 --- a/tests/inspection/test_lazy_wheel.py +++ b/tests/inspection/test_lazy_wheel.py @@ -32,6 +32,7 @@ from tests.types import HTTPPrettyRequestCallbackWrapper from tests.types import HTTPrettyRequestCallback from tests.types import HTTPrettyResponse + from tests.types import PackageDistributionLookup class RequestCallbackFactory(Protocol): def __call__( @@ -110,7 +111,10 @@ def build_partial_response( @pytest.fixture -def handle_request_factory(fixture_dir: FixtureDirGetter) -> RequestCallbackFactory: +def handle_request_factory( + fixture_dir: FixtureDirGetter, + package_distribution_lookup: PackageDistributionLookup, +) -> RequestCallbackFactory: def _factory( *, accept_ranges: str | None = "bytes", @@ -122,17 +126,12 @@ def handle_request( ) -> HTTPrettyResponse: name = Path(urlparse(uri).path).name - wheel = Path(__file__).parents[1] / ( - "repositories/fixtures/pypi.org/dists/" + name + wheel = package_distribution_lookup(name) or package_distribution_lookup( + "demo-0.1.0-py2.py3-none-any.whl" ) - if not wheel.exists(): - wheel = fixture_dir("distributions") / name - - if not wheel.exists(): - wheel = ( - fixture_dir("distributions") / "demo-0.1.0-py2.py3-none-any.whl" - ) + if not wheel: + return 404, response_headers, b"Not Found" wheel_bytes = wheel.read_bytes() diff --git a/tests/installation/conftest.py b/tests/installation/conftest.py index c19a17f6f88..e69de29bb2d 100644 --- a/tests/installation/conftest.py +++ b/tests/installation/conftest.py @@ -1,45 +0,0 @@ -from __future__ import annotations - -import re - -from pathlib import Path -from typing import TYPE_CHECKING -from typing import Any -from urllib.parse import urlparse - -import pytest - - -if TYPE_CHECKING: - from httpretty import httpretty - from httpretty.core import HTTPrettyRequest - - from tests.types import FixtureDirGetter - - -@pytest.fixture -def mock_file_downloads(http: type[httpretty], fixture_dir: FixtureDirGetter) -> None: - def callback( - request: HTTPrettyRequest, uri: str, headers: dict[str, Any] - ) -> list[int | dict[str, Any] | bytes]: - name = Path(urlparse(uri).path).name - - fixture = Path(__file__).parent.parent.joinpath( - "repositories/fixtures/pypi.org/dists/" + name - ) - - if not fixture.exists(): - fixture = fixture_dir("distributions") / name - - if not fixture.exists(): - fixture = ( - fixture_dir("distributions") / "demo-0.1.0-py2.py3-none-any.whl" - ) - - return [200, headers, fixture.read_bytes()] - - http.register_uri( - http.GET, - re.compile("^https://files.pythonhosted.org/.*$"), - body=callback, - ) diff --git a/tests/installation/fixtures/old-lock.test b/tests/installation/fixtures/old-lock.test index 2e058c7f01d..c6b13e72f81 100644 --- a/tests/installation/fixtures/old-lock.test +++ b/tests/installation/fixtures/old-lock.test @@ -79,34 +79,34 @@ content-hash = "123456789" [metadata.files] attrs = [ - {file = "attrs-17.4.0-py2.py3-none-any.whl", hash = "sha256:a17a9573a6f475c99b551c0e0a812707ddda1ec9653bed04c13841404ed6f450"}, - {file = "attrs-17.4.0.tar.gz", hash = "sha256:1c7960ccfd6a005cd9f7ba884e6316b5e430a3f1a6c37c5f87d8b43f83b54ec9"}, + {file = "attrs-17.4.0-py2.py3-none-any.whl", hash = "sha256:d38e57f381e891928357c68e300d28d3d4dcddc50486d5f8dfaf743d40477619"}, + {file = "attrs-17.4.0.tar.gz", hash = "sha256:eb7536a1e6928190b3008c5b350bdf9850d619fff212341cd096f87a27a5e564"}, ] colorama = [ - {file = "colorama-0.3.9-py2.py3-none-any.whl", hash = "sha256:463f8483208e921368c9f306094eb6f725c6ca42b0f97e313cb5d5512459feda"}, - {file = "colorama-0.3.9.tar.gz", hash = "sha256:48eb22f4f8461b1df5734a074b57042430fb06e1d61bd1e11b078c0fe6d7a1f1"}, + {file = "colorama-0.3.9-py2.py3-none-any.whl", hash = "sha256:5b632359f1ed2b7676a869812ba0edaacb99be04679b29eb56c07a5e137ab5a2"}, + {file = "colorama-0.3.9.tar.gz", hash = "sha256:4c5a15209723ce1330a5c193465fe221098f761e9640d823a2ce7c03f983137f"}, ] funcsigs = [ - {file = "funcsigs-1.0.2-py2.py3-none-any.whl", hash = "sha256:330cc27ccbf7f1e992e69fef78261dc7c6569012cf397db8d3de0234e6c937ca"}, - {file = "funcsigs-1.0.2.tar.gz", hash = "sha256:a7bb0f2cf3a3fd1ab2732cb49eba4252c2af4240442415b4abce3b87022a8f50"}, + {file = "funcsigs-1.0.2-py2.py3-none-any.whl", hash = "sha256:510ab97424949e726b4b44294018e90142c9aadf8e737cf3a125b4cffed42e79"}, + {file = "funcsigs-1.0.2.tar.gz", hash = "sha256:c55716fcd1228645c214b44568d1fb9af2e28668a9c58e72a17a89a75d24ecd6"}, ] more-itertools = [ - {file = "more-itertools-4.1.0.tar.gz", hash = "sha256:c9ce7eccdcb901a2c75d326ea134e0886abfbea5f93e91cc95de9507c0816c44"}, - {file = "more_itertools-4.1.0-py2-none-any.whl", hash = "sha256:11a625025954c20145b37ff6309cd54e39ca94f72f6bb9576d1195db6fa2442e"}, - {file = "more_itertools-4.1.0-py3-none-any.whl", hash = "sha256:0dd8f72eeab0d2c3bd489025bb2f6a1b8342f9b198f6fc37b52d15cfa4531fea"}, + {file = "more-itertools-4.1.0.tar.gz", hash = "sha256:bab2dc6f4be8f9a4a72177842c5283e2dff57c167439a03e3d8d901e854f0f2e"}, + {file = "more_itertools-4.1.0-py2-none-any.whl", hash = "sha256:5dd7dfd88d2fdaea446da478ffef8d7151fdf26ee92ac7ed7b14e8d71efe4b62"}, + {file = "more_itertools-4.1.0-py3-none-any.whl", hash = "sha256:29b1e1661aaa56875ce090fa219fa84dfc13daecb52cd4fae321f6f57b419ec4"}, ] pluggy = [ - {file = "pluggy-0.6.0.tar.gz", hash = "sha256:7f8ae7f5bdf75671a718d2daf0a64b7885f74510bcd98b1a0bb420eb9a9d0cff"}, + {file = "pluggy-0.6.0.tar.gz", hash = "sha256:a982e208d054867661d27c6d2a86b17ba05fbb6b1bdc01f42660732dd107f865"}, ] py = [ - {file = "py-1.5.3-py2.py3-none-any.whl", hash = "sha256:983f77f3331356039fdd792e9220b7b8ee1aa6bd2b25f567a963ff1de5a64f6a"}, - {file = "py-1.5.3.tar.gz", hash = "sha256:29c9fab495d7528e80ba1e343b958684f4ace687327e6f789a94bf3d1915f881"}, + {file = "py-1.5.3-py2.py3-none-any.whl", hash = "sha256:43ee6c7f95e0ec6a906de49906b79d138d89728fff17109d49f086abc2fdd985"}, + {file = "py-1.5.3.tar.gz", hash = "sha256:2df2c513c3af11de15f58189ba5539ddc4768c6f33816dc5c03950c8bd6180fa"}, ] pytest = [ - {file = "pytest-3.5.0-py2.py3-none-any.whl", hash = "sha256:6266f87ab64692112e5477eba395cfedda53b1933ccd29478e671e73b420c19c"}, - {file = "pytest-3.5.0.tar.gz", hash = "sha256:fae491d1874f199537fd5872b5e1f0e74a009b979df9d53d1553fd03da1703e1"}, + {file = "pytest-3.5.0-py2.py3-none-any.whl", hash = "sha256:28e4d9c2ae3196d74805c2eba24f350ae4c791a5b9b397c79b41506a48dc64ca"}, + {file = "pytest-3.5.0.tar.gz", hash = "sha256:677b1d6decd29c041fe64276f29f79fbe66e40c59e445eb251366b4a8ab8bf68"}, ] six = [ - {file = "six-1.11.0-py2.py3-none-any.whl", hash = "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb"}, - {file = "six-1.11.0.tar.gz", hash = "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9"}, + {file = "six-1.11.0-py2.py3-none-any.whl", hash = "sha256:112f5b46e6aa106db3e4e2494a03694c938f41c4c4535edbdfc816c2e0cb50f2"}, + {file = "six-1.11.0.tar.gz", hash = "sha256:268a4ccb159c1a2d2c79336b02e75058387b0cdbb4cea2f07846a758f48a356d"}, ] diff --git a/tests/installation/fixtures/with-pypi-repository.test b/tests/installation/fixtures/with-pypi-repository.test index 3ada7ffc673..2309188b551 100644 --- a/tests/installation/fixtures/with-pypi-repository.test +++ b/tests/installation/fixtures/with-pypi-repository.test @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.5.0.dev0 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.9.0.dev0 and should not be changed by hand. [[package]] name = "attrs" @@ -7,8 +7,8 @@ description = "Classes Without Boilerplate" optional = false python-versions = "*" files = [ - {file = "attrs-17.4.0-py2.py3-none-any.whl", hash = "sha256:a17a9573a6f475c99b551c0e0a812707ddda1ec9653bed04c13841404ed6f450"}, - {file = "attrs-17.4.0.tar.gz", hash = "sha256:1c7960ccfd6a005cd9f7ba884e6316b5e430a3f1a6c37c5f87d8b43f83b54ec9"}, + {file = "attrs-17.4.0-py2.py3-none-any.whl", hash = "sha256:d38e57f381e891928357c68e300d28d3d4dcddc50486d5f8dfaf743d40477619"}, + {file = "attrs-17.4.0.tar.gz", hash = "sha256:eb7536a1e6928190b3008c5b350bdf9850d619fff212341cd096f87a27a5e564"}, ] [package.extras] @@ -23,8 +23,8 @@ description = "Cross-platform colored terminal text." optional = false python-versions = "*" files = [ - {file = "colorama-0.3.9-py2.py3-none-any.whl", hash = "sha256:463f8483208e921368c9f306094eb6f725c6ca42b0f97e313cb5d5512459feda"}, - {file = "colorama-0.3.9.tar.gz", hash = "sha256:48eb22f4f8461b1df5734a074b57042430fb06e1d61bd1e11b078c0fe6d7a1f1"}, + {file = "colorama-0.3.9-py2.py3-none-any.whl", hash = "sha256:5b632359f1ed2b7676a869812ba0edaacb99be04679b29eb56c07a5e137ab5a2"}, + {file = "colorama-0.3.9.tar.gz", hash = "sha256:4c5a15209723ce1330a5c193465fe221098f761e9640d823a2ce7c03f983137f"}, ] [[package]] @@ -34,9 +34,9 @@ description = "More routines for operating on iterables, beyond itertools" optional = false python-versions = "*" files = [ - {file = "more-itertools-4.1.0.tar.gz", hash = "sha256:c9ce7eccdcb901a2c75d326ea134e0886abfbea5f93e91cc95de9507c0816c44"}, - {file = "more_itertools-4.1.0-py2-none-any.whl", hash = "sha256:11a625025954c20145b37ff6309cd54e39ca94f72f6bb9576d1195db6fa2442e"}, - {file = "more_itertools-4.1.0-py3-none-any.whl", hash = "sha256:0dd8f72eeab0d2c3bd489025bb2f6a1b8342f9b198f6fc37b52d15cfa4531fea"}, + {file = "more-itertools-4.1.0.tar.gz", hash = "sha256:bab2dc6f4be8f9a4a72177842c5283e2dff57c167439a03e3d8d901e854f0f2e"}, + {file = "more_itertools-4.1.0-py2-none-any.whl", hash = "sha256:5dd7dfd88d2fdaea446da478ffef8d7151fdf26ee92ac7ed7b14e8d71efe4b62"}, + {file = "more_itertools-4.1.0-py3-none-any.whl", hash = "sha256:29b1e1661aaa56875ce090fa219fa84dfc13daecb52cd4fae321f6f57b419ec4"}, ] [package.dependencies] @@ -49,7 +49,7 @@ description = "plugin and hook calling mechanisms for python" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ - {file = "pluggy-0.6.0.tar.gz", hash = "sha256:7f8ae7f5bdf75671a718d2daf0a64b7885f74510bcd98b1a0bb420eb9a9d0cff"}, + {file = "pluggy-0.6.0.tar.gz", hash = "sha256:a982e208d054867661d27c6d2a86b17ba05fbb6b1bdc01f42660732dd107f865"}, ] [[package]] @@ -59,8 +59,8 @@ description = "library with cross-python path, ini-parsing, io, code, log facili optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ - {file = "py-1.5.3-py2.py3-none-any.whl", hash = "sha256:983f77f3331356039fdd792e9220b7b8ee1aa6bd2b25f567a963ff1de5a64f6a"}, - {file = "py-1.5.3.tar.gz", hash = "sha256:29c9fab495d7528e80ba1e343b958684f4ace687327e6f789a94bf3d1915f881"}, + {file = "py-1.5.3-py2.py3-none-any.whl", hash = "sha256:43ee6c7f95e0ec6a906de49906b79d138d89728fff17109d49f086abc2fdd985"}, + {file = "py-1.5.3.tar.gz", hash = "sha256:2df2c513c3af11de15f58189ba5539ddc4768c6f33816dc5c03950c8bd6180fa"}, ] [[package]] @@ -70,8 +70,8 @@ description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ - {file = "pytest-3.5.0-py2.py3-none-any.whl", hash = "sha256:6266f87ab64692112e5477eba395cfedda53b1933ccd29478e671e73b420c19c"}, - {file = "pytest-3.5.0.tar.gz", hash = "sha256:fae491d1874f199537fd5872b5e1f0e74a009b979df9d53d1553fd03da1703e1"}, + {file = "pytest-3.5.0-py2.py3-none-any.whl", hash = "sha256:28e4d9c2ae3196d74805c2eba24f350ae4c791a5b9b397c79b41506a48dc64ca"}, + {file = "pytest-3.5.0.tar.gz", hash = "sha256:677b1d6decd29c041fe64276f29f79fbe66e40c59e445eb251366b4a8ab8bf68"}, ] [package.dependencies] @@ -91,7 +91,7 @@ optional = false python-versions = ">=3.7" files = [ {file = "setuptools-67.6.1-py3-none-any.whl", hash = "sha256:e728ca814a823bf7bf60162daf9db95b93d532948c4c0bea762ce62f60189078"}, - {file = "setuptools-67.6.1.tar.gz", hash = "sha256:257de92a9d50a60b8e22abfcbb771571fde0dbf3ec234463212027a4eeecbe9a"}, + {file = "setuptools-67.6.1.tar.gz", hash = "sha256:a737d365c957dd3fced9ddd246118e95dce7a62c3dc49f37e7fdd9e93475d785"}, ] [package.extras] @@ -106,8 +106,8 @@ description = "Python 2 and 3 compatibility utilities" optional = false python-versions = "*" files = [ - {file = "six-1.11.0-py2.py3-none-any.whl", hash = "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb"}, - {file = "six-1.11.0.tar.gz", hash = "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9"}, + {file = "six-1.11.0-py2.py3-none-any.whl", hash = "sha256:112f5b46e6aa106db3e4e2494a03694c938f41c4c4535edbdfc816c2e0cb50f2"}, + {file = "six-1.11.0.tar.gz", hash = "sha256:268a4ccb159c1a2d2c79336b02e75058387b0cdbb4cea2f07846a758f48a356d"}, ] [metadata] diff --git a/tests/installation/test_chef.py b/tests/installation/test_chef.py index 1df347982d6..2925d387935 100644 --- a/tests/installation/test_chef.py +++ b/tests/installation/test_chef.py @@ -23,7 +23,6 @@ from poetry.repositories import RepositoryPool from poetry.utils.env import EnvManager from poetry.utils.env import ephemeral_environment -from tests.repositories.test_pypi_repository import MockRepository if TYPE_CHECKING: @@ -31,16 +30,17 @@ from pytest_mock import MockerFixture + from poetry.repositories.pypi_repository import PyPiRepository from poetry.utils.cache import ArtifactCache from tests.conftest import Config from tests.types import FixtureDirGetter @pytest.fixture() -def pool() -> RepositoryPool: +def pool(pypi_repository: PyPiRepository) -> RepositoryPool: pool = RepositoryPool() - pool.add_repository(MockRepository()) + pool.add_repository(pypi_repository) return pool @@ -50,9 +50,7 @@ def setup(mocker: MockerFixture, pool: RepositoryPool) -> None: mocker.patch.object(Factory, "create_pool", return_value=pool) -def test_isolated_env_install_success( - pool: RepositoryPool, mock_file_downloads: None -) -> None: +def test_isolated_env_install_success(pool: RepositoryPool) -> None: with ephemeral_environment(Path(sys.executable)) as venv: env = IsolatedEnv(venv, pool) assert "poetry-core" not in venv.run("pip", "freeze") @@ -92,7 +90,6 @@ def test_prepare_sdist( config_cache_dir: Path, artifact_cache: ArtifactCache, fixture_dir: FixtureDirGetter, - mock_file_downloads: None, ) -> None: chef = Chef( artifact_cache, EnvManager.get_system_env(), Factory.create_pool(config) @@ -111,7 +108,6 @@ def test_prepare_directory( config_cache_dir: Path, artifact_cache: ArtifactCache, fixture_dir: FixtureDirGetter, - mock_file_downloads: None, ) -> None: chef = Chef( artifact_cache, EnvManager.get_system_env(), Factory.create_pool(config) @@ -155,7 +151,6 @@ def test_prepare_directory_editable( config_cache_dir: Path, artifact_cache: ArtifactCache, fixture_dir: FixtureDirGetter, - mock_file_downloads: None, ) -> None: chef = Chef( artifact_cache, EnvManager.get_system_env(), Factory.create_pool(config) diff --git a/tests/installation/test_chooser.py b/tests/installation/test_chooser.py index f74400dc489..dd0aa7baa97 100644 --- a/tests/installation/test_chooser.py +++ b/tests/installation/test_chooser.py @@ -1,10 +1,7 @@ from __future__ import annotations -import re - from pathlib import Path from typing import TYPE_CHECKING -from typing import Any import pytest @@ -19,12 +16,9 @@ if TYPE_CHECKING: - import httpretty - - from httpretty.core import HTTPrettyRequest - from tests.conftest import Config - + from tests.types import DistributionHashGetter + from tests.types import SpecializedLegacyRepositoryMocker JSON_FIXTURES = ( Path(__file__).parent.parent / "repositories" / "fixtures" / "pypi.org" / "json" @@ -44,84 +38,16 @@ def env() -> MockEnv: @pytest.fixture() -def mock_pypi(http: type[httpretty.httpretty]) -> None: - def callback( - request: HTTPrettyRequest, uri: str, headers: dict[str, Any] - ) -> list[int | dict[str, Any] | str] | None: - parts = uri.rsplit("/") - - name = parts[-3] - version = parts[-2] - - fixture = JSON_FIXTURES / name / (version + ".json") - if not fixture.exists(): - fixture = JSON_FIXTURES / (name + ".json") - - if not fixture.exists(): - return None - - with fixture.open(encoding="utf-8") as f: - return [200, headers, f.read()] - - http.register_uri( - http.GET, - re.compile("^https://pypi.org/(.+?)/(.+?)/json$"), - body=callback, - ) - - -@pytest.fixture() -def mock_legacy(http: type[httpretty.httpretty]) -> None: - def callback( - request: HTTPrettyRequest, uri: str, headers: dict[str, Any] - ) -> list[int | dict[str, Any] | str]: - parts = uri.rsplit("/") - name = parts[-2] - - fixture = LEGACY_FIXTURES / (name + ".html") - - with fixture.open(encoding="utf-8") as f: - return [200, headers, f.read()] - - http.register_uri( - http.GET, - re.compile("^https://foo.bar/simple/(.+?)$"), - body=callback, - ) - - -@pytest.fixture() -def mock_legacy_partial_yank(http: type[httpretty.httpretty]) -> None: - def callback( - request: HTTPrettyRequest, uri: str, headers: dict[str, Any] - ) -> list[int | dict[str, Any] | str]: - parts = uri.rsplit("/") - name = parts[-2] - - fixture = LEGACY_FIXTURES / (name + "-partial-yank" + ".html") - - with fixture.open(encoding="utf-8") as f: - return [200, headers, f.read()] - - http.register_uri( - http.GET, - re.compile("^https://foo2.bar/simple/(.+?)$"), - body=callback, - ) - - -@pytest.fixture() -def pool() -> RepositoryPool: +def pool(legacy_repository: LegacyRepository) -> RepositoryPool: pool = RepositoryPool() pool.add_repository(PyPiRepository(disable_cache=True)) pool.add_repository( - LegacyRepository("foo", "https://foo.bar/simple/", disable_cache=True) + LegacyRepository("foo", "https://legacy.foo.bar/simple/", disable_cache=True) ) pool.add_repository( - LegacyRepository("foo2", "https://foo2.bar/simple/", disable_cache=True) + LegacyRepository("foo2", "https://legacy.foo2.bar/simple/", disable_cache=True) ) - return pool @@ -143,7 +69,7 @@ def check_chosen_link_filename( package.version.text, source_type="legacy", source_reference="foo", - source_url="https://foo.bar/simple/", + source_url="https://legacy.foo.bar/simple/", ) try: @@ -163,8 +89,6 @@ def check_chosen_link_filename( @pytest.mark.parametrize("source_type", ["", "legacy"]) def test_chooser_chooses_universal_wheel_link_if_available( env: MockEnv, - mock_pypi: None, - mock_legacy: None, source_type: str, pool: RepositoryPool, ) -> None: @@ -186,8 +110,6 @@ def test_chooser_chooses_universal_wheel_link_if_available( @pytest.mark.parametrize("source_type", ["", "legacy"]) def test_chooser_no_binary_policy( env: MockEnv, - mock_pypi: None, - mock_legacy: None, source_type: str, pool: RepositoryPool, policy: str, @@ -211,8 +133,6 @@ def test_chooser_no_binary_policy( @pytest.mark.parametrize("source_type", ["", "legacy"]) def test_chooser_only_binary_policy( env: MockEnv, - mock_pypi: None, - mock_legacy: None, source_type: str, pool: RepositoryPool, policy: str, @@ -240,8 +160,6 @@ def test_chooser_only_binary_policy( @pytest.mark.parametrize("source_type", ["", "legacy"]) def test_chooser_multiple_binary_policy( env: MockEnv, - mock_pypi: None, - mock_legacy: None, source_type: str, pool: RepositoryPool, no_binary: str, @@ -263,8 +181,6 @@ def test_chooser_multiple_binary_policy( @pytest.mark.parametrize("source_type", ["", "legacy"]) def test_chooser_chooses_specific_python_universal_wheel_link_if_available( env: MockEnv, - mock_pypi: None, - mock_legacy: None, source_type: str, pool: RepositoryPool, ) -> None: @@ -275,7 +191,7 @@ def test_chooser_chooses_specific_python_universal_wheel_link_if_available( @pytest.mark.parametrize("source_type", ["", "legacy"]) def test_chooser_chooses_system_specific_wheel_link_if_available( - mock_pypi: None, mock_legacy: None, source_type: str, pool: RepositoryPool + source_type: str, pool: RepositoryPool ) -> None: env = MockEnv( supported_tags=[Tag("cp37", "cp37m", "win32"), Tag("py3", "none", "any")] @@ -294,8 +210,6 @@ def test_chooser_chooses_system_specific_wheel_link_if_available( @pytest.mark.parametrize("source_type", ["", "legacy"]) def test_chooser_chooses_sdist_if_no_compatible_wheel_link_is_available( env: MockEnv, - mock_pypi: None, - mock_legacy: None, source_type: str, pool: RepositoryPool, ) -> None: @@ -307,21 +221,21 @@ def test_chooser_chooses_sdist_if_no_compatible_wheel_link_is_available( @pytest.mark.parametrize("source_type", ["", "legacy"]) def test_chooser_chooses_distributions_that_match_the_package_hashes( env: MockEnv, - mock_pypi: None, - mock_legacy: None, source_type: str, pool: RepositoryPool, + dist_hash_getter: DistributionHashGetter, ) -> None: chooser = Chooser(pool, env) package = Package("isort", "4.3.4") files = [ { - "hash": ( - "sha256:b9c40e9750f3d77e6e4d441d8b0266cf555e7cdabdcff33c4fd06366ca761ef8" - ), - "filename": "isort-4.3.4.tar.gz", + "file": filename, + "hash": (f"sha256:{dist_hash_getter(filename).sha256}"), } + for filename in [ + f"{package.name}-{package.version}.tar.gz", + ] ] if source_type == "legacy": package = Package( @@ -329,7 +243,7 @@ def test_chooser_chooses_distributions_that_match_the_package_hashes( package.version.text, source_type="legacy", source_reference="foo", - source_url="https://foo.bar/simple/", + source_url="https://legacy.foo.bar/simple/", ) package.files = files @@ -342,21 +256,19 @@ def test_chooser_chooses_distributions_that_match_the_package_hashes( @pytest.mark.parametrize("source_type", ["", "legacy"]) def test_chooser_chooses_yanked_if_no_others( env: MockEnv, - mock_pypi: None, - mock_legacy: None, source_type: str, pool: RepositoryPool, + dist_hash_getter: DistributionHashGetter, ) -> None: chooser = Chooser(pool, env) package = Package("black", "21.11b0") files = [ { - "filename": "black-21.11b0-py3-none-any.whl", - "hash": ( - "sha256:0b1f66cbfadcd332ceeaeecf6373d9991d451868d2e2219ad0ac1213fb701117" - ), + "filename": filename, + "hash": (f"sha256:{dist_hash_getter(filename).sha256}"), } + for filename in [f"{package.name}-{package.version}-py3-none-any.whl"] ] if source_type == "legacy": package = Package( @@ -364,7 +276,7 @@ def test_chooser_chooses_yanked_if_no_others( package.version.text, source_type="legacy", source_reference="foo", - source_url="https://foo.bar/simple/", + source_url="https://legacy.foo.bar/simple/", ) package.files = files @@ -376,36 +288,44 @@ def test_chooser_chooses_yanked_if_no_others( def test_chooser_does_not_choose_yanked_if_others( - mock_legacy: None, - mock_legacy_partial_yank: None, + specialized_legacy_repository_mocker: SpecializedLegacyRepositoryMocker, pool: RepositoryPool, + dist_hash_getter: DistributionHashGetter, ) -> None: chooser = Chooser(pool, MockEnv(supported_tags=[Tag("py2", "none", "any")])) + repo = pool.repository("foo2") + pool.remove_repository("foo2") + + assert isinstance(repo, LegacyRepository) + pool.add_repository( + specialized_legacy_repository_mocker("-partial-yank", repo.name, repo.url) + ) + package = Package("futures", "3.2.0") files = [ { - "filename": "futures-3.2.0-py2-none-any.whl", - "hash": "sha256:ec0a6cb848cc212002b9828c3e34c675e0c9ff6741dc445cab6fdd4e1085d1f1", - }, - { - "filename": "futures-3.2.0.tar.gz", - "hash": "sha256:9ec02aa7d674acb8618afb127e27fde7fc68994c0437ad759fa094a574adb265", - }, + "filename": filename, + "hash": (f"sha256:{dist_hash_getter(filename).sha256}"), + } + for filename in [ + f"{package.name}-{package.version}-py2-none-any.whl", + f"{package.name}-{package.version}.tar.gz", + ] ] package = Package( package.name, package.version.text, source_type="legacy", source_reference="foo", - source_url="https://foo.bar/simple/", + source_url="https://legacy.foo.bar/simple/", ) package_partial_yank = Package( package.name, package.version.text, source_type="legacy", source_reference="foo2", - source_url="https://foo2.bar/simple/", + source_url="https://legacy.foo2.bar/simple/", ) package.files = files @@ -421,8 +341,6 @@ def test_chooser_does_not_choose_yanked_if_others( @pytest.mark.parametrize("source_type", ["", "legacy"]) def test_chooser_throws_an_error_if_package_hashes_do_not_match( env: MockEnv, - mock_pypi: None, - mock_legacy: None, source_type: None, pool: RepositoryPool, ) -> None: @@ -443,7 +361,7 @@ def test_chooser_throws_an_error_if_package_hashes_do_not_match( package.version.text, source_type="legacy", source_reference="foo", - source_url="https://foo.bar/simple/", + source_url="https://legacy.foo.bar/simple/", ) package.files = files @@ -453,9 +371,8 @@ def test_chooser_throws_an_error_if_package_hashes_do_not_match( assert files[0]["hash"] in str(e) -@pytest.mark.usefixtures("mock_legacy") def test_chooser_md5_remote_fallback_to_sha256_inline_calculation( - env: MockEnv, pool: RepositoryPool + env: MockEnv, pool: RepositoryPool, dist_hash_getter: DistributionHashGetter ) -> None: chooser = Chooser(pool, env) package = Package( @@ -463,15 +380,14 @@ def test_chooser_md5_remote_fallback_to_sha256_inline_calculation( "0.1.0", source_type="legacy", source_reference="foo", - source_url="https://foo.bar/simple/", + source_url="https://legacy.foo.bar/simple/", ) package.files = [ { - "hash": ( - "sha256:9fa123ad707a5c6c944743bf3e11a0e80d86cb518d3cf25320866ca3ef43e2ad" - ), - "filename": "demo-0.1.0.tar.gz", + "filename": filename, + "hash": (f"sha256:{dist_hash_getter(filename).sha256}"), } + for filename in [f"{package.name}-{package.version}.tar.gz"] ] res = chooser.choose_for(package) assert res.filename == "demo-0.1.0.tar.gz" diff --git a/tests/installation/test_executor.py b/tests/installation/test_executor.py index a26c90b01c7..b862d3f5141 100644 --- a/tests/installation/test_executor.py +++ b/tests/installation/test_executor.py @@ -33,7 +33,6 @@ from poetry.utils.cache import ArtifactCache from poetry.utils.env import MockEnv from poetry.vcs.git.backend import Git -from tests.repositories.test_pypi_repository import MockRepository if TYPE_CHECKING: @@ -43,6 +42,7 @@ from poetry.config.config import Config from poetry.installation.operations.operation import Operation + from poetry.repositories.pypi_repository import PyPiRepository from poetry.utils.env import VirtualEnv from tests.types import FixtureDirGetter @@ -123,9 +123,11 @@ def io_not_decorated() -> BufferedIO: @pytest.fixture -def pool() -> RepositoryPool: +def pool(pypi_repository: PyPiRepository) -> RepositoryPool: pool = RepositoryPool() - pool.add_repository(MockRepository()) + + pypi_repository._fallback = True + pool.add_repository(pypi_repository) return pool @@ -161,7 +163,6 @@ def test_execute_executes_a_batch_of_operations( pool: RepositoryPool, io: BufferedIO, tmp_path: Path, - mock_file_downloads: None, env: MockEnv, copy_wheel: Callable[[], Path], fixture_dir: FixtureDirGetter, @@ -274,7 +275,6 @@ def test_execute_prints_warning_for_yanked_package( pool: RepositoryPool, io: BufferedIO, tmp_path: Path, - mock_file_downloads: None, env: MockEnv, operations: list[Operation], has_warning: bool, @@ -308,7 +308,6 @@ def test_execute_prints_warning_for_invalid_wheels( pool: RepositoryPool, io: BufferedIO, tmp_path: Path, - mock_file_downloads: None, env: MockEnv, ) -> None: config.merge({"cache-dir": str(tmp_path)}) @@ -423,7 +422,6 @@ def test_execute_works_with_ansi_output( pool: RepositoryPool, io_decorated: BufferedIO, tmp_path: Path, - mock_file_downloads: None, env: MockEnv, ) -> None: config.merge({"cache-dir": str(tmp_path)}) @@ -460,7 +458,6 @@ def test_execute_works_with_no_ansi_output( pool: RepositoryPool, io_not_decorated: BufferedIO, tmp_path: Path, - mock_file_downloads: None, env: MockEnv, ) -> None: config.merge({"cache-dir": str(tmp_path)}) @@ -547,7 +544,6 @@ def test_executor_should_delete_incomplete_downloads( tmp_path: Path, mocker: MockerFixture, pool: RepositoryPool, - mock_file_downloads: None, env: MockEnv, ) -> None: cached_archive = tmp_path / "tomlkit-0.5.3-py2.py3-none-any.whl" @@ -694,7 +690,6 @@ def test_executor_should_write_pep610_url_references_for_non_wheel_files( config: Config, io: BufferedIO, fixture_dir: FixtureDirGetter, - mock_file_downloads: None, ) -> None: url = (fixture_dir("distributions") / "demo-0.1.0.tar.gz").resolve() package = Package("demo", "0.1.0", source_type="file", source_url=url.as_posix()) @@ -790,7 +785,6 @@ def test_executor_should_write_pep610_url_references_for_wheel_urls( pool: RepositoryPool, config: Config, io: BufferedIO, - mock_file_downloads: None, mocker: MockerFixture, fixture_dir: FixtureDirGetter, is_artifact_cached: bool, @@ -866,7 +860,6 @@ def test_executor_should_write_pep610_url_references_for_non_wheel_urls( pool: RepositoryPool, config: Config, io: BufferedIO, - mock_file_downloads: None, mocker: MockerFixture, fixture_dir: FixtureDirGetter, is_sdist_cached: bool, @@ -953,7 +946,6 @@ def test_executor_should_write_pep610_url_references_for_git( config: Config, artifact_cache: ArtifactCache, io: BufferedIO, - mock_file_downloads: None, wheel: Path, mocker: MockerFixture, fixture_dir: FixtureDirGetter, @@ -1017,7 +1009,6 @@ def test_executor_should_write_pep610_url_references_for_editable_git( config: Config, artifact_cache: ArtifactCache, io: BufferedIO, - mock_file_downloads: None, wheel: Path, mocker: MockerFixture, fixture_dir: FixtureDirGetter, @@ -1066,7 +1057,6 @@ def test_executor_should_append_subdirectory_for_git( config: Config, artifact_cache: ArtifactCache, io: BufferedIO, - mock_file_downloads: None, wheel: Path, ) -> None: package = Package( @@ -1097,7 +1087,6 @@ def test_executor_should_write_pep610_url_references_for_git_with_subdirectories config: Config, artifact_cache: ArtifactCache, io: BufferedIO, - mock_file_downloads: None, wheel: Path, ) -> None: package = Package( @@ -1168,7 +1157,6 @@ def test_executor_fallback_on_poetry_create_error_without_wheel_installer( pool: RepositoryPool, io: BufferedIO, tmp_path: Path, - mock_file_downloads: None, env: MockEnv, fixture_dir: FixtureDirGetter, ) -> None: @@ -1244,7 +1232,6 @@ def test_build_backend_errors_are_reported_correctly_if_caused_by_subprocess( config: Config, pool: RepositoryPool, io: BufferedIO, - mock_file_downloads: None, env: MockEnv, fixture_dir: FixtureDirGetter, ) -> None: @@ -1313,7 +1300,6 @@ def test_build_backend_errors_are_reported_correctly_if_caused_by_subprocess_enc config: Config, pool: RepositoryPool, io: BufferedIO, - mock_file_downloads: None, env: MockEnv, fixture_dir: FixtureDirGetter, ) -> None: @@ -1349,7 +1335,6 @@ def test_build_system_requires_not_available( config: Config, pool: RepositoryPool, io: BufferedIO, - mock_file_downloads: None, env: MockEnv, fixture_dir: FixtureDirGetter, ) -> None: @@ -1395,7 +1380,6 @@ def test_build_system_requires_install_failure( config: Config, pool: RepositoryPool, io: BufferedIO, - mock_file_downloads: None, env: MockEnv, fixture_dir: FixtureDirGetter, ) -> None: @@ -1450,7 +1434,6 @@ def test_other_error( config: Config, pool: RepositoryPool, io: BufferedIO, - mock_file_downloads: None, env: MockEnv, fixture_dir: FixtureDirGetter, ) -> None: @@ -1562,7 +1545,6 @@ def test_executor_known_hashes( config: Config, io: BufferedIO, fixture_dir: FixtureDirGetter, - mock_file_downloads: None, ) -> None: # when installing sdist, an isolated build environment is required to extract metadata # this will install any build system requirements into the environment, to avoid failures when diff --git a/tests/installation/test_installer.py b/tests/installation/test_installer.py index d27d2166162..0e526b741b2 100644 --- a/tests/installation/test_installer.py +++ b/tests/installation/test_installer.py @@ -33,16 +33,14 @@ from tests.helpers import MOCK_DEFAULT_GIT_REVISION from tests.helpers import get_dependency from tests.helpers import get_package -from tests.repositories.test_legacy_repository import ( - MockRepository as MockLegacyRepository, -) -from tests.repositories.test_pypi_repository import MockRepository if TYPE_CHECKING: from pytest_mock import MockerFixture from poetry.installation.operations.operation import Operation + from poetry.repositories.legacy_repository import LegacyRepository + from poetry.repositories.pypi_repository import PyPiRepository from poetry.utils.env import Env from tests.conftest import Config from tests.types import FixtureDirGetter @@ -1097,16 +1095,16 @@ def test_run_installs_extras_with_deps_if_requested( assert installer.executor.removals_count == expected_removals_count -@pytest.mark.network def test_installer_with_pypi_repository( package: ProjectPackage, locker: Locker, installed: CustomInstalledRepository, config: Config, env: NullEnv, + pypi_repository: PyPiRepository, ) -> None: pool = RepositoryPool() - pool.add_repository(MockRepository()) + pool.add_repository(pypi_repository) installer = Installer( NullIO(), env, package, locker, pool, config, installed=installed @@ -1118,7 +1116,6 @@ def test_installer_with_pypi_repository( assert result == 0 expected = fixture("with-pypi-repository") - assert expected == locker.written_data @@ -1901,11 +1898,12 @@ def test_installer_required_extras_should_not_be_removed_when_updating_single_de env: NullEnv, mocker: MockerFixture, config: Config, + pypi_repository: PyPiRepository, ) -> None: mocker.patch("sys.platform", "darwin") pool = RepositoryPool() - pool.add_repository(MockRepository()) + pool.add_repository(pypi_repository) installer = Installer( NullIO(), @@ -1964,9 +1962,10 @@ def test_installer_required_extras_should_be_installed( installed: CustomInstalledRepository, env: NullEnv, config: Config, + pypi_repository: PyPiRepository, ) -> None: pool = RepositoryPool() - pool.add_repository(MockRepository()) + pool.add_repository(pypi_repository) installer = Installer( NullIO(), @@ -2100,6 +2099,8 @@ def test_installer_can_install_dependencies_from_forced_source( installed: CustomInstalledRepository, env: NullEnv, config: Config, + legacy_repository: LegacyRepository, + pypi_repository: PyPiRepository, ) -> None: package.python_versions = "^3.7" package.add_dependency( @@ -2107,8 +2108,8 @@ def test_installer_can_install_dependencies_from_forced_source( ) pool = RepositoryPool() - pool.add_repository(MockLegacyRepository()) - pool.add_repository(MockRepository()) + pool.add_repository(legacy_repository) + pool.add_repository(pypi_repository) installer = Installer( NullIO(), @@ -2235,9 +2236,10 @@ def test_installer_can_handle_old_lock_files( repo: Repository, installed: CustomInstalledRepository, config: Config, + pypi_repository: PyPiRepository, ) -> None: pool = RepositoryPool() - pool.add_repository(MockRepository()) + pool.add_repository(pypi_repository) package.add_dependency(Factory.create_dependency("pytest", "^3.5", groups=["dev"])) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py new file mode 100644 index 00000000000..c3d0fdfd765 --- /dev/null +++ b/tests/integration/conftest.py @@ -0,0 +1,14 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING + +import pytest + + +if TYPE_CHECKING: + import httpretty + + +@pytest.fixture(autouse=True) +def disable_httpretty(http: type[httpretty.httpretty]) -> None: + http.disable() diff --git a/tests/puzzle/test_solver.py b/tests/puzzle/test_solver.py index c9e4c6db7a0..7495ad29a1e 100644 --- a/tests/puzzle/test_solver.py +++ b/tests/puzzle/test_solver.py @@ -31,10 +31,6 @@ from tests.helpers import MOCK_DEFAULT_GIT_REVISION from tests.helpers import get_dependency from tests.helpers import get_package -from tests.repositories.test_legacy_repository import ( - MockRepository as MockLegacyRepository, -) -from tests.repositories.test_pypi_repository import MockRepository as MockPyPIRepository if TYPE_CHECKING: @@ -45,6 +41,8 @@ from poetry.installation.operations.operation import Operation from poetry.puzzle.provider import Provider from poetry.puzzle.transaction import Transaction + from poetry.repositories.legacy_repository import LegacyRepository + from poetry.repositories.pypi_repository import PyPiRepository from tests.types import FixtureDirGetter DEFAULT_SOURCE_REF = ( @@ -2944,9 +2942,9 @@ def test_solver_can_resolve_wheel_dependencies_with_extras( def test_solver_can_solve_with_legacy_repository_using_proper_dists( - package: ProjectPackage, io: NullIO + package: ProjectPackage, io: NullIO, legacy_repository: LegacyRepository ) -> None: - repo = MockLegacyRepository() + repo = legacy_repository pool = RepositoryPool([repo]) solver = Solver(package, pool, [], [], io) @@ -2988,10 +2986,11 @@ def test_solver_can_solve_with_legacy_repository_using_proper_dists( def test_solver_can_solve_with_legacy_repository_using_proper_python_compatible_dists( package: ProjectPackage, io: NullIO, + legacy_repository: LegacyRepository, ) -> None: package.python_versions = "^3.7" - repo = MockLegacyRepository() + repo = legacy_repository pool = RepositoryPool([repo]) solver = Solver(package, pool, [], [], io) @@ -3017,11 +3016,12 @@ def test_solver_can_solve_with_legacy_repository_using_proper_python_compatible_ ) -def test_solver_skips_invalid_versions(package: ProjectPackage, io: NullIO) -> None: +def test_solver_skips_invalid_versions( + package: ProjectPackage, io: NullIO, pypi_repository: PyPiRepository +) -> None: package.python_versions = "^3.7" - repo = MockPyPIRepository() - pool = RepositoryPool([repo]) + pool = RepositoryPool([pypi_repository]) solver = Solver(package, pool, [], [], io) @@ -3059,13 +3059,15 @@ def test_multiple_constraints_on_root( def test_solver_chooses_most_recent_version_amongst_repositories( - package: ProjectPackage, io: NullIO + package: ProjectPackage, + io: NullIO, + legacy_repository: LegacyRepository, + pypi_repository: PyPiRepository, ) -> None: package.python_versions = "^3.7" package.add_dependency(Factory.create_dependency("tomlkit", {"version": "^0.5"})) - repo = MockLegacyRepository() - pool = RepositoryPool([repo, MockPyPIRepository()]) + pool = RepositoryPool([legacy_repository, pypi_repository]) solver = Solver(package, pool, [], [], io) @@ -3080,15 +3082,17 @@ def test_solver_chooses_most_recent_version_amongst_repositories( def test_solver_chooses_from_correct_repository_if_forced( - package: ProjectPackage, io: NullIO + package: ProjectPackage, + io: NullIO, + legacy_repository: LegacyRepository, + pypi_repository: PyPiRepository, ) -> None: package.python_versions = "^3.7" package.add_dependency( Factory.create_dependency("tomlkit", {"version": "^0.5", "source": "legacy"}) ) - repo = MockLegacyRepository() - pool = RepositoryPool([repo, MockPyPIRepository()]) + pool = RepositoryPool([legacy_repository, pypi_repository]) solver = Solver(package, pool, [], [], io) @@ -3103,19 +3107,21 @@ def test_solver_chooses_from_correct_repository_if_forced( "tomlkit", "0.5.2", source_type="legacy", - source_url=repo.url, - source_reference=repo.name, + source_url=legacy_repository.url, + source_reference=legacy_repository.name, ), } ], ) - assert ops[0].package.source_url == "http://legacy.foo.bar" + assert ops[0].package.source_url == legacy_repository.url def test_solver_chooses_from_correct_repository_if_forced_and_transitive_dependency( package: ProjectPackage, io: NullIO, + legacy_repository: LegacyRepository, + pypi_repository: PyPiRepository, ) -> None: package.python_versions = "^3.7" package.add_dependency(Factory.create_dependency("foo", "^1.0")) @@ -3127,7 +3133,8 @@ def test_solver_chooses_from_correct_repository_if_forced_and_transitive_depende foo = get_package("foo", "1.0.0") foo.add_dependency(Factory.create_dependency("tomlkit", "^0.5.0")) repo.add_package(foo) - pool = RepositoryPool([MockLegacyRepository(), repo, MockPyPIRepository()]) + + pool = RepositoryPool([legacy_repository, repo, pypi_repository]) solver = Solver(package, pool, [], [], io) @@ -3142,7 +3149,7 @@ def test_solver_chooses_from_correct_repository_if_forced_and_transitive_depende "tomlkit", "0.5.2", source_type="legacy", - source_url="http://legacy.foo.bar", + source_url=legacy_repository.url, source_reference="legacy", ), }, @@ -3150,21 +3157,24 @@ def test_solver_chooses_from_correct_repository_if_forced_and_transitive_depende ], ) - assert ops[0].package.source_url == "http://legacy.foo.bar" + assert ops[0].package.source_url == legacy_repository.url assert ops[1].package.source_type is None assert ops[1].package.source_url is None def test_solver_does_not_choose_from_secondary_repository_by_default( - package: ProjectPackage, io: NullIO + package: ProjectPackage, + io: NullIO, + legacy_repository: LegacyRepository, + pypi_repository: PyPiRepository, ) -> None: package.python_versions = "^3.7" package.add_dependency(Factory.create_dependency("clikit", {"version": "^0.2.0"})) pool = RepositoryPool() - pool.add_repository(MockPyPIRepository(), priority=Priority.SECONDARY) - pool.add_repository(MockLegacyRepository()) + pool.add_repository(pypi_repository, priority=Priority.SECONDARY) + pool.add_repository(legacy_repository) solver = Solver(package, pool, [], [], io) @@ -3179,7 +3189,7 @@ def test_solver_does_not_choose_from_secondary_repository_by_default( "pastel", "0.1.0", source_type="legacy", - source_url="http://legacy.foo.bar", + source_url=legacy_repository.url, source_reference="legacy", ), }, @@ -3190,22 +3200,24 @@ def test_solver_does_not_choose_from_secondary_repository_by_default( "clikit", "0.2.4", source_type="legacy", - source_url="http://legacy.foo.bar", + source_url=legacy_repository.url, source_reference="legacy", ), }, ], ) - assert ops[0].package.source_url == "http://legacy.foo.bar" + assert ops[0].package.source_url == legacy_repository.url assert ops[1].package.source_type is None assert ops[1].package.source_url is None - assert ops[2].package.source_url == "http://legacy.foo.bar" + assert ops[2].package.source_url == legacy_repository.url def test_solver_chooses_from_secondary_if_explicit( package: ProjectPackage, io: NullIO, + legacy_repository: LegacyRepository, + pypi_repository: PyPiRepository, ) -> None: package.python_versions = "^3.7" package.add_dependency( @@ -3213,8 +3225,8 @@ def test_solver_chooses_from_secondary_if_explicit( ) pool = RepositoryPool() - pool.add_repository(MockPyPIRepository(), priority=Priority.SECONDARY) - pool.add_repository(MockLegacyRepository()) + pool.add_repository(pypi_repository, priority=Priority.SECONDARY) + pool.add_repository(legacy_repository) solver = Solver(package, pool, [], [], io) @@ -3229,7 +3241,7 @@ def test_solver_chooses_from_secondary_if_explicit( "pastel", "0.1.0", source_type="legacy", - source_url="http://legacy.foo.bar", + source_url=legacy_repository.url, source_reference="legacy", ), }, @@ -3238,7 +3250,7 @@ def test_solver_chooses_from_secondary_if_explicit( ], ) - assert ops[0].package.source_url == "http://legacy.foo.bar" + assert ops[0].package.source_url == legacy_repository.url assert ops[1].package.source_type is None assert ops[1].package.source_url is None assert ops[2].package.source_type is None @@ -3246,14 +3258,17 @@ def test_solver_chooses_from_secondary_if_explicit( def test_solver_does_not_choose_from_explicit_repository( - package: ProjectPackage, io: NullIO + package: ProjectPackage, + io: NullIO, + legacy_repository: LegacyRepository, + pypi_repository: PyPiRepository, ) -> None: package.python_versions = "^3.7" package.add_dependency(Factory.create_dependency("attrs", {"version": "^17.4.0"})) pool = RepositoryPool() - pool.add_repository(MockPyPIRepository(), priority=Priority.EXPLICIT) - pool.add_repository(MockLegacyRepository()) + pool.add_repository(pypi_repository, priority=Priority.EXPLICIT) + pool.add_repository(legacy_repository) solver = Solver(package, pool, [], [], io) @@ -3264,6 +3279,8 @@ def test_solver_does_not_choose_from_explicit_repository( def test_solver_chooses_direct_dependency_from_explicit_if_explicit( package: ProjectPackage, io: NullIO, + legacy_repository: LegacyRepository, + pypi_repository: PyPiRepository, ) -> None: package.python_versions = "^3.7" package.add_dependency( @@ -3271,8 +3288,8 @@ def test_solver_chooses_direct_dependency_from_explicit_if_explicit( ) pool = RepositoryPool() - pool.add_repository(MockPyPIRepository(), priority=Priority.EXPLICIT) - pool.add_repository(MockLegacyRepository()) + pool.add_repository(pypi_repository, priority=Priority.EXPLICIT) + pool.add_repository(legacy_repository) solver = Solver(package, pool, [], [], io) @@ -3292,17 +3309,19 @@ def test_solver_chooses_direct_dependency_from_explicit_if_explicit( def test_solver_ignores_explicit_repo_for_transient_dependencies( package: ProjectPackage, io: NullIO, + legacy_repository: LegacyRepository, + pypi_repository: PyPiRepository, ) -> None: - # clikit depends on pylev, which is in MockPyPIRepository (explicit) but not in - # MockLegacyRepository + # clikit depends on pylev, which is in pypi_repository (explicit) but not in + # legacy_repository package.python_versions = "^3.7" package.add_dependency( Factory.create_dependency("clikit", {"version": "^0.2.0", "source": "PyPI"}) ) pool = RepositoryPool() - pool.add_repository(MockPyPIRepository(), priority=Priority.EXPLICIT) - pool.add_repository(MockLegacyRepository()) + pool.add_repository(pypi_repository, priority=Priority.EXPLICIT) + pool.add_repository(legacy_repository) solver = Solver(package, pool, [], [], io) diff --git a/tests/repositories/conftest.py b/tests/repositories/conftest.py index 1f9a6d11946..2661b46fc20 100644 --- a/tests/repositories/conftest.py +++ b/tests/repositories/conftest.py @@ -1,18 +1,12 @@ from __future__ import annotations -import posixpath - -from pathlib import Path from typing import TYPE_CHECKING -from typing import Any import pytest -import requests if TYPE_CHECKING: from tests.types import HTMLPageGetter - from tests.types import RequestsSessionGet @pytest.fixture @@ -35,25 +29,3 @@ def _fixture(content: str, base_url: str | None = None) -> str: """ return _fixture - - -@pytest.fixture -def get_metadata_mock() -> RequestsSessionGet: - def metadata_mock(url: str, **__: Any) -> requests.Response: - if url.endswith(".metadata"): - response = requests.Response() - response.encoding = "application/text" - response._content = ( - ( - Path(__file__).parent - / "fixtures" - / "metadata" - / posixpath.basename(url) - ) - .read_text() - .encode() - ) - return response - raise requests.HTTPError() - - return metadata_mock diff --git a/tests/repositories/fixtures/__init__.py b/tests/repositories/fixtures/__init__.py new file mode 100644 index 00000000000..a398ab3e8a2 --- /dev/null +++ b/tests/repositories/fixtures/__init__.py @@ -0,0 +1,9 @@ +from __future__ import annotations + + +pytest_plugins = [ + "tests.repositories.fixtures.distribution_hashes", + "tests.repositories.fixtures.legacy", + "tests.repositories.fixtures.pypi", + "tests.repositories.fixtures.python_hosted", +] diff --git a/tests/repositories/fixtures/distribution_hashes.py b/tests/repositories/fixtures/distribution_hashes.py new file mode 100644 index 00000000000..6c20ed308bf --- /dev/null +++ b/tests/repositories/fixtures/distribution_hashes.py @@ -0,0 +1,302 @@ +# this file is generated by tests/repositories/fixtures/pypi.org/generate.py +from __future__ import annotations + +import dataclasses + +from typing import TYPE_CHECKING + +import pytest + + +if TYPE_CHECKING: + from tests.types import DistributionHashGetter + + +@dataclasses.dataclass +class DistributionHash: + sha256: str = "" + md5: str = "" + + +KNOWN_DISTRIBUTION_HASHES = { + "SQLAlchemy-1.2.12.tar.gz": DistributionHash( + "b5a127599b3f27847fba6119de0fcb70832a8041b103701a708b7c7d044faa38", + "4a2617b5254748828d09349fc4eff6bd", + ), + "Twisted-18.9.0.tar.bz2": DistributionHash( + "4335327da58be11dd6e482ec6b85eb055bcc953a9570cd59e7840a2ce9419a8e", + "35ff4705ea90a76bf972ff3b229546ca", + ), + "attrs-17.4.0-py2.py3-none-any.whl": DistributionHash( + "d38e57f381e891928357c68e300d28d3d4dcddc50486d5f8dfaf743d40477619", + "9d32f2b5a93343e01f54d87740f2da60", + ), + "attrs-17.4.0.tar.gz": DistributionHash( + "eb7536a1e6928190b3008c5b350bdf9850d619fff212341cd096f87a27a5e564", + "c03e5b3608d9071fbd098850d8922668", + ), + "black-19.10b0-py36-none-any.whl": DistributionHash( + "3471ff321348d851b6f3047f4ed42c88622ac038caf7c2d160bd653334c88e88", + "4a420234749e1ea350581160ef51cd02", + ), + "black-19.10b0.tar.gz": DistributionHash( + "6cada614d5d2132698c6d5fff384657273d922c4fffa6a2f0de9e03e25b8913a", + "c383543109a66a5a99113e6326db5251", + ), + "black-21.11b0-py3-none-any.whl": DistributionHash( + "e16b6879ed61f9268994b879174fad1cb2319a651afd20f8cf036428ac65f846", + "294e105f34e2e21286a49bfcfb8fb6ae", + ), + "black-21.11b0.tar.gz": DistributionHash( + "f23c482185d842e2f19d506e55c004061167e3c677c063ecd721042c62086ada", + "f01267bf2613f825dd6684629c1c829e", + ), + "cleo-1.0.0a5-py3-none-any.whl": DistributionHash( + "20dbd69ed5c27e2889a2d428b9b01771f6073e4a1483a731e3c14c07a666aa9f", + "eaf14b3f99b2b88c0846ecc9a5a18af4", + ), + "cleo-1.0.0a5.tar.gz": DistributionHash( + "88f0a4275a17f2ab4d013786b8b9522d4c60bd37d8fc9b3def0fb27f4ac1e694", + "92e181952976e09b9d1c583da6c3e2fc", + ), + "clikit-0.2.4-py2.py3-none-any.whl": DistributionHash( + "60900adbac91d6d2cefc88efe2639ce3090f4520106596ac855bee3763f276c0", + "c3558fef2a1148bb1df96376def5c8fe", + ), + "clikit-0.2.4.tar.gz": DistributionHash( + "0fdd41e86e8b118a8b1e94ef2835925ada541d481c9b3b2fc635fa68713e6125", + "f7cdbad3508038a04561f646aae68146", + ), + "colorama-0.3.9-py2.py3-none-any.whl": DistributionHash( + "5b632359f1ed2b7676a869812ba0edaacb99be04679b29eb56c07a5e137ab5a2", + "faef2bbd3c2ecc43e0969877d67b4c92", + ), + "colorama-0.3.9.tar.gz": DistributionHash( + "4c5a15209723ce1330a5c193465fe221098f761e9640d823a2ce7c03f983137f", + "8323a5b84fdf7ad810804e51fc256b39", + ), + "demo-0.1.0-py2.py3-none-any.whl": DistributionHash( + "70e704135718fffbcbf61ed1fc45933cfd86951a744b681000eaaa75da31f17a", + "15507846fd4299596661d0197bfb4f90", + ), + "demo-0.1.0.tar.gz": DistributionHash( + "9fa123ad707a5c6c944743bf3e11a0e80d86cb518d3cf25320866ca3ef43e2ad", + "d1912c917363a64e127318655f7d1fe7", + ), + "demo-0.1.2-py2.py3-none-any.whl": DistributionHash( + "55dde4e6828081de7a1e429f33180459c333d9da593db62a3d75a8f5e505dde1", + "53b4e10d2bfa81a4206221c4b87843d9", + ), + "demo_invalid_record-0.1.0-py2.py3-none-any.whl": DistributionHash( + "d1e5a3f18f24a2ad3717c6f9c55f8c26060f39b2cddf28b18c355786728cb4dd", + "18041168d415370d5019ec7e2b1ed0b5", + ), + "demo_invalid_record2-0.1.0-py2.py3-none-any.whl": DistributionHash( + "e730fca385b52e77fc58d73812f0dc236fad489ef6026716d1a4317ab4738c3c", + "a21ee67e833f50e9f0ecdfe1c0484b93", + ), + "demo_metadata_version_23-0.1.0-py2.py3-none-any.whl": DistributionHash( + "7592aa158137726d9579e5d4347bd03a88f9fc82e11061303215feaaf000d32c", + "434114a36f986671d132033e130f26b7", + ), + "demo_missing_dist_info-0.1.0-py2.py3-none-any.whl": DistributionHash( + "cf8eaade81dd1db42f60c0e9c8610c1c12006baa9f7ad994b1c2bae92ea4b426", + "da33c6088e72fbaaf873999606767353", + ), + "demo_no_pkg_info-0.1.0.tar.gz": DistributionHash( + "f1e2a977c506dfb6b43495e2ffeee618b90029bac92fcb3038a53268197afa0c", + "eeaf257d6b2c3b01def567751b21c1e8", + ), + "discord.py-2.0.0-py3-none-any.whl": DistributionHash( + "054c3d8cf89a8e37a691e0268232dad23e07f4e9a06f33454c3bafeaba34a9b7", + "8ffc907807f8351401dbe4408dcaff79", + ), + "discord.py-2.0.0.tar.gz": DistributionHash( + "b86fa9dd562684f7a52564e6dfe0216f6c172a009c0d86b8dea8bdd6ffa6b1f4", + "6c0505a6032342b29f31f9979f37d277", + ), + "futures-3.2.0-py2-none-any.whl": DistributionHash( + "d89e1540e8b553fbda912230db359954365a1f5d0d0fa7fab96ad3969d9d5a93", + "33e76564a87766c3e186d986ddc55bd8", + ), + "futures-3.2.0.tar.gz": DistributionHash( + "baf0d469c9e541b747986b7404cd63a5496955bd0c43a3cc068c449b09b7d4a4", + "40eb168dab84e606df3fdb7e67fe27b7", + ), + "ipython-5.7.0-py2-none-any.whl": DistributionHash( + "3d93d3995e2e52a98dc4f44361cd5bf68dbde62925d1f820b97d8f0e1d941f73", + "cf35939995e0fd8c44fca7509308abde", + ), + "ipython-5.7.0-py3-none-any.whl": DistributionHash( + "b94c7a3971290024ffaa916d51ee377ee85f8860a62b5f30c58f5376f0956a06", + "8805d83c415de06f5eadd55aeb2fa738", + ), + "ipython-5.7.0.tar.gz": DistributionHash( + "4e7fb265e0264498bd0d62c6261936a658bf3d38beb8a7b10cd2c6327c62ac2a", + "01f2808ebe78ff2f28dc39be3aa635ca", + ), + "ipython-7.5.0-py3-none-any.whl": DistributionHash( + "634f505893bbbdb79d1a04d89f4633d8cfc41115337847fbf9d5a23610fc3e3d", + "99a386eca39b536033c71aacf9f98e2b", + ), + "ipython-7.5.0.tar.gz": DistributionHash( + "cd2a17ac273fea8bf8953118a2d83bad94f592f0db3e83fff9129a1842e36dbe", + "0e8c1d7c14f309f6cd2dfd4e48e75cb1", + ), + "isort-4.3.4-py2-none-any.whl": DistributionHash( + "3bbfc8f6119a46a48064487afb0b3ca9daa4b09fbfd94336a24c7616b71db2ca", + "e84fb6f2278ee4d0bd719a4d44863d9f", + ), + "isort-4.3.4-py3-none-any.whl": DistributionHash( + "e7aa083302c758b358e10a3a1c707adcc9f8ab57795e99246ac72eeffe7f2b20", + "baa2e5dc4e89511b6bc54e969d040a08", + ), + "isort-4.3.4.tar.gz": DistributionHash( + "234ad07e1e2780c27fa56364eefa734bee991b0d744337ef7e7ce3d5b1b59f39", + "9244631852cf8bd8559f7ab78bf4ec78", + ), + "jupyter-1.0.0-py2.py3-none-any.whl": DistributionHash( + "83c4591b9c7392ea5f91e0d9f8e98d894f76e8e669260788f0fcb281ec0b3b1f", + "b2f5e2daab779c7bda0be38925ab1b92", + ), + "jupyter-1.0.0.tar.gz": DistributionHash( + "3ef1e86ba0556ea5922b846416a41acfd2625830d996c7d06d80c90bed1dc193", + "78acaec88533ea6b6e761e7d086a1d04", + ), + "jupyter-1.0.0.zip": DistributionHash( + "4a855b9717c3ea24fd8ca4fd91ab5995894aecc4d20e7f39c28786a2c1869fae", + "7b7a957694a73ac0c19fe46c216c0ea0", + ), + "more-itertools-4.1.0.tar.gz": DistributionHash( + "bab2dc6f4be8f9a4a72177842c5283e2dff57c167439a03e3d8d901e854f0f2e", + "bf351a1050242ce3af7e475a4da1a26b", + ), + "more_itertools-4.1.0-py2-none-any.whl": DistributionHash( + "5dd7dfd88d2fdaea446da478ffef8d7151fdf26ee92ac7ed7b14e8d71efe4b62", + "c70269eabc5fae5e0d93c2eca638720e", + ), + "more_itertools-4.1.0-py3-none-any.whl": DistributionHash( + "29b1e1661aaa56875ce090fa219fa84dfc13daecb52cd4fae321f6f57b419ec4", + "26d7c309ef806b4e563d2a7e4ceafb14", + ), + "pastel-0.1.0-py3-none-any.whl": DistributionHash( + "d88b34efa115392ee42c55d6f82cdf5e5e08221ef2e18a16ae696a80008c3499", + "632fcf45cc28aed4a4dce1324d1bd1d1", + ), + "pastel-0.1.0.tar.gz": DistributionHash( + "22f14474c4120b37c54ac2173b49b0ac1de9283ca714be6eb3ea8b39296285a9", + "43ea5f07660f630da18ae1827f5b4333", + ), + "pluggy-0.6.0-py2-none-any.whl": DistributionHash( + "9b835f86bfe5498c87ace7f4899cb1b0c40e71c9277377f6851c74a307879285", + "de6f342e8044d0071eefc3c9cda33055", + ), + "pluggy-0.6.0-py3-none-any.whl": DistributionHash( + "8c646771f5eab7557d1f3924077c55408e86bdfb700f7d86a6d83abeabff4c66", + "f2fc2c3179edccaa7728650178c9133c", + ), + "pluggy-0.6.0.tar.gz": DistributionHash( + "a982e208d054867661d27c6d2a86b17ba05fbb6b1bdc01f42660732dd107f865", + "ef8a88abcd501afd47cb22245fe4315a", + ), + "poetry_core-1.5.0-py3-none-any.whl": DistributionHash( + "e216b70f013c47b82a72540d34347632c5bfe59fd54f5fe5d51f6a68b19aaf84", + "be7589b4902793e66d7d979bd8581591", + ), + "poetry_core-1.5.0.tar.gz": DistributionHash( + "0ae8d28caf5c12ec1714b16d2e7157ddd52397ea6bfdeba5a9432e449a0184da", + "3f9b36a7a94cd235bfd5f05794828445", + ), + "py-1.5.3-py2.py3-none-any.whl": DistributionHash( + "43ee6c7f95e0ec6a906de49906b79d138d89728fff17109d49f086abc2fdd985", + "98652ecee6fc3bb5393a17828f93e1fb", + ), + "py-1.5.3.tar.gz": DistributionHash( + "2df2c513c3af11de15f58189ba5539ddc4768c6f33816dc5c03950c8bd6180fa", + "623e80cfc06df930414a9ce4bf0fd6c9", + ), + "pytest-3.5.0-py2.py3-none-any.whl": DistributionHash( + "28e4d9c2ae3196d74805c2eba24f350ae4c791a5b9b397c79b41506a48dc64ca", + "d3b1e9aea9e5b9e7a226d8b08aa43662", + ), + "pytest-3.5.0.tar.gz": DistributionHash( + "677b1d6decd29c041fe64276f29f79fbe66e40c59e445eb251366b4a8ab8bf68", + "ccd78dac54112045f561c4df86631f19", + ), + "pytest-3.5.1-py2.py3-none-any.whl": DistributionHash( + "6d3e83b1c1697d220137e436980e73b3ca674f643e666d7c24b0321cb57b76a4", + "f1de372a436700e3a785e85c11d15821", + ), + "pytest-3.5.1.tar.gz": DistributionHash( + "b8fe151f3e181801dd38583a1c03818fbc662a8fce96c9063a0af624613e78f8", + "961104636090457187851ccb9ef0f677", + ), + "python-language-server-0.21.2.tar.gz": DistributionHash( + "91b564e092f3135b2bac70dbd23d283da5ad50269766a76648787b69fe702c7e", + "677602ec38bc1c7b72de6128d90d846b", + ), + "requests-2.18.4-py2.py3-none-any.whl": DistributionHash( + "ce91d39dc2857eeb19fc8bf765df6c14874bcdc724d3ce9c6cd89915618e7023", + "f392c0ab49bf677c6240ef2b1890b079", + ), + "requests-2.18.4.tar.gz": DistributionHash( + "ec62f7e0e9d4814656b0172dbd592fea06127c6556ff5651eb5d2c8768671fd4", + "942a6a383dc94da90cf58f5adcf028a4", + ), + "setuptools-67.6.1-py3-none-any.whl": DistributionHash( + "e728ca814a823bf7bf60162daf9db95b93d532948c4c0bea762ce62f60189078", + "3b5b846e000da033d54eeaaf7915126e", + ), + "setuptools-67.6.1.tar.gz": DistributionHash( + "a737d365c957dd3fced9ddd246118e95dce7a62c3dc49f37e7fdd9e93475d785", + "ee2562f783544d1f95022c906dd3cf98", + ), + "six-1.11.0-py2.py3-none-any.whl": DistributionHash( + "112f5b46e6aa106db3e4e2494a03694c938f41c4c4535edbdfc816c2e0cb50f2", + "35b1057b388e276352d0709138b1e194", + ), + "six-1.11.0.tar.gz": DistributionHash( + "268a4ccb159c1a2d2c79336b02e75058387b0cdbb4cea2f07846a758f48a356d", + "25d3568604f921dd23532b88a0ce17e7", + ), + "tomlkit-0.5.2-py2.py3-none-any.whl": DistributionHash( + "a50f685abd033a7b50b13330833c15699885186517b713d9f7e8280ce7976e4c", + "7bcf6cf4a6034339bb6a481f27b9ba62", + ), + "tomlkit-0.5.2.tar.gz": DistributionHash( + "4a226ccf11ee5a2e76bfc185747b54ee7718706aeb3aabb981327249dbe2b1d4", + "7c31987ef6fba2cd64715cae27fade64", + ), + "tomlkit-0.5.3-py2.py3-none-any.whl": DistributionHash( + "d4fe74be9b732d76886da6da2e96f76ae42551e53afce1ea29bc703629b70497", + "b868779f054c64bc6c2ae4ad2cdbf6b3", + ), + "tomlkit-0.5.3.tar.gz": DistributionHash( + "e2f785651609492c771d9887ccb2369d891d16595d2d97972e2cbe5e8fb3439f", + "cdbdc302a184d1f1e38d5e0810e3b212", + ), + "wheel-0.40.0-py3-none-any.whl": DistributionHash( + "d236b20e7cb522daf2390fa84c55eea81c5c30190f90f29ae2ca1ad8355bf247", + "517d39f133bd7b1ff17caf09784b7543", + ), + "wheel-0.40.0.tar.gz": DistributionHash( + "5cb7e75751aa82e1b7db3fd52f5a9d59e7b06905630bed135793295931528740", + "5f175a8d693f74878964d4fd29729ab7", + ), + "zipp-3.5.0-py3-none-any.whl": DistributionHash( + "82da6dcae3676123d6f493a876259614e7e6e970b14c59b1830a2c901ed91306", + "52aecc0484efd07d62575d152f6a98f6", + ), + "zipp-3.5.0.tar.gz": DistributionHash( + "239d50954a15aa4b283023f18dc451ba811fb4d263f4dd6855642e4d1c80cc9f", + "16bf2a24fae340052e8565c264d21092", + ), +} + + +@pytest.fixture +def dist_hash_getter() -> DistributionHashGetter: + def get_hash(name: str) -> DistributionHash: + return KNOWN_DISTRIBUTION_HASHES.get(name, DistributionHash()) + + return get_hash diff --git a/tests/repositories/fixtures/legacy.py b/tests/repositories/fixtures/legacy.py new file mode 100644 index 00000000000..58f431b0268 --- /dev/null +++ b/tests/repositories/fixtures/legacy.py @@ -0,0 +1,157 @@ +from __future__ import annotations + +import re + +from pathlib import Path +from typing import TYPE_CHECKING +from typing import Any +from urllib.parse import urlparse + +import pytest + +from packaging.utils import canonicalize_name + +from poetry.repositories.legacy_repository import LegacyRepository +from tests.helpers import FIXTURE_PATH_REPOSITORIES_LEGACY + + +if TYPE_CHECKING: + import httpretty + + from httpretty.core import HTTPrettyRequest + from packaging.utils import NormalizedName + from pytest_mock import MockerFixture + + from poetry.repositories.link_sources.html import SimpleRepositoryPage + from tests.types import HTTPrettyRequestCallback + from tests.types import NormalizedNameTransformer + from tests.types import SpecializedLegacyRepositoryMocker + +pytest_plugins = [ + "tests.repositories.fixtures.python_hosted", +] + + +@pytest.fixture +def legacy_repository_directory() -> Path: + return FIXTURE_PATH_REPOSITORIES_LEGACY + + +@pytest.fixture +def legacy_repository_package_names(legacy_repository_directory: Path) -> set[str]: + return { + package_html_file.stem + for package_html_file in legacy_repository_directory.glob("*.html") + } + + +@pytest.fixture +def legacy_repository_index_html( + legacy_repository_directory: Path, legacy_repository_package_names: set[str] +) -> str: + hrefs = [ + f'{name}
' for name in legacy_repository_package_names + ] + + return f""" + + + Legacy Repository + + + {"".join(hrefs)} + + + + """ + + +@pytest.fixture +def legacy_repository_url() -> str: + return "https://legacy.foo.bar" + + +@pytest.fixture +def legacy_repository_html_callback( + legacy_repository_directory: Path, + legacy_repository_index_html: str, +) -> HTTPrettyRequestCallback: + def html_callback( + request: HTTPrettyRequest, uri: str, headers: dict[str, Any] + ) -> tuple[int, dict[str, Any], bytes]: + if name := Path(urlparse(uri).path).name: + fixture = legacy_repository_directory / f"{name}.html" + + if not fixture.exists(): + return 404, headers, b"Not Found" + + return 200, headers, fixture.read_bytes() + + return 200, headers, legacy_repository_index_html.encode("utf-8") + + return html_callback + + +@pytest.fixture +def legacy_repository( + http: type[httpretty], + legacy_repository_url: str, + legacy_repository_html_callback: HTTPrettyRequestCallback, + mock_files_python_hosted: None, +) -> LegacyRepository: + http.register_uri( + http.GET, + re.compile("^https://legacy.(.*)+/?(.*)?$"), + body=legacy_repository_html_callback, + ) + + return LegacyRepository("legacy", legacy_repository_url, disable_cache=True) + + +@pytest.fixture +def specialized_legacy_repository_mocker( + legacy_repository: LegacyRepository, + legacy_repository_url: str, + mocker: MockerFixture, +) -> SpecializedLegacyRepositoryMocker: + """ + This is a mocker factory that allows tests cases to intercept and redirect to special case legacy html files by + creating an instance of the mocked legacy repository and then mocking its get_page method for special cases. + """ + + def mock( + transformer_or_suffix: NormalizedNameTransformer | str, + repository_name: str = "special", + repository_url: str = legacy_repository_url, + ) -> LegacyRepository: + specialized_repository = LegacyRepository( + repository_name, repository_url, disable_cache=True + ) + original_get_page = specialized_repository._get_page + + def _mocked_get_page(name: NormalizedName) -> SimpleRepositoryPage: + return original_get_page( + canonicalize_name(f"{name}{transformer_or_suffix}") + if isinstance(transformer_or_suffix, str) + else transformer_or_suffix(name) + ) + + mocker.patch.object(specialized_repository, "get_page", _mocked_get_page) + + return specialized_repository + + return mock + + +@pytest.fixture +def legacy_repository_with_extra_packages( + specialized_legacy_repository_mocker: SpecializedLegacyRepositoryMocker, +) -> LegacyRepository: + return specialized_legacy_repository_mocker("-with-extra-packages") + + +@pytest.fixture +def legacy_repository_partial_yank( + specialized_legacy_repository_mocker: SpecializedLegacyRepositoryMocker, +) -> LegacyRepository: + return specialized_legacy_repository_mocker("-partial-yank") diff --git a/tests/repositories/fixtures/legacy/black.html b/tests/repositories/fixtures/legacy/black.html index ea050662b83..c8f1928bd33 100644 --- a/tests/repositories/fixtures/legacy/black.html +++ b/tests/repositories/fixtures/legacy/black.html @@ -4,8 +4,8 @@ Links for black

Links for black

- black-19.10b0-py36-none-any.whl - black-21.11b0-py3-none-any.whl + black-19.10b0-py36-none-any.whl + black-21.11b0-py3-none-any.whl diff --git a/tests/repositories/fixtures/legacy/clikit.html b/tests/repositories/fixtures/legacy/clikit.html index 9a51ad0ad7b..2abd1054795 100644 --- a/tests/repositories/fixtures/legacy/clikit.html +++ b/tests/repositories/fixtures/legacy/clikit.html @@ -5,10 +5,10 @@

Links for clikit

- clikit-0.2.3-py2.py3-none-any.whl
- clikit-0.2.3.tar.gz
- clikit-0.2.4-py2.py3-none-any.whl
- clikit-0.2.4.tar.gz
+ clikit-0.2.3-py2.py3-none-any.whl
+ clikit-0.2.3.tar.gz
+ clikit-0.2.4-py2.py3-none-any.whl
+ clikit-0.2.4.tar.gz
diff --git a/tests/repositories/fixtures/legacy/discord-py.html b/tests/repositories/fixtures/legacy/discord-py.html index af4a2212f26..e1e76eebf6e 100644 --- a/tests/repositories/fixtures/legacy/discord-py.html +++ b/tests/repositories/fixtures/legacy/discord-py.html @@ -4,8 +4,8 @@ Links for discord-py

Links for discord-py

- discord.py-2.0.0-py3-none-any.whl
- discord.py-2.0.0.tar.gz
+ discord.py-2.0.0-py3-none-any.whl
+ discord.py-2.0.0.tar.gz
diff --git a/tests/repositories/fixtures/legacy/futures-partial-yank.html b/tests/repositories/fixtures/legacy/futures-partial-yank.html index 41fa4ac3d38..b9d344509cb 100644 --- a/tests/repositories/fixtures/legacy/futures-partial-yank.html +++ b/tests/repositories/fixtures/legacy/futures-partial-yank.html @@ -5,8 +5,8 @@

Links for futures

- futures-3.2.0-py2-none-any.whl
- futures-3.2.0.tar.gz
+ futures-3.2.0-py2-none-any.whl
+ futures-3.2.0.tar.gz
diff --git a/tests/repositories/fixtures/legacy/futures.html b/tests/repositories/fixtures/legacy/futures.html index 1f0926204d2..31cd8e6332c 100644 --- a/tests/repositories/fixtures/legacy/futures.html +++ b/tests/repositories/fixtures/legacy/futures.html @@ -5,8 +5,8 @@

Links for futures

- futures-3.2.0-py2-none-any.whl
- futures-3.2.0.tar.gz
+ futures-3.2.0-py2-none-any.whl
+ futures-3.2.0.tar.gz
diff --git a/tests/repositories/fixtures/legacy/ipython.html b/tests/repositories/fixtures/legacy/ipython.html index 5b61c92d784..accaff48a76 100644 --- a/tests/repositories/fixtures/legacy/ipython.html +++ b/tests/repositories/fixtures/legacy/ipython.html @@ -5,11 +5,11 @@

Links for ipython

- ipython-5.7.0-py2-none-any.whl
- ipython-5.7.0-py3-none-any.whl
- ipython-5.7.0.tar.gz
- ipython-7.5.0-py3-none-any.whl
- ipython-7.5.0.tar.gz
+ ipython-5.7.0-py2-none-any.whl
+ ipython-5.7.0-py3-none-any.whl
+ ipython-5.7.0.tar.gz
+ ipython-7.5.0-py3-none-any.whl
+ ipython-7.5.0.tar.gz
diff --git a/tests/repositories/fixtures/legacy/isort.html b/tests/repositories/fixtures/legacy/isort.html index 2c3f7775dd7..ce51ea452fb 100644 --- a/tests/repositories/fixtures/legacy/isort.html +++ b/tests/repositories/fixtures/legacy/isort.html @@ -5,9 +5,9 @@

Links for isort

- isort-4.3.4-py2-none-any.whl
- isort-4.3.4-py3-none-any.whl
- isort-4.3.4.tar.gz
+ isort-4.3.4-py2-none-any.whl
+ isort-4.3.4-py3-none-any.whl
+ isort-4.3.4.tar.gz
diff --git a/tests/repositories/fixtures/legacy/pastel.html b/tests/repositories/fixtures/legacy/pastel.html index cd86ff516b8..187abe35889 100644 --- a/tests/repositories/fixtures/legacy/pastel.html +++ b/tests/repositories/fixtures/legacy/pastel.html @@ -5,7 +5,7 @@

Links for pastel

- pastel-0.1.0.tar.gz
+ pastel-0.1.0.tar.gz
diff --git a/tests/repositories/fixtures/legacy/pytest-with-extra-packages.html b/tests/repositories/fixtures/legacy/pytest-with-extra-packages.html index 428c2f5a0ee..b2fde9ace28 100644 --- a/tests/repositories/fixtures/legacy/pytest-with-extra-packages.html +++ b/tests/repositories/fixtures/legacy/pytest-with-extra-packages.html @@ -7,9 +7,9 @@

Links for pytest

- pytest-3.5.0-py2.py3-none-any.whl
- pytest-3.5.0.tar.gz
futures-3.2.0-py2-none-any.whl
diff --git a/tests/repositories/fixtures/legacy/pytest.html b/tests/repositories/fixtures/legacy/pytest.html index 487444cc0ce..e891c1d31f0 100644 --- a/tests/repositories/fixtures/legacy/pytest.html +++ b/tests/repositories/fixtures/legacy/pytest.html @@ -4,8 +4,8 @@ Links for pytest -

Links for pytest

pytest-3.5.0-py2.py3-none-any.whl
- pytest-3.5.0.tar.gz
+

Links for pytest

pytest-3.5.0-py2.py3-none-any.whl
+ pytest-3.5.0.tar.gz
diff --git a/tests/repositories/fixtures/legacy/python-language-server.html b/tests/repositories/fixtures/legacy/python-language-server.html index cb79304a7fe..3f93260e9e4 100644 --- a/tests/repositories/fixtures/legacy/python-language-server.html +++ b/tests/repositories/fixtures/legacy/python-language-server.html @@ -5,7 +5,7 @@

Links for python-language-server

- python-language-server-0.21.2.tar.gz
+ python-language-server-0.21.2.tar.gz
diff --git a/tests/repositories/fixtures/legacy/pyyaml.html b/tests/repositories/fixtures/legacy/pyyaml.html index a5007a9866c..3be916ca956 100644 --- a/tests/repositories/fixtures/legacy/pyyaml.html +++ b/tests/repositories/fixtures/legacy/pyyaml.html @@ -5,9 +5,9 @@

Links for python-language-server

- PyYAML-3.13-cp37-cp37m-win32.whl
- PyYAML-3.13.tar.gz
- PyYAML-4.2b2.tar.gz
+ PyYAML-3.13-cp37-cp37m-win32.whl
+ PyYAML-3.13.tar.gz
+ PyYAML-4.2b2.tar.gz
diff --git a/tests/repositories/fixtures/legacy/tomlkit.html b/tests/repositories/fixtures/legacy/tomlkit.html index 78379af9cd0..5ee1c7e52ec 100644 --- a/tests/repositories/fixtures/legacy/tomlkit.html +++ b/tests/repositories/fixtures/legacy/tomlkit.html @@ -5,7 +5,7 @@

Links for tomlkit

- tomlkit-0.5.2.tar.gz
+ tomlkit-0.5.2.tar.gz
diff --git a/tests/repositories/fixtures/pypi.org/dists/SQLAlchemy-1.2.12.tar.gz b/tests/repositories/fixtures/pypi.org/dists/SQLAlchemy-1.2.12.tar.gz deleted file mode 100644 index 93d2f170a99..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/SQLAlchemy-1.2.12.tar.gz and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/Twisted-18.9.0.tar.bz2 b/tests/repositories/fixtures/pypi.org/dists/Twisted-18.9.0.tar.bz2 deleted file mode 100644 index ae3d89981c6..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/Twisted-18.9.0.tar.bz2 and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/black-19.10b0-py36-none-any.whl b/tests/repositories/fixtures/pypi.org/dists/black-19.10b0-py36-none-any.whl deleted file mode 100644 index 3d031c0f3ef..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/black-19.10b0-py36-none-any.whl and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/black-21.11b0-py3-none-any.whl b/tests/repositories/fixtures/pypi.org/dists/black-21.11b0-py3-none-any.whl deleted file mode 100644 index 50daa412ff7..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/black-21.11b0-py3-none-any.whl and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/cleo-1.0.0a5-py3-none-any.whl b/tests/repositories/fixtures/pypi.org/dists/cleo-1.0.0a5-py3-none-any.whl deleted file mode 100644 index 42ec0d1f0d1..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/cleo-1.0.0a5-py3-none-any.whl and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/clikit-0.2.4-py2.py3-none-any.whl b/tests/repositories/fixtures/pypi.org/dists/clikit-0.2.4-py2.py3-none-any.whl deleted file mode 100644 index 87db51230e3..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/clikit-0.2.4-py2.py3-none-any.whl and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/discord.py-2.0.0-py3-none-any.whl b/tests/repositories/fixtures/pypi.org/dists/discord.py-2.0.0-py3-none-any.whl deleted file mode 100644 index 5a9e7fab81d..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/discord.py-2.0.0-py3-none-any.whl and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/futures-3.2.0-py2-none-any.whl b/tests/repositories/fixtures/pypi.org/dists/futures-3.2.0-py2-none-any.whl deleted file mode 100644 index c0659c1a082..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/futures-3.2.0-py2-none-any.whl and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/futures-3.2.0.tar.gz b/tests/repositories/fixtures/pypi.org/dists/futures-3.2.0.tar.gz deleted file mode 100644 index 607de403f72..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/futures-3.2.0.tar.gz and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/importlib_metadata-1.7.0-py2.py3-none-any.whl b/tests/repositories/fixtures/pypi.org/dists/importlib_metadata-1.7.0-py2.py3-none-any.whl deleted file mode 100644 index cfcb2db4d4a..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/importlib_metadata-1.7.0-py2.py3-none-any.whl and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/ipython-5.7.0-py2-none-any.whl b/tests/repositories/fixtures/pypi.org/dists/ipython-5.7.0-py2-none-any.whl deleted file mode 100644 index 7c6b343f063..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/ipython-5.7.0-py2-none-any.whl and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/ipython-5.7.0-py3-none-any.whl b/tests/repositories/fixtures/pypi.org/dists/ipython-5.7.0-py3-none-any.whl deleted file mode 100644 index 1ab712385ba..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/ipython-5.7.0-py3-none-any.whl and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/ipython-5.7.0.tar.gz b/tests/repositories/fixtures/pypi.org/dists/ipython-5.7.0.tar.gz deleted file mode 100644 index ba5475f5e5b..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/ipython-5.7.0.tar.gz and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/ipython-7.5.0-py3-none-any.whl b/tests/repositories/fixtures/pypi.org/dists/ipython-7.5.0-py3-none-any.whl deleted file mode 100644 index cad0079ba4a..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/ipython-7.5.0-py3-none-any.whl and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/isort-4.3.4-py2-none-any.whl b/tests/repositories/fixtures/pypi.org/dists/isort-4.3.4-py2-none-any.whl deleted file mode 100644 index 00f4c5e04e9..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/isort-4.3.4-py2-none-any.whl and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/isort-4.3.4-py3-none-any.whl b/tests/repositories/fixtures/pypi.org/dists/isort-4.3.4-py3-none-any.whl deleted file mode 100644 index 8327ec79c91..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/isort-4.3.4-py3-none-any.whl and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/isort-4.3.4.tar.gz b/tests/repositories/fixtures/pypi.org/dists/isort-4.3.4.tar.gz deleted file mode 100644 index 25e7ed6f3ea..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/isort-4.3.4.tar.gz and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/jupyter-1.0.0.tar.gz b/tests/repositories/fixtures/pypi.org/dists/jupyter-1.0.0.tar.gz deleted file mode 100644 index 59e0d68311c..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/jupyter-1.0.0.tar.gz and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/pastel-0.1.0.tar.gz b/tests/repositories/fixtures/pypi.org/dists/pastel-0.1.0.tar.gz deleted file mode 100644 index a1399348828..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/pastel-0.1.0.tar.gz and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/pytest-3.5.0-py2.py3-none-any.whl b/tests/repositories/fixtures/pypi.org/dists/pytest-3.5.0-py2.py3-none-any.whl deleted file mode 100644 index 911f902125d..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/pytest-3.5.0-py2.py3-none-any.whl and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/pytest-3.5.1-py2.py3-none-any.whl b/tests/repositories/fixtures/pypi.org/dists/pytest-3.5.1-py2.py3-none-any.whl deleted file mode 100644 index 4eb8ce84187..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/pytest-3.5.1-py2.py3-none-any.whl and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/python-language-server-0.21.2.tar.gz b/tests/repositories/fixtures/pypi.org/dists/python-language-server-0.21.2.tar.gz deleted file mode 100644 index 5a1cedbd757..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/python-language-server-0.21.2.tar.gz and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/setuptools-67.6.1-py3-none-any.whl b/tests/repositories/fixtures/pypi.org/dists/setuptools-67.6.1-py3-none-any.whl new file mode 100644 index 00000000000..4b7ffd2e49e Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/dists/setuptools-67.6.1-py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/dists/tomlkit-0.5.2.tar.gz b/tests/repositories/fixtures/pypi.org/dists/tomlkit-0.5.2.tar.gz deleted file mode 100644 index 18a6aed241d..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/tomlkit-0.5.2.tar.gz and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/tomlkit-0.5.3.tar.gz b/tests/repositories/fixtures/pypi.org/dists/tomlkit-0.5.3.tar.gz deleted file mode 100644 index c4a7f0243c6..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/tomlkit-0.5.3.tar.gz and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/dists/wheel-0.40.0-py3-none-any.whl b/tests/repositories/fixtures/pypi.org/dists/wheel-0.40.0-py3-none-any.whl new file mode 100644 index 00000000000..410132385bb Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/dists/wheel-0.40.0-py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/dists/zipp-3.5.0-py3-none-any.whl b/tests/repositories/fixtures/pypi.org/dists/zipp-3.5.0-py3-none-any.whl deleted file mode 100644 index 9b606195459..00000000000 Binary files a/tests/repositories/fixtures/pypi.org/dists/zipp-3.5.0-py3-none-any.whl and /dev/null differ diff --git a/tests/repositories/fixtures/pypi.org/generate.py b/tests/repositories/fixtures/pypi.org/generate.py new file mode 100644 index 00000000000..caefbe72b9e --- /dev/null +++ b/tests/repositories/fixtures/pypi.org/generate.py @@ -0,0 +1,722 @@ +""" +This is a helper script built to generate mocked PyPI json files and release files. Executing the script does the +following for a specified list of releases. + +1. Fetch relevant project json file from https://pypi.org/simple/. +2. Fetch relevant release json file from https://pypi.org/pypi///json. +3. Download all files (if not otherwise specified) for each release. +4. Stub (zero-out) all files not relevant for test cases, only sdist and bdist metadata is retained. + a, We also retain `__init__.py` files as some packages use it for dynamic version detection when building sdist. + b. Some release bdist, notably that of setuptools, wheel and poetry-core are retained as is in the `dist/` directory + as these are required for some test cases. + c. All stubbed files are written out to `stubbed/` directory. + d. All stubbed files produce a consistent hash. +5. New checksums (sha256 and md5) are calculated and replaced in the following locations. + a. All mocked json files. + b. Installation lock file fixtures. + c. Legacy Repository mocked html files. +6. All unwanted files and metadata is removed from any json file written. This includes any release versions removed. +7. A distribution hash getter fixture is generated. + +The following also applies. + +1. Local json files are preferred over remote ones unless `refresh=True` is specified. + a. On removal or addition of a new version for a package, the base package must be refreshed. Otherwise, + the new files added will not reflect in the file. + b. You can also remove the existing file and re-run the script. +2. Download of distributions already present in `dist/` is skipped. +3. The `stubbed/` directory is cleared for each run. +""" + +from __future__ import annotations + +import dataclasses +import hashlib +import io +import json +import logging +import os +import re +import shutil +import sys +import tarfile +import zipfile + +from abc import abstractmethod +from functools import cached_property +from gzip import GzipFile +from pathlib import Path +from typing import TYPE_CHECKING +from typing import Any +from typing import Callable +from typing import Iterator + +from poetry.core.masonry.builders.sdist import SdistBuilder +from poetry.core.packages.package import Package +from tests.helpers import FIXTURE_PATH +from tests.helpers import FIXTURE_PATH_DISTRIBUTIONS +from tests.helpers import FIXTURE_PATH_INSTALLATION +from tests.helpers import FIXTURE_PATH_REPOSITORIES +from tests.helpers import FIXTURE_PATH_REPOSITORIES_LEGACY +from tests.helpers import FIXTURE_PATH_REPOSITORIES_PYPI + +from poetry.repositories.pypi_repository import PyPiRepository + + +if TYPE_CHECKING: + from poetry.core.packages.utils.link import Link + +logger = logging.getLogger("pypi.generator") +logger.setLevel(logging.INFO) +handler = logging.StreamHandler(sys.stdout) +handler.setFormatter(logging.Formatter("%(asctime)s %(message)s")) +logger.addHandler(handler) + + +@dataclasses.dataclass +class ReleaseSpecification: + name: str + version: str + stub: bool = True + is_fake: bool = False + + def __eq__(self, other: object) -> bool: + if isinstance(other, ReleaseSpecification): + return self.name == other.name and self.version == other.version + return False + + +@dataclasses.dataclass +class ProjectSpecification: + name: str + ignore_missing_files: bool = False + + def __eq__(self, other: object) -> bool: + if isinstance(other, ProjectSpecification): + return self.name == other.name + return False + + +PROJECT_SPECS = [ + ProjectSpecification("requests", ignore_missing_files=True), +] + +RELEASE_SPECS = [ + ReleaseSpecification("attrs", "17.4.0"), + ReleaseSpecification("black", "19.10b0"), + ReleaseSpecification("black", "21.11b0"), + ReleaseSpecification("cachecontrol", "0.12.5", is_fake=True), + ReleaseSpecification("cleo", "1.0.0a5"), + ReleaseSpecification("clikit", "0.2.4"), + # tests.installation.test_installer.test_installer_with_pypi_repository on windows + ReleaseSpecification("colorama", "0.3.9"), + ReleaseSpecification("discord-py", "2.0.0"), + ReleaseSpecification("funcsigs", "1.0.2", is_fake=True), + ReleaseSpecification("futures", "3.2.0"), + ReleaseSpecification("hbmqtt", "0.9.6", is_fake=True), + ReleaseSpecification("importlib-metadata", "1.7.0", is_fake=True), + ReleaseSpecification("ipython", "4.1.0rc1", is_fake=True), + # tests.repositories.test_legacy_repository.test_get_package_from_both_py2_and_py3_specific_wheels + # tests.repositories.test_legacy_repository.test_get_package_retrieves_non_sha256_hashes_mismatching_known_hash + ReleaseSpecification("ipython", "5.7.0"), + # tests.repositories.test_legacy_repository.test_get_package_retrieves_non_sha256_hashes + # tests.repositories.test_legacy_repository.test_get_package_with_dist_and_universal_py3_wheel + ReleaseSpecification("ipython", "7.5.0"), + ReleaseSpecification("isort", "4.3.4"), + ReleaseSpecification("isort-metadata", "4.3.4", is_fake=True), + ReleaseSpecification("jupyter", "1.0.0"), + ReleaseSpecification("lockfile", "0.12.2", is_fake=True), + ReleaseSpecification("more-itertools", "4.1.0"), + ReleaseSpecification("pastel", "0.1.0"), + ReleaseSpecification("pluggy", "0.6.0"), + ReleaseSpecification("poetry", "0.12.4", is_fake=True), + ReleaseSpecification("poetry-core", "1.5.0", stub=False), + ReleaseSpecification("py", "1.5.3"), + ReleaseSpecification("pygame-music-grid", "3.13", is_fake=True), + ReleaseSpecification("pylev", "1.3.0", is_fake=True), + ReleaseSpecification("pytest", "3.5.0"), + ReleaseSpecification("pytest", "3.5.1"), + # tests.repositories.test_legacy_repository.test_get_package_information_skips_dependencies_with_invalid_constraints + ReleaseSpecification("python-language-server", "0.21.2"), + ReleaseSpecification("pyyaml", "3.13.0", is_fake=True), + ReleaseSpecification("requests", "2.18.4"), + ReleaseSpecification("setuptools", "39.2.0", is_fake=True), + ReleaseSpecification("setuptools", "67.6.1", stub=False), + ReleaseSpecification("six", "1.11.0"), + ReleaseSpecification("sqlalchemy", "1.2.12"), + ReleaseSpecification("toga", "0.3.0", is_fake=True), + ReleaseSpecification("tomlkit", "0.5.2"), + ReleaseSpecification("tomlkit", "0.5.3"), + ReleaseSpecification("trackpy", "0.4.1", is_fake=True), + ReleaseSpecification("twisted", "18.9.0"), + ReleaseSpecification("wheel", "0.40.0", stub=False), + ReleaseSpecification("zipp", "3.5.0"), +] + + +@dataclasses.dataclass(frozen=True) +class _ReleaseFileLocations: + dist: Path = dataclasses.field( + default=FIXTURE_PATH_REPOSITORIES_PYPI.joinpath("dist") + ) + stubbed: Path = dataclasses.field( + default=FIXTURE_PATH_REPOSITORIES_PYPI.joinpath("stubbed") + ) + demo: Path = dataclasses.field(default=FIXTURE_PATH_DISTRIBUTIONS) + + +RELEASE_FILE_LOCATIONS = _ReleaseFileLocations() + + +@dataclasses.dataclass +class ReleaseFileMetadata: + path: Path + md5: str = dataclasses.field(init=False) + sha256: str = dataclasses.field(init=False) + + def __post_init__(self) -> None: + data = self.path.read_bytes() + self.sha256 = hashlib.sha256(data).hexdigest() + self.md5 = hashlib.md5(data).hexdigest() + + +class _ReleaseFileCollection: + def __init__(self, locations: list[Path] | None = None) -> None: + self.locations = locations or [ + RELEASE_FILE_LOCATIONS.dist, + RELEASE_FILE_LOCATIONS.stubbed, + ] + + def filename_exists(self, filename: str) -> bool: + return any(location.joinpath(filename).exists() for location in self.locations) + + def find(self, filename: str) -> ReleaseFileMetadata | None: + for location in self.locations: + if location.joinpath(filename).exists(): + return ReleaseFileMetadata(location) + return None + + def list(self, location: Path | None) -> Iterator[ReleaseFileMetadata]: + locations = [location] if location is not None else self.locations + for candidate in locations: + for file in candidate.glob("*.tar.*"): + yield ReleaseFileMetadata(file) + + for file in candidate.glob("*.zip"): + yield ReleaseFileMetadata(file) + + for file in candidate.glob("*.whl"): + yield ReleaseFileMetadata(file) + + +RELEASE_FILE_COLLECTION = _ReleaseFileCollection() + + +def generate_distribution_hashes_fixture(files: list[ReleaseFileMetadata]) -> None: + fixture_py = FIXTURE_PATH_REPOSITORIES / "distribution_hashes.py" + files.sort(key=lambda f: f.path.name) + + text = ",\n".join( + [ + f' "{file.path.name}": DistributionHash(\n' + f' "{file.sha256}",\n' + f' "{file.md5}",\n' + f" )" + for file in files + ] + ) + + logger.info( + "Generating fixture file at %s", + fixture_py.relative_to(FIXTURE_PATH.parent.parent), + ) + + fixture_py.write_text( + f"""# this file is generated by {Path(__file__).relative_to(FIXTURE_PATH.parent.parent)} +from __future__ import annotations + +import dataclasses + +from typing import TYPE_CHECKING + +import pytest + + +if TYPE_CHECKING: + from tests.types import DistributionHashGetter + + +@dataclasses.dataclass +class DistributionHash: + sha256: str = "" + md5: str = "" + + +KNOWN_DISTRIBUTION_HASHES = {{ +{text}, +}} + + +@pytest.fixture +def dist_hash_getter() -> DistributionHashGetter: + def get_hash(name: str) -> DistributionHash: + return KNOWN_DISTRIBUTION_HASHES.get(name, DistributionHash()) + + return get_hash +""", + encoding="utf-8", + ) + + +def cleanup_legacy_html_hashes(metadata: ReleaseFileMetadata) -> None: + path = FIXTURE_PATH_REPOSITORIES_LEGACY / f"{metadata.path.name}.html" + + for filepath in [path, *list(path.parent.glob(f"{path.stem}-*.html"))]: + if not filepath.exists(): + return None + + existing_content = filepath.read_text(encoding="utf-8") + + content = re.sub( + f"{filepath.name}#sha256=[A-Fa-f0-9]{{64}}", + f"{filepath.name}#sha256={metadata.sha256}", + existing_content, + ) + content = re.sub( + f'data-dist-info-metadata="sha256=[A-Fa-f0-9]{{64}}">{filepath.name}<', + f'data-dist-info-metadata="sha256={metadata.sha256}">{filepath.name}<', + content, + ) + content = re.sub( + f"{filepath.name}#md5=[A-Fa-f0-9]{{32}}", + f"{filepath.name}#md5={metadata.md5}", + content, + ) + content = re.sub( + f'data-dist-info-metadata="md5=[A-Fa-f0-9]{{32}}">{filepath.name}<', + f'data-dist-info-metadata="md5={metadata.md5}">{filepath.name}<', + content, + ) + + if existing_content != content: + logger.info("Rewriting hashes in %s", filepath) + filepath.write_text(content, encoding="utf-8") + + +def cleanup_installation_fixtures(metadata: ReleaseFileMetadata) -> None: + for file in FIXTURE_PATH_INSTALLATION.glob("*.test"): + original_content = file.read_text(encoding="utf-8") + + content = re.sub( + f'file = "{metadata.path.name}", hash = "sha256:[A-Fa-f0-9]{{64}}"', + f'file = "{metadata.path.name}", hash = "sha256:{metadata.sha256}"', + original_content, + ) + content = re.sub( + f'file = "{metadata.path.name}", hash = "md5:[A-Fa-f0-9]{{32}}"', + f'file = "{metadata.path.name}", hash = "md5:{metadata.md5}"', + content, + ) + + if content != original_content: + logger.info("Rewriting hashes in %s", file) + file.write_text(content, encoding="utf-8") + + +class MockedRepositoryFactory: + def __init__( + self, + release_specs: list[ReleaseSpecification], + project_specs: list[ProjectSpecification], + pypi: PyPiRepository | None = None, + refresh: bool = False, + ) -> None: + self.pypi = pypi or PyPiRepository(disable_cache=True) + self.packages: dict[str, MockedProject] = {} + self.release_specs = release_specs + self.project_specs = project_specs + self.refresh = refresh + + def process(self) -> None: + for file in FIXTURE_PATH_REPOSITORIES_PYPI.joinpath("stubbed").iterdir(): + if file.is_file(): + file.unlink() + + files = [] + + for dist in self.release_specs: + files.extend(self.add_release_file(dist)) + + for pkg in self.packages.values(): + pkg.write() + + files.extend(RELEASE_FILE_COLLECTION.list(RELEASE_FILE_LOCATIONS.demo)) + generate_distribution_hashes_fixture(files=files) + + @cached_property + def known_releases_by_project(self) -> dict[str, list[str]]: + result: dict[str, list[str]] = {} + + for package in self.packages.values(): + if package.name not in result: + result[package.name] = [] + + for release in package.releases: + result[package.name].append(release.version) + + result[package.name].sort() + + return result + + def clean(self) -> None: + ignore_missing_files = { + project.name + for project in self.project_specs + if project.ignore_missing_files + } + json_fixture_dir = FIXTURE_PATH_REPOSITORIES_PYPI.joinpath("json") + + for file in json_fixture_dir.glob("*.json"): + if file.stem not in self.packages: + logger.info( + "Removing %s", file.relative_to(FIXTURE_PATH_REPOSITORIES_PYPI) + ) + file.unlink() + continue + + package = self.packages[file.stem] + + if package.is_fake: + continue + + existing_content = file.read_text(encoding="utf-8") + data = json.loads(existing_content) + + if "versions" in data: + data["versions"] = self.known_releases_by_project[file.stem] + + if "files" in data and package.name not in ignore_missing_files: + data["files"] = [ + _file + for _file in data["files"] + if RELEASE_FILE_COLLECTION.filename_exists(_file["filename"]) + ] + + content = json.dumps(data, ensure_ascii=False, indent=2) + if existing_content != content: + logger.info( + "Cleaning up %s", file.relative_to(FIXTURE_PATH_REPOSITORIES_PYPI) + ) + file.write_text(content + "\n", encoding="utf-8") + + for file in json_fixture_dir.glob("*/*.json"): + if ( + file.parent.name in self.packages + and self.packages[file.parent.name].is_fake + ): + logger.info( + "Skipping clean up for %s (fake)", + file.relative_to(FIXTURE_PATH_REPOSITORIES_PYPI), + ) + continue + + if ( + file.parent.name not in self.packages + or file.stem not in self.known_releases_by_project[file.parent.stem] + ): + logger.info( + "Removing %s", file.relative_to(FIXTURE_PATH_REPOSITORIES_PYPI) + ) + file.unlink() + + if len(list(file.parent.iterdir())) == 0: + logger.info( + "Removing empty directory %s", + file.parent.relative_to(FIXTURE_PATH_REPOSITORIES_PYPI), + ) + file.parent.rmdir() + + def add_release_file(self, spec: ReleaseSpecification) -> list[ReleaseFileMetadata]: + logger.info("Processing release %s-%s", spec.name, spec.version) + + if spec.name not in self.packages: + prefer_remote = self.refresh and not spec.is_fake + self.packages[spec.name] = MockedProject( + spec.name, + self.get_json_data(spec.name, None, prefer_remote=prefer_remote), + is_fake=spec.is_fake, + ) + + package = self.packages[spec.name] + release = MockedRelease( + spec.name, spec.version, self.get_json_data(spec.name, spec.version) + ) + + links = ( + [] + if spec.is_fake + else self.pypi.find_links_for_package(Package(spec.name, spec.version)) + ) + + for link in links: + logger.info("Processing release file %s", link.filename) + + existing_release_file_location = RELEASE_FILE_LOCATIONS.dist.joinpath( + link.filename + ) + if existing_release_file_location.exists(): + logger.info( + "Release file already exists at %s, skipping", + existing_release_file_location.relative_to( + FIXTURE_PATH_REPOSITORIES_PYPI + ), + ) + # we do not re-download or stub this + existing_file = RELEASE_FILE_COLLECTION.find(link.filename) + assert existing_file is not None + release.files.append(existing_file) + + continue + + if not spec.stub and link.is_wheel: + file = self.copy_as_is(link) + elif link.is_wheel or (link.is_sdist and link.filename.endswith(".zip")): + file = self.process_zipfile(link) + else: + file = self.process_tarfile(link) + + release.add_file(file) + + if not spec.is_fake: + release.write() + + package.add_release(release) + return release.files + + @staticmethod + def should_preserve_file_content_check(link: Link) -> Callable[[str], bool]: + def sdist_check(filename: str) -> bool: + return filename in { + "pyproject.toml", + "setup.py", + "setup.cfg", + "PKG-INFO", + "__init__.py", + "requires.txt", + "requirements.txt", + "entry_points.txt", + "top_level.txt", + } + + bdist_preserve_regex = re.compile(r"^((?!/).)*\.dist-info/((?!/).)*$") + + def bdist_check(filename: str) -> bool: + return bool(bdist_preserve_regex.match(filename)) + + if link.is_sdist: + return sdist_check + + return bdist_check + + def copy_as_is(self, link: Link) -> ReleaseFileMetadata: + dst = FIXTURE_PATH_REPOSITORIES_PYPI / "dists" / link.filename + logger.info( + "Preserving release file from %s to %s", + link.url, + dst.relative_to(FIXTURE_PATH_REPOSITORIES_PYPI), + ) + + with self.pypi._cached_or_downloaded_file(link) as src: + shutil.copy(src, dst) + + return ReleaseFileMetadata(dst) + + def process_zipfile(self, link: Link) -> ReleaseFileMetadata: + dst = FIXTURE_PATH_REPOSITORIES_PYPI / "stubbed" / link.filename + is_protected = self.should_preserve_file_content_check(link) + + logger.info( + "Stubbing release file from %s to %s", + link.url, + dst.relative_to(FIXTURE_PATH_REPOSITORIES_PYPI), + ) + + with self.pypi._cached_or_downloaded_file(link) as src, zipfile.ZipFile( + dst, "w", compression=zipfile.ZIP_DEFLATED + ) as stubbed_sdist, zipfile.ZipFile(src) as zf: + for member in zf.infolist(): + if not is_protected(member.filename): + logger.debug("Stubbing file %s(%s)", link.filename, member.filename) + stubbed_sdist.writestr(member, io.BytesIO().getvalue()) + else: + logger.debug( + "Preserving file %s(%s)", link.filename, member.filename + ) + stubbed_sdist.writestr(member, zf.read(member.filename)) + + return ReleaseFileMetadata(dst) + + def process_tarfile(self, link: Link) -> ReleaseFileMetadata: + dst = FIXTURE_PATH_REPOSITORIES_PYPI / "stubbed" / link.filename + is_protected = self.should_preserve_file_content_check(link) + + logger.info( + "Stubbing release file from %s to %s", + link.url, + dst.relative_to(FIXTURE_PATH_REPOSITORIES_PYPI), + ) + + with self.pypi._cached_or_downloaded_file(link) as src, GzipFile( + dst.as_posix(), mode="wb", mtime=0 + ) as gz, tarfile.TarFile( + dst, mode="w", fileobj=gz, format=tarfile.PAX_FORMAT + ) as dst_tf, tarfile.open(src, "r") as src_tf: + for member in src_tf.getmembers(): + member.mtime = 0 + member = SdistBuilder.clean_tarinfo(member) + + if member.isfile() and not is_protected(Path(member.name).name): + logger.debug("Stubbing file %s(%s)", link.filename, member.name) + file_obj = io.BytesIO() + member.size = file_obj.getbuffer().nbytes + dst_tf.addfile(member, file_obj) + else: + logger.debug("Preserving file %s(%s)", link.filename, member.name) + dst_tf.addfile(member, src_tf.extractfile(member)) + + os.utime(dst, (0, 0)) + + return ReleaseFileMetadata(dst) + + def get_json_data( + self, name: str, version: str | None, prefer_remote: bool = False + ) -> dict[str, Any]: + json_fixture_dir = FIXTURE_PATH_REPOSITORIES_PYPI / "json" + + if version is None: + path = json_fixture_dir / f"{name}.json" + else: + path = json_fixture_dir / name / f"{version}.json" + + data: dict[str, Any] = {} + + if path.exists(): + data = json.loads(path.read_text()) + + if prefer_remote and (remote_data := self._get_remote_json_data(name, version)): + return remote_data + + logger.info( + "Loading existing json fixture at %s", + path.relative_to(json_fixture_dir), + ) + return data + + def _get_remote_json_data( + self, name: str, version: str | None = None + ) -> dict[str, Any]: + if version is None: + logger.info("Fetching remote json via https://pypi.org/simple/%s", name) + response = self.pypi._get( + f"simple/{name}/", + headers={"Accept": "application/vnd.pypi.simple.v1+json"}, + ) + else: + logger.info( + "Fetching remote json via https://pypi.org/pypi/%s/%s/json", + name, + version, + ) + + response = self.pypi._get(f"pypi/{name}/{version}/json") + + return response or {} + + +class MockedJsonFile: + def __init__(self, data: dict[str, Any]) -> None: + self.data = data + self._content = json.dumps(data, ensure_ascii=False, indent=2) + + @property + @abstractmethod + def json_filepath(self) -> Path: ... + + def write(self) -> None: + self.data.get("info", {"description": ""})["description"] = "" + + if "vulnerabilities" in self.data: + self.data["vulnerabilities"] = [] + + content = json.dumps(self.data, ensure_ascii=False, indent=2) + + if not self.json_filepath.exists() or self._content != content: + logger.info("Writing json content to %s", self.json_filepath) + self.json_filepath.parent.mkdir(exist_ok=True) + self.json_filepath.write_text(content + "\n", encoding="utf-8") + self._content = content + + +class MockedRelease(MockedJsonFile): + def __init__(self, name: str, version: str, data: dict[str, Any]) -> None: + self.name = name + self.version = version + self.files: list[ReleaseFileMetadata] = [] + super().__init__(data=data) + + @property + def json_filepath(self) -> Path: + return ( + FIXTURE_PATH_REPOSITORIES_PYPI / "json" / self.name / f"{self.version}.json" + ) + + def add_file(self, metadata: ReleaseFileMetadata) -> None: + self.files.append(metadata) + + for item in self.data["urls"]: + if item["filename"] == metadata.path.name: + item["digests"] = {"md5": metadata.md5, "sha256": metadata.sha256} + item["md5_digest"] = metadata.md5 + + +class MockedProject(MockedJsonFile): + def __init__(self, name: str, data: dict[str, Any], is_fake: bool = False) -> None: + self.name = name + self.releases: list[MockedRelease] = [] + self.is_fake: bool = is_fake + super().__init__(data=data) + + @property + def json_filepath(self) -> Path: + return FIXTURE_PATH_REPOSITORIES_PYPI / "json" / f"{self.name}.json" + + def add_release(self, release: MockedRelease) -> None: + self.releases.append(release) + + if self.is_fake: + return + + for file in release.files: + for item in self.data.get("files", []): + if item["filename"] == file.path.name: + item["hashes"] = {"md5": file.md5, "sha256": file.sha256} + + cleanup_legacy_html_hashes(file) + cleanup_installation_fixtures(file) + + def __eq__(self, other: object) -> bool: + if isinstance(other, MockedProject): + return self.name == other.name + + if isinstance(other, str): + return self.name == other + + return False + + +if __name__ == "__main__": + factory = MockedRepositoryFactory( + RELEASE_SPECS, PROJECT_SPECS, PyPiRepository(disable_cache=True), refresh=False + ) + factory.process() + factory.clean() diff --git a/tests/repositories/fixtures/pypi.org/json/attrs.json b/tests/repositories/fixtures/pypi.org/json/attrs.json index aa1e27f5ff2..e34e8a1091e 100644 --- a/tests/repositories/fixtures/pypi.org/json/attrs.json +++ b/tests/repositories/fixtures/pypi.org/json/attrs.json @@ -5,16 +5,16 @@ "filename": "attrs-17.4.0-py2.py3-none-any.whl", "url": "https://files.pythonhosted.org/packages/b5/60/4e178c1e790fd60f1229a9b3cb2f8bc2f4cc6ff2c8838054c142c70b5adc/attrs-17.4.0-py2.py3-none-any.whl", "hashes": { - "md5": "5835a573b3f0316e1602dac3fd9c1daf", - "sha256": "a17a9573a6f475c99b551c0e0a812707ddda1ec9653bed04c13841404ed6f450" + "md5": "9d32f2b5a93343e01f54d87740f2da60", + "sha256": "d38e57f381e891928357c68e300d28d3d4dcddc50486d5f8dfaf743d40477619" } }, { "filename": "attrs-17.4.0.tar.gz", "url": "https://files.pythonhosted.org/packages/8b/0b/a06cfcb69d0cb004fde8bc6f0fd192d96d565d1b8aa2829f0f20adb796e5/attrs-17.4.0.tar.gz", "hashes": { - "md5": "d7a89063b2e0fd36bd82389c4d82821d", - "sha256": "1c7960ccfd6a005cd9f7ba884e6316b5e430a3f1a6c37c5f87d8b43f83b54ec9" + "md5": "c03e5b3608d9071fbd098850d8922668", + "sha256": "eb7536a1e6928190b3008c5b350bdf9850d619fff212341cd096f87a27a5e564" } } ], diff --git a/tests/repositories/fixtures/pypi.org/json/attrs/17.4.0.json b/tests/repositories/fixtures/pypi.org/json/attrs/17.4.0.json index e7cc36a48d6..f5f127c8a1e 100644 --- a/tests/repositories/fixtures/pypi.org/json/attrs/17.4.0.json +++ b/tests/repositories/fixtures/pypi.org/json/attrs/17.4.0.json @@ -65,13 +65,13 @@ { "comment_text": "", "digests": { - "md5": "5835a573b3f0316e1602dac3fd9c1daf", - "sha256": "a17a9573a6f475c99b551c0e0a812707ddda1ec9653bed04c13841404ed6f450" + "md5": "9d32f2b5a93343e01f54d87740f2da60", + "sha256": "d38e57f381e891928357c68e300d28d3d4dcddc50486d5f8dfaf743d40477619" }, "downloads": -1, "filename": "attrs-17.4.0-py2.py3-none-any.whl", "has_sig": true, - "md5_digest": "5835a573b3f0316e1602dac3fd9c1daf", + "md5_digest": "9d32f2b5a93343e01f54d87740f2da60", "packagetype": "bdist_wheel", "python_version": "py2.py3", "size": 31658, @@ -81,13 +81,13 @@ { "comment_text": "", "digests": { - "md5": "d7a89063b2e0fd36bd82389c4d82821d", - "sha256": "1c7960ccfd6a005cd9f7ba884e6316b5e430a3f1a6c37c5f87d8b43f83b54ec9" + "md5": "c03e5b3608d9071fbd098850d8922668", + "sha256": "eb7536a1e6928190b3008c5b350bdf9850d619fff212341cd096f87a27a5e564" }, "downloads": -1, "filename": "attrs-17.4.0.tar.gz", "has_sig": true, - "md5_digest": "d7a89063b2e0fd36bd82389c4d82821d", + "md5_digest": "c03e5b3608d9071fbd098850d8922668", "packagetype": "sdist", "python_version": "source", "size": 97071, diff --git a/tests/repositories/fixtures/pypi.org/json/black.json b/tests/repositories/fixtures/pypi.org/json/black.json index baaeae83e0a..1b597a5da0b 100644 --- a/tests/repositories/fixtures/pypi.org/json/black.json +++ b/tests/repositories/fixtures/pypi.org/json/black.json @@ -3,7 +3,8 @@ { "filename": "black-19.10b0-py36-none-any.whl", "hashes": { - "sha256": "1b30e59be925fafc1ee4565e5e08abef6b03fe455102883820fe5ee2e4734e0b" + "md5": "4a420234749e1ea350581160ef51cd02", + "sha256": "3471ff321348d851b6f3047f4ed42c88622ac038caf7c2d160bd653334c88e88" }, "requires-python": ">=3.6", "url": "https://files.pythonhosted.org/packages/fd/bb/ad34bbc93d1bea3de086d7c59e528d4a503ac8fe318bd1fa48605584c3d2/black-19.10b0-py36-none-any.whl", @@ -12,7 +13,8 @@ { "filename": "black-19.10b0.tar.gz", "hashes": { - "sha256": "c2edb73a08e9e0e6f65a0e6af18b059b8b1cdd5bef997d7a0b181df93dc81539" + "md5": "c383543109a66a5a99113e6326db5251", + "sha256": "6cada614d5d2132698c6d5fff384657273d922c4fffa6a2f0de9e03e25b8913a" }, "requires-python": ">=3.6", "url": "https://files.pythonhosted.org/packages/b0/dc/ecd83b973fb7b82c34d828aad621a6e5865764d52375b8ac1d7a45e23c8d/black-19.10b0.tar.gz", @@ -21,7 +23,8 @@ { "filename": "black-21.11b0-py3-none-any.whl", "hashes": { - "sha256": "0b1f66cbfadcd332ceeaeecf6373d9991d451868d2e2219ad0ac1213fb701117" + "md5": "294e105f34e2e21286a49bfcfb8fb6ae", + "sha256": "e16b6879ed61f9268994b879174fad1cb2319a651afd20f8cf036428ac65f846" }, "requires-python": ">=3.6.2", "url": "https://files.pythonhosted.org/packages/3d/ad/1cf514e7f9ee4c3d8df7c839d7977f7605ad76557f3fca741ec67f76dba6/black-21.11b0-py3-none-any.whl", @@ -30,7 +33,8 @@ { "filename": "black-21.11b0.tar.gz", "hashes": { - "sha256": "83f3852301c8dcb229e9c444dd79f573c8d31c7c2dad9bbaaa94c808630e32aa" + "md5": "f01267bf2613f825dd6684629c1c829e", + "sha256": "f23c482185d842e2f19d506e55c004061167e3c677c063ecd721042c62086ada" }, "requires-python": ">=3.6.2", "url": "https://files.pythonhosted.org/packages/2f/db/03e8cef689ab0ff857576ee2ee288d1ff2110ef7f3a77cac62e61f18acaf/black-21.11b0.tar.gz", diff --git a/tests/repositories/fixtures/pypi.org/json/black/19.10b0.json b/tests/repositories/fixtures/pypi.org/json/black/19.10b0.json index 3b766a815d5..8a174321690 100644 --- a/tests/repositories/fixtures/pypi.org/json/black/19.10b0.json +++ b/tests/repositories/fixtures/pypi.org/json/black/19.10b0.json @@ -17,7 +17,7 @@ "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Quality Assurance" ], - "description": "![Black Logo](https://raw.githubusercontent.com/psf/black/master/docs/_static/logo2-readme.png)\n\n

The Uncompromising Code Formatter

\n\n

\n\"Build\n\"Documentation\n\"Coverage\n\"License:\n\"PyPI\"\n\"Downloads\"\n\"Code\n

\n\n> “Any color you like.”\n\n_Black_ is the uncompromising Python code formatter. By using it, you agree to cede\ncontrol over minutiae of hand-formatting. In return, _Black_ gives you speed,\ndeterminism, and freedom from `pycodestyle` nagging about formatting. You will save time\nand mental energy for more important matters.\n\nBlackened code looks the same regardless of the project you're reading. Formatting\nbecomes transparent after a while and you can focus on the content instead.\n\n_Black_ makes code review faster by producing the smallest diffs possible.\n\nTry it out now using the [Black Playground](https://black.now.sh). Watch the\n[PyCon 2019 talk](https://youtu.be/esZLCuWs_2Y) to learn more.\n\n---\n\n_Contents:_ **[Installation and usage](#installation-and-usage)** |\n**[Code style](#the-black-code-style)** | **[pyproject.toml](#pyprojecttoml)** |\n**[Editor integration](#editor-integration)** | **[blackd](#blackd)** |\n**[Version control integration](#version-control-integration)** |\n**[Ignoring unmodified files](#ignoring-unmodified-files)** | **[Used by](#used-by)** |\n**[Testimonials](#testimonials)** | **[Show your style](#show-your-style)** |\n**[Contributing](#contributing-to-black)** | **[Change Log](#change-log)** |\n**[Authors](#authors)**\n\n---\n\n## Installation and usage\n\n### Installation\n\n_Black_ can be installed by running `pip install black`. It requires Python 3.6.0+ to\nrun but you can reformat Python 2 code with it, too.\n\n### Usage\n\nTo get started right away with sensible defaults:\n\n```\nblack {source_file_or_directory}\n```\n\n### Command line options\n\n_Black_ doesn't provide many options. You can list them by running `black --help`:\n\n```text\nblack [OPTIONS] [SRC]...\n\nOptions:\n -c, --code TEXT Format the code passed in as a string.\n -l, --line-length INTEGER How many characters per line to allow.\n [default: 88]\n -t, --target-version [py27|py33|py34|py35|py36|py37|py38]\n Python versions that should be supported by\n Black's output. [default: per-file auto-\n detection]\n --py36 Allow using Python 3.6-only syntax on all\n input files. This will put trailing commas\n in function signatures and calls also after\n *args and **kwargs. Deprecated; use\n --target-version instead. [default: per-file\n auto-detection]\n --pyi Format all input files like typing stubs\n regardless of file extension (useful when\n piping source on standard input).\n -S, --skip-string-normalization\n Don't normalize string quotes or prefixes.\n --check Don't write the files back, just return the\n status. Return code 0 means nothing would\n change. Return code 1 means some files\n would be reformatted. Return code 123 means\n there was an internal error.\n --diff Don't write the files back, just output a\n diff for each file on stdout.\n --fast / --safe If --fast given, skip temporary sanity\n checks. [default: --safe]\n --include TEXT A regular expression that matches files and\n directories that should be included on\n recursive searches. An empty value means\n all files are included regardless of the\n name. Use forward slashes for directories\n on all platforms (Windows, too). Exclusions\n are calculated first, inclusions later.\n [default: \\.pyi?$]\n --exclude TEXT A regular expression that matches files and\n directories that should be excluded on\n recursive searches. An empty value means no\n paths are excluded. Use forward slashes for\n directories on all platforms (Windows, too).\n Exclusions are calculated first, inclusions\n later. [default: /(\\.eggs|\\.git|\\.hg|\\.mypy\n _cache|\\.nox|\\.tox|\\.venv|_build|buck-\n out|build|dist)/]\n -q, --quiet Don't emit non-error messages to stderr.\n Errors are still emitted, silence those with\n 2>/dev/null.\n -v, --verbose Also emit messages to stderr about files\n that were not changed or were ignored due to\n --exclude=.\n --version Show the version and exit.\n --config PATH Read configuration from PATH.\n -h, --help Show this message and exit.\n```\n\n_Black_ is a well-behaved Unix-style command-line tool:\n\n- it does nothing if no sources are passed to it;\n- it will read from standard input and write to standard output if `-` is used as the\n filename;\n- it only outputs messages to users on standard error;\n- exits with code 0 unless an internal error occurred (or `--check` was used).\n\n### NOTE: This is a beta product\n\n_Black_ is already [successfully used](#used-by) by many projects, small and big. It\nalso sports a decent test suite. However, it is still very new. Things will probably be\nwonky for a while. This is made explicit by the \"Beta\" trove classifier, as well as by\nthe \"b\" in the version number. What this means for you is that **until the formatter\nbecomes stable, you should expect some formatting to change in the future**. That being\nsaid, no drastic stylistic changes are planned, mostly responses to bug reports.\n\nAlso, as a temporary safety measure, _Black_ will check that the reformatted code still\nproduces a valid AST that is equivalent to the original. This slows it down. If you're\nfeeling confident, use `--fast`.\n\n## The _Black_ code style\n\n_Black_ reformats entire files in place. It is not configurable. It doesn't take\nprevious formatting into account. It doesn't reformat blocks that start with\n`# fmt: off` and end with `# fmt: on`. `# fmt: on/off` have to be on the same level of\nindentation. It also recognizes [YAPF](https://github.com/google/yapf)'s block comments\nto the same effect, as a courtesy for straddling code.\n\n### How _Black_ wraps lines\n\n_Black_ ignores previous formatting and applies uniform horizontal and vertical\nwhitespace to your code. The rules for horizontal whitespace can be summarized as: do\nwhatever makes `pycodestyle` happy. The coding style used by _Black_ can be viewed as a\nstrict subset of PEP 8.\n\nAs for vertical whitespace, _Black_ tries to render one full expression or simple\nstatement per line. If this fits the allotted line length, great.\n\n```py3\n# in:\n\nj = [1,\n 2,\n 3,\n]\n\n# out:\n\nj = [1, 2, 3]\n```\n\nIf not, _Black_ will look at the contents of the first outer matching brackets and put\nthat in a separate indented line.\n\n```py3\n# in:\n\nImportantClass.important_method(exc, limit, lookup_lines, capture_locals, extra_argument)\n\n# out:\n\nImportantClass.important_method(\n exc, limit, lookup_lines, capture_locals, extra_argument\n)\n```\n\nIf that still doesn't fit the bill, it will decompose the internal expression further\nusing the same rule, indenting matching brackets every time. If the contents of the\nmatching brackets pair are comma-separated (like an argument list, or a dict literal,\nand so on) then _Black_ will first try to keep them on the same line with the matching\nbrackets. If that doesn't work, it will put all of them in separate lines.\n\n```py3\n# in:\n\ndef very_important_function(template: str, *variables, file: os.PathLike, engine: str, header: bool = True, debug: bool = False):\n \"\"\"Applies `variables` to the `template` and writes to `file`.\"\"\"\n with open(file, 'w') as f:\n ...\n\n# out:\n\ndef very_important_function(\n template: str,\n *variables,\n file: os.PathLike,\n engine: str,\n header: bool = True,\n debug: bool = False,\n):\n \"\"\"Applies `variables` to the `template` and writes to `file`.\"\"\"\n with open(file, \"w\") as f:\n ...\n```\n\nYou might have noticed that closing brackets are always dedented and that a trailing\ncomma is always added. Such formatting produces smaller diffs; when you add or remove an\nelement, it's always just one line. Also, having the closing bracket dedented provides a\nclear delimiter between two distinct sections of the code that otherwise share the same\nindentation level (like the arguments list and the docstring in the example above).\n\nIf a data structure literal (tuple, list, set, dict) or a line of \"from\" imports cannot\nfit in the allotted length, it's always split into one element per line. This minimizes\ndiffs as well as enables readers of code to find which commit introduced a particular\nentry. This also makes _Black_ compatible with [isort](https://pypi.org/p/isort/) with\nthe following configuration.\n\n
\nA compatible `.isort.cfg`\n\n```\n[settings]\nmulti_line_output=3\ninclude_trailing_comma=True\nforce_grid_wrap=0\nuse_parentheses=True\nline_length=88\n```\n\nThe equivalent command line is:\n\n```\n$ isort --multi-line=3 --trailing-comma --force-grid-wrap=0 --use-parentheses --line-width=88 [ file.py ]\n```\n\n
\n\n### Line length\n\nYou probably noticed the peculiar default line length. _Black_ defaults to 88 characters\nper line, which happens to be 10% over 80. This number was found to produce\nsignificantly shorter files than sticking with 80 (the most popular), or even 79 (used\nby the standard library). In general,\n[90-ish seems like the wise choice](https://youtu.be/wf-BqAjZb8M?t=260).\n\nIf you're paid by the line of code you write, you can pass `--line-length` with a lower\nnumber. _Black_ will try to respect that. However, sometimes it won't be able to without\nbreaking other rules. In those rare cases, auto-formatted code will exceed your allotted\nlimit.\n\nYou can also increase it, but remember that people with sight disabilities find it\nharder to work with line lengths exceeding 100 characters. It also adversely affects\nside-by-side diff review on typical screen resolutions. Long lines also make it harder\nto present code neatly in documentation or talk slides.\n\nIf you're using Flake8, you can bump `max-line-length` to 88 and forget about it.\nAlternatively, use [Bugbear](https://github.com/PyCQA/flake8-bugbear)'s B950 warning\ninstead of E501 and keep the max line length at 80 which you are probably already using.\nYou'd do it like this:\n\n```ini\n[flake8]\nmax-line-length = 80\n...\nselect = C,E,F,W,B,B950\nignore = E203, E501, W503\n```\n\nYou'll find _Black_'s own .flake8 config file is configured like this. Explanation of\nwhy W503 and E203 are disabled can be found further in this documentation. And if you're\ncurious about the reasoning behind B950,\n[Bugbear's documentation](https://github.com/PyCQA/flake8-bugbear#opinionated-warnings)\nexplains it. The tl;dr is \"it's like highway speed limits, we won't bother you if you\noverdo it by a few km/h\".\n\n### Empty lines\n\n_Black_ avoids spurious vertical whitespace. This is in the spirit of PEP 8 which says\nthat in-function vertical whitespace should only be used sparingly.\n\n_Black_ will allow single empty lines inside functions, and single and double empty\nlines on module level left by the original editors, except when they're within\nparenthesized expressions. Since such expressions are always reformatted to fit minimal\nspace, this whitespace is lost.\n\nIt will also insert proper spacing before and after function definitions. It's one line\nbefore and after inner functions and two lines before and after module-level functions\nand classes. _Black_ will not put empty lines between function/class definitions and\nstandalone comments that immediately precede the given function/class.\n\n_Black_ will enforce single empty lines between a class-level docstring and the first\nfollowing field or method. This conforms to\n[PEP 257](https://www.python.org/dev/peps/pep-0257/#multi-line-docstrings).\n\n_Black_ won't insert empty lines after function docstrings unless that empty line is\nrequired due to an inner function starting immediately after.\n\n### Trailing commas\n\n_Black_ will add trailing commas to expressions that are split by comma where each\nelement is on its own line. This includes function signatures.\n\nUnnecessary trailing commas are removed if an expression fits in one line. This makes it\n1% more likely that your line won't exceed the allotted line length limit. Moreover, in\nthis scenario, if you added another argument to your call, you'd probably fit it in the\nsame line anyway. That doesn't make diffs any larger.\n\nOne exception to removing trailing commas is tuple expressions with just one element. In\nthis case _Black_ won't touch the single trailing comma as this would unexpectedly\nchange the underlying data type. Note that this is also the case when commas are used\nwhile indexing. This is a tuple in disguise: `numpy_array[3, ]`.\n\nOne exception to adding trailing commas is function signatures containing `*`, `*args`,\nor `**kwargs`. In this case a trailing comma is only safe to use on Python 3.6. _Black_\nwill detect if your file is already 3.6+ only and use trailing commas in this situation.\nIf you wonder how it knows, it looks for f-strings and existing use of trailing commas\nin function signatures that have stars in them. In other words, if you'd like a trailing\ncomma in this situation and _Black_ didn't recognize it was safe to do so, put it there\nmanually and _Black_ will keep it.\n\n### Strings\n\n_Black_ prefers double quotes (`\"` and `\"\"\"`) over single quotes (`'` and `'''`). It\nwill replace the latter with the former as long as it does not result in more backslash\nescapes than before.\n\n_Black_ also standardizes string prefixes, making them always lowercase. On top of that,\nif your code is already Python 3.6+ only or it's using the `unicode_literals` future\nimport, _Black_ will remove `u` from the string prefix as it is meaningless in those\nscenarios.\n\nThe main reason to standardize on a single form of quotes is aesthetics. Having one kind\nof quotes everywhere reduces reader distraction. It will also enable a future version of\n_Black_ to merge consecutive string literals that ended up on the same line (see\n[#26](https://github.com/psf/black/issues/26) for details).\n\nWhy settle on double quotes? They anticipate apostrophes in English text. They match the\ndocstring standard described in\n[PEP 257](https://www.python.org/dev/peps/pep-0257/#what-is-a-docstring). An empty\nstring in double quotes (`\"\"`) is impossible to confuse with a one double-quote\nregardless of fonts and syntax highlighting used. On top of this, double quotes for\nstrings are consistent with C which Python interacts a lot with.\n\nOn certain keyboard layouts like US English, typing single quotes is a bit easier than\ndouble quotes. The latter requires use of the Shift key. My recommendation here is to\nkeep using whatever is faster to type and let _Black_ handle the transformation.\n\nIf you are adopting _Black_ in a large project with pre-existing string conventions\n(like the popular\n[\"single quotes for data, double quotes for human-readable strings\"](https://stackoverflow.com/a/56190)),\nyou can pass `--skip-string-normalization` on the command line. This is meant as an\nadoption helper, avoid using this for new projects.\n\n### Numeric literals\n\n_Black_ standardizes most numeric literals to use lowercase letters for the syntactic\nparts and uppercase letters for the digits themselves: `0xAB` instead of `0XAB` and\n`1e10` instead of `1E10`. Python 2 long literals are styled as `2L` instead of `2l` to\navoid confusion between `l` and `1`.\n\n### Line breaks & binary operators\n\n_Black_ will break a line before a binary operator when splitting a block of code over\nmultiple lines. This is so that _Black_ is compliant with the recent changes in the\n[PEP 8](https://www.python.org/dev/peps/pep-0008/#should-a-line-break-before-or-after-a-binary-operator)\nstyle guide, which emphasizes that this approach improves readability.\n\nThis behaviour may raise `W503 line break before binary operator` warnings in style\nguide enforcement tools like Flake8. Since `W503` is not PEP 8 compliant, you should\ntell Flake8 to ignore these warnings.\n\n### Slices\n\nPEP 8\n[recommends](https://www.python.org/dev/peps/pep-0008/#whitespace-in-expressions-and-statements)\nto treat `:` in slices as a binary operator with the lowest priority, and to leave an\nequal amount of space on either side, except if a parameter is omitted (e.g.\n`ham[1 + 1 :]`). It also states that for extended slices, both `:` operators have to\nhave the same amount of spacing, except if a parameter is omitted (`ham[1 + 1 ::]`).\n_Black_ enforces these rules consistently.\n\nThis behaviour may raise `E203 whitespace before ':'` warnings in style guide\nenforcement tools like Flake8. Since `E203` is not PEP 8 compliant, you should tell\nFlake8 to ignore these warnings.\n\n### Parentheses\n\nSome parentheses are optional in the Python grammar. Any expression can be wrapped in a\npair of parentheses to form an atom. There are a few interesting cases:\n\n- `if (...):`\n- `while (...):`\n- `for (...) in (...):`\n- `assert (...), (...)`\n- `from X import (...)`\n- assignments like:\n - `target = (...)`\n - `target: type = (...)`\n - `some, *un, packing = (...)`\n - `augmented += (...)`\n\nIn those cases, parentheses are removed when the entire statement fits in one line, or\nif the inner expression doesn't have any delimiters to further split on. If there is\nonly a single delimiter and the expression starts or ends with a bracket, the\nparenthesis can also be successfully omitted since the existing bracket pair will\norganize the expression neatly anyway. Otherwise, the parentheses are added.\n\nPlease note that _Black_ does not add or remove any additional nested parentheses that\nyou might want to have for clarity or further code organization. For example those\nparentheses are not going to be removed:\n\n```py3\nreturn not (this or that)\ndecision = (maybe.this() and values > 0) or (maybe.that() and values < 0)\n```\n\n### Call chains\n\nSome popular APIs, like ORMs, use call chaining. This API style is known as a\n[fluent interface](https://en.wikipedia.org/wiki/Fluent_interface). _Black_ formats\nthose by treating dots that follow a call or an indexing operation like a very low\npriority delimiter. It's easier to show the behavior than to explain it. Look at the\nexample:\n\n```py3\ndef example(session):\n result = (\n session.query(models.Customer.id)\n .filter(\n models.Customer.account_id == account_id,\n models.Customer.email == email_address,\n )\n .order_by(models.Customer.id.asc())\n .all()\n )\n```\n\n### Typing stub files\n\nPEP 484 describes the syntax for type hints in Python. One of the use cases for typing\nis providing type annotations for modules which cannot contain them directly (they might\nbe written in C, or they might be third-party, or their implementation may be overly\ndynamic, and so on).\n\nTo solve this,\n[stub files with the `.pyi` file extension](https://www.python.org/dev/peps/pep-0484/#stub-files)\ncan be used to describe typing information for an external module. Those stub files omit\nthe implementation of classes and functions they describe, instead they only contain the\nstructure of the file (listing globals, functions, and classes with their members). The\nrecommended code style for those files is more terse than PEP 8:\n\n- prefer `...` on the same line as the class/function signature;\n- avoid vertical whitespace between consecutive module-level functions, names, or\n methods and fields within a single class;\n- use a single blank line between top-level class definitions, or none if the classes\n are very small.\n\n_Black_ enforces the above rules. There are additional guidelines for formatting `.pyi`\nfile that are not enforced yet but might be in a future version of the formatter:\n\n- all function bodies should be empty (contain `...` instead of the body);\n- do not use docstrings;\n- prefer `...` over `pass`;\n- for arguments with a default, use `...` instead of the actual default;\n- avoid using string literals in type annotations, stub files support forward references\n natively (like Python 3.7 code with `from __future__ import annotations`);\n- use variable annotations instead of type comments, even for stubs that target older\n versions of Python;\n- for arguments that default to `None`, use `Optional[]` explicitly;\n- use `float` instead of `Union[int, float]`.\n\n## pyproject.toml\n\n_Black_ is able to read project-specific default values for its command line options\nfrom a `pyproject.toml` file. This is especially useful for specifying custom\n`--include` and `--exclude` patterns for your project.\n\n**Pro-tip**: If you're asking yourself \"Do I need to configure anything?\" the answer is\n\"No\". _Black_ is all about sensible defaults.\n\n### What on Earth is a `pyproject.toml` file?\n\n[PEP 518](https://www.python.org/dev/peps/pep-0518/) defines `pyproject.toml` as a\nconfiguration file to store build system requirements for Python projects. With the help\nof tools like [Poetry](https://poetry.eustace.io/) or\n[Flit](https://flit.readthedocs.io/en/latest/) it can fully replace the need for\n`setup.py` and `setup.cfg` files.\n\n### Where _Black_ looks for the file\n\nBy default _Black_ looks for `pyproject.toml` starting from the common base directory of\nall files and directories passed on the command line. If it's not there, it looks in\nparent directories. It stops looking when it finds the file, or a `.git` directory, or a\n`.hg` directory, or the root of the file system, whichever comes first.\n\nIf you're formatting standard input, _Black_ will look for configuration starting from\nthe current working directory.\n\nYou can also explicitly specify the path to a particular file that you want with\n`--config`. In this situation _Black_ will not look for any other file.\n\nIf you're running with `--verbose`, you will see a blue message if a file was found and\nused.\n\nPlease note `blackd` will not use `pyproject.toml` configuration.\n\n### Configuration format\n\nAs the file extension suggests, `pyproject.toml` is a\n[TOML](https://github.com/toml-lang/toml) file. It contains separate sections for\ndifferent tools. _Black_ is using the `[tool.black]` section. The option keys are the\nsame as long names of options on the command line.\n\nNote that you have to use single-quoted strings in TOML for regular expressions. It's\nthe equivalent of r-strings in Python. Multiline strings are treated as verbose regular\nexpressions by Black. Use `[ ]` to denote a significant space character.\n\n
\nExample `pyproject.toml`\n\n```toml\n[tool.black]\nline-length = 88\ntarget-version = ['py37']\ninclude = '\\.pyi?$'\nexclude = '''\n\n(\n /(\n \\.eggs # exclude a few common directories in the\n | \\.git # root of the project\n | \\.hg\n | \\.mypy_cache\n | \\.tox\n | \\.venv\n | _build\n | buck-out\n | build\n | dist\n )/\n | foo.py # also separately exclude a file named foo.py in\n # the root of the project\n)\n'''\n```\n\n
\n\n### Lookup hierarchy\n\nCommand-line options have defaults that you can see in `--help`. A `pyproject.toml` can\noverride those defaults. Finally, options provided by the user on the command line\noverride both.\n\n_Black_ will only ever use one `pyproject.toml` file during an entire run. It doesn't\nlook for multiple files, and doesn't compose configuration from different levels of the\nfile hierarchy.\n\n## Editor integration\n\n### Emacs\n\nUse [proofit404/blacken](https://github.com/proofit404/blacken) or\n[Elpy](https://github.com/jorgenschaefer/elpy).\n\n### PyCharm/IntelliJ IDEA\n\n1. Install `black`.\n\n```console\n$ pip install black\n```\n\n2. Locate your `black` installation folder.\n\nOn macOS / Linux / BSD:\n\n```console\n$ which black\n/usr/local/bin/black # possible location\n```\n\nOn Windows:\n\n```console\n$ where black\n%LocalAppData%\\Programs\\Python\\Python36-32\\Scripts\\black.exe # possible location\n```\n\n3. Open External tools in PyCharm/IntelliJ IDEA\n\nOn macOS:\n\n`PyCharm -> Preferences -> Tools -> External Tools`\n\nOn Windows / Linux / BSD:\n\n`File -> Settings -> Tools -> External Tools`\n\n4. Click the + icon to add a new external tool with the following values:\n\n - Name: Black\n - Description: Black is the uncompromising Python code formatter.\n - Program: \n - Arguments: `\"$FilePath$\"`\n\n5. Format the currently opened file by selecting `Tools -> External Tools -> black`.\n\n - Alternatively, you can set a keyboard shortcut by navigating to\n `Preferences or Settings -> Keymap -> External Tools -> External Tools - Black`.\n\n6. Optionally, run _Black_ on every file save:\n\n 1. Make sure you have the\n [File Watcher](https://plugins.jetbrains.com/plugin/7177-file-watchers) plugin\n installed.\n 2. Go to `Preferences or Settings -> Tools -> File Watchers` and click `+` to add a\n new watcher:\n - Name: Black\n - File type: Python\n - Scope: Project Files\n - Program: \n - Arguments: `$FilePath$`\n - Output paths to refresh: `$FilePath$`\n - Working directory: `$ProjectFileDir$`\n\n - Uncheck \"Auto-save edited files to trigger the watcher\"\n\n### Wing IDE\n\nWing supports black via the OS Commands tool, as explained in the Wing documentation on\n[pep8 formatting](https://wingware.com/doc/edit/pep8). The detailed procedure is:\n\n1. Install `black`.\n\n```console\n$ pip install black\n```\n\n2. Make sure it runs from the command line, e.g.\n\n```console\n$ black --help\n```\n\n3. In Wing IDE, activate the **OS Commands** panel and define the command **black** to\n execute black on the currently selected file:\n\n- Use the Tools -> OS Commands menu selection\n- click on **+** in **OS Commands** -> New: Command line..\n - Title: black\n - Command Line: black %s\n - I/O Encoding: Use Default\n - Key Binding: F1\n - [x] Raise OS Commands when executed\n - [x] Auto-save files before execution\n - [x] Line mode\n\n4. Select a file in the editor and press **F1** , or whatever key binding you selected\n in step 3, to reformat the file.\n\n### Vim\n\nCommands and shortcuts:\n\n- `:Black` to format the entire file (ranges not supported);\n- `:BlackUpgrade` to upgrade _Black_ inside the virtualenv;\n- `:BlackVersion` to get the current version of _Black_ inside the virtualenv.\n\nConfiguration:\n\n- `g:black_fast` (defaults to `0`)\n- `g:black_linelength` (defaults to `88`)\n- `g:black_skip_string_normalization` (defaults to `0`)\n- `g:black_virtualenv` (defaults to `~/.vim/black` or `~/.local/share/nvim/black`)\n\nTo install with [vim-plug](https://github.com/junegunn/vim-plug):\n\n```\nPlug 'psf/black'\n```\n\nor with [Vundle](https://github.com/VundleVim/Vundle.vim):\n\n```\nPlugin 'psf/black'\n```\n\nor you can copy the plugin from\n[plugin/black.vim](https://github.com/psf/black/tree/master/plugin/black.vim).\n\n```\nmkdir -p ~/.vim/pack/python/start/black/plugin\ncurl https://raw.githubusercontent.com/psf/black/master/plugin/black.vim -o ~/.vim/pack/python/start/black/plugin/black.vim\n```\n\nLet me know if this requires any changes to work with Vim 8's builtin `packadd`, or\nPathogen, and so on.\n\nThis plugin **requires Vim 7.0+ built with Python 3.6+ support**. It needs Python 3.6 to\nbe able to run _Black_ inside the Vim process which is much faster than calling an\nexternal command.\n\nOn first run, the plugin creates its own virtualenv using the right Python version and\nautomatically installs _Black_. You can upgrade it later by calling `:BlackUpgrade` and\nrestarting Vim.\n\nIf you need to do anything special to make your virtualenv work and install _Black_ (for\nexample you want to run a version from master), create a virtualenv manually and point\n`g:black_virtualenv` to it. The plugin will use it.\n\nTo run _Black_ on save, add the following line to `.vimrc` or `init.vim`:\n\n```\nautocmd BufWritePre *.py execute ':Black'\n```\n\nTo run _Black_ on a key press (e.g. F9 below), add this:\n\n```\nnnoremap :Black\n```\n\n**How to get Vim with Python 3.6?** On Ubuntu 17.10 Vim comes with Python 3.6 by\ndefault. On macOS with Homebrew run: `brew install vim --with-python3`. When building\nVim from source, use: `./configure --enable-python3interp=yes`. There's many guides\nonline how to do this.\n\n### Visual Studio Code\n\nUse the\n[Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python)\n([instructions](https://code.visualstudio.com/docs/python/editing#_formatting)).\n\n### SublimeText 3\n\nUse [sublack plugin](https://github.com/jgirardet/sublack).\n\n### Jupyter Notebook Magic\n\nUse [blackcellmagic](https://github.com/csurfer/blackcellmagic).\n\n### Python Language Server\n\nIf your editor supports the [Language Server Protocol](https://langserver.org/) (Atom,\nSublime Text, Visual Studio Code and many more), you can use the\n[Python Language Server](https://github.com/palantir/python-language-server) with the\n[pyls-black](https://github.com/rupert/pyls-black) plugin.\n\n### Atom/Nuclide\n\nUse [python-black](https://atom.io/packages/python-black).\n\n### Kakoune\n\nAdd the following hook to your kakrc, then run black with `:format`.\n\n```\nhook global WinSetOption filetype=python %{\n set-option window formatcmd 'black -q -'\n}\n```\n\n### Other editors\n\nOther editors will require external contributions.\n\nPatches welcome! ✨ 🍰 ✨\n\nAny tool that can pipe code through _Black_ using its stdio mode (just\n[use `-` as the file name](https://www.tldp.org/LDP/abs/html/special-chars.html#DASHREF2)).\nThe formatted code will be returned on stdout (unless `--check` was passed). _Black_\nwill still emit messages on stderr but that shouldn't affect your use case.\n\nThis can be used for example with PyCharm's or IntelliJ's\n[File Watchers](https://www.jetbrains.com/help/pycharm/file-watchers.html).\n\n## blackd\n\n`blackd` is a small HTTP server that exposes _Black_'s functionality over a simple\nprotocol. The main benefit of using it is to avoid paying the cost of starting up a new\n_Black_ process every time you want to blacken a file.\n\n### Usage\n\n`blackd` is not packaged alongside _Black_ by default because it has additional\ndependencies. You will need to do `pip install black[d]` to install it.\n\nYou can start the server on the default port, binding only to the local interface by\nrunning `blackd`. You will see a single line mentioning the server's version, and the\nhost and port it's listening on. `blackd` will then print an access log similar to most\nweb servers on standard output, merged with any exception traces caused by invalid\nformatting requests.\n\n`blackd` provides even less options than _Black_. You can see them by running\n`blackd --help`:\n\n```text\nUsage: blackd [OPTIONS]\n\nOptions:\n --bind-host TEXT Address to bind the server to.\n --bind-port INTEGER Port to listen on\n --version Show the version and exit.\n -h, --help Show this message and exit.\n```\n\nThere is no official blackd client tool (yet!). You can test that blackd is working\nusing `curl`:\n\n```\nblackd --bind-port 9090 & # or let blackd choose a port\ncurl -s -XPOST \"localhost:9090\" -d \"print('valid')\"\n```\n\n### Protocol\n\n`blackd` only accepts `POST` requests at the `/` path. The body of the request should\ncontain the python source code to be formatted, encoded according to the `charset` field\nin the `Content-Type` request header. If no `charset` is specified, `blackd` assumes\n`UTF-8`.\n\nThere are a few HTTP headers that control how the source is formatted. These correspond\nto command line flags for _Black_. There is one exception to this: `X-Protocol-Version`\nwhich if present, should have the value `1`, otherwise the request is rejected with\n`HTTP 501` (Not Implemented).\n\nThe headers controlling how code is formatted are:\n\nIf any of these headers are set to invalid values, `blackd` returns a `HTTP 400` error\nresponse, mentioning the name of the problematic header in the message body.\n\n- `X-Line-Length`: corresponds to the `--line-length` command line flag.\n- `X-Skip-String-Normalization`: corresponds to the `--skip-string-normalization`\n command line flag. If present and its value is not the empty string, no string\n normalization will be performed.\n- `X-Fast-Or-Safe`: if set to `fast`, `blackd` will act as _Black_ does when passed the\n `--fast` command line flag.\n- `X-Python-Variant`: if set to `pyi`, `blackd` will act as _Black_ does when passed the\n `--pyi` command line flag. Otherwise, its value must correspond to a Python version or\n a set of comma-separated Python versions, optionally prefixed with `py`. For example,\n to request code that is compatible with Python 3.5 and 3.6, set the header to\n `py3.5,py3.6`.\n- `X-Diff`: corresponds to the `--diff` command line flag. If present, a diff of the\n formats will be output.\n\nIf any of these headers are set to invalid values, `blackd` returns a `HTTP 400` error\nresponse, mentioning the name of the problematic header in the message body.\n\nApart from the above, `blackd` can produce the following response codes:\n\n- `HTTP 204`: If the input is already well-formatted. The response body is empty.\n- `HTTP 200`: If formatting was needed on the input. The response body contains the\n blackened Python code, and the `Content-Type` header is set accordingly.\n- `HTTP 400`: If the input contains a syntax error. Details of the error are returned in\n the response body.\n- `HTTP 500`: If there was any kind of error while trying to format the input. The\n response body contains a textual representation of the error.\n\nThe response headers include a `X-Black-Version` header containing the version of\n_Black_.\n\n## Version control integration\n\nUse [pre-commit](https://pre-commit.com/). Once you\n[have it installed](https://pre-commit.com/#install), add this to the\n`.pre-commit-config.yaml` in your repository:\n\n```yaml\nrepos:\n - repo: https://github.com/psf/black\n rev: stable\n hooks:\n - id: black\n language_version: python3.6\n```\n\nThen run `pre-commit install` and you're ready to go.\n\nAvoid using `args` in the hook. Instead, store necessary configuration in\n`pyproject.toml` so that editors and command-line usage of Black all behave consistently\nfor your project. See _Black_'s own [pyproject.toml](/pyproject.toml) for an example.\n\nIf you're already using Python 3.7, switch the `language_version` accordingly. Finally,\n`stable` is a tag that is pinned to the latest release on PyPI. If you'd rather run on\nmaster, this is also an option.\n\n## Ignoring unmodified files\n\n_Black_ remembers files it has already formatted, unless the `--diff` flag is used or\ncode is passed via standard input. This information is stored per-user. The exact\nlocation of the file depends on the _Black_ version and the system on which _Black_ is\nrun. The file is non-portable. The standard location on common operating systems is:\n\n- Windows:\n `C:\\\\Users\\\\AppData\\Local\\black\\black\\Cache\\\\cache...pickle`\n- macOS:\n `/Users//Library/Caches/black//cache...pickle`\n- Linux:\n `/home//.cache/black//cache...pickle`\n\n`file-mode` is an int flag that determines whether the file was formatted as 3.6+ only,\nas .pyi, and whether string normalization was omitted.\n\nTo override the location of these files on macOS or Linux, set the environment variable\n`XDG_CACHE_HOME` to your preferred location. For example, if you want to put the cache\nin the directory you're running _Black_ from, set `XDG_CACHE_HOME=.cache`. _Black_ will\nthen write the above files to `.cache/black//`.\n\n## Used by\n\nThe following notable open-source projects trust _Black_ with enforcing a consistent\ncode style: pytest, tox, Pyramid, Django Channels, Hypothesis, attrs, SQLAlchemy,\nPoetry, PyPA applications (Warehouse, Pipenv, virtualenv), pandas, Pillow, every Datadog\nAgent Integration.\n\nAre we missing anyone? Let us know.\n\n## Testimonials\n\n**Dusty Phillips**,\n[writer](https://smile.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=dusty+phillips):\n\n> _Black_ is opinionated so you don't have to be.\n\n**Hynek Schlawack**, [creator of `attrs`](https://www.attrs.org/), core developer of\nTwisted and CPython:\n\n> An auto-formatter that doesn't suck is all I want for Xmas!\n\n**Carl Meyer**, [Django](https://www.djangoproject.com/) core developer:\n\n> At least the name is good.\n\n**Kenneth Reitz**, creator of [`requests`](http://python-requests.org/) and\n[`pipenv`](https://docs.pipenv.org/):\n\n> This vastly improves the formatting of our code. Thanks a ton!\n\n## Show your style\n\nUse the badge in your project's README.md:\n\n```markdown\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n```\n\nUsing the badge in README.rst:\n\n```\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/psf/black\n```\n\nLooks like this:\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n## License\n\nMIT\n\n## Contributing to _Black_\n\nIn terms of inspiration, _Black_ is about as configurable as _gofmt_. This is\ndeliberate.\n\nBug reports and fixes are always welcome! However, before you suggest a new feature or\nconfiguration knob, ask yourself why you want it. If it enables better integration with\nsome workflow, fixes an inconsistency, speeds things up, and so on - go for it! On the\nother hand, if your answer is \"because I don't like a particular formatting\" then you're\nnot ready to embrace _Black_ yet. Such changes are unlikely to get accepted. You can\nstill try but prepare to be disappointed.\n\nMore details can be found in [CONTRIBUTING](CONTRIBUTING.md).\n\n## Change Log\n\n### 19.10b0\n\n- added support for PEP 572 assignment expressions (#711)\n\n- added support for PEP 570 positional-only arguments (#943)\n\n- added support for async generators (#593)\n\n- added support for pre-splitting collections by putting an explicit trailing comma\n inside (#826)\n\n- added `black -c` as a way to format code passed from the command line (#761)\n\n- --safe now works with Python 2 code (#840)\n\n- fixed grammar selection for Python 2-specific code (#765)\n\n- fixed feature detection for trailing commas in function definitions and call sites\n (#763)\n\n- `# fmt: off`/`# fmt: on` comment pairs placed multiple times within the same block of\n code now behave correctly (#1005)\n\n- _Black_ no longer crashes on Windows machines with more than 61 cores (#838)\n\n- _Black_ no longer crashes on standalone comments prepended with a backslash (#767)\n\n- _Black_ no longer crashes on `from` ... `import` blocks with comments (#829)\n\n- _Black_ no longer crashes on Python 3.7 on some platform configurations (#494)\n\n- _Black_ no longer fails on comments in from-imports (#671)\n\n- _Black_ no longer fails when the file starts with a backslash (#922)\n\n- _Black_ no longer merges regular comments with type comments (#1027)\n\n- _Black_ no longer splits long lines that contain type comments (#997)\n\n- removed unnecessary parentheses around `yield` expressions (#834)\n\n- added parentheses around long tuples in unpacking assignments (#832)\n\n- added parentheses around complex powers when they are prefixed by a unary operator\n (#646)\n\n- fixed bug that led _Black_ format some code with a line length target of 1 (#762)\n\n- _Black_ no longer introduces quotes in f-string subexpressions on string boundaries\n (#863)\n\n- if _Black_ puts parenthesis around a single expression, it moves comments to the\n wrapped expression instead of after the brackets (#872)\n\n- `blackd` now returns the version of _Black_ in the response headers (#1013)\n\n- `blackd` can now output the diff of formats on source code when the `X-Diff` header is\n provided (#969)\n\n### 19.3b0\n\n- new option `--target-version` to control which Python versions _Black_-formatted code\n should target (#618)\n\n- deprecated `--py36` (use `--target-version=py36` instead) (#724)\n\n- _Black_ no longer normalizes numeric literals to include `_` separators (#696)\n\n- long `del` statements are now split into multiple lines (#698)\n\n- type comments are no longer mangled in function signatures\n\n- improved performance of formatting deeply nested data structures (#509)\n\n- _Black_ now properly formats multiple files in parallel on Windows (#632)\n\n- _Black_ now creates cache files atomically which allows it to be used in parallel\n pipelines (like `xargs -P8`) (#673)\n\n- _Black_ now correctly indents comments in files that were previously formatted with\n tabs (#262)\n\n- `blackd` now supports CORS (#622)\n\n### 18.9b0\n\n- numeric literals are now formatted by _Black_ (#452, #461, #464, #469):\n\n - numeric literals are normalized to include `_` separators on Python 3.6+ code\n\n - added `--skip-numeric-underscore-normalization` to disable the above behavior and\n leave numeric underscores as they were in the input\n\n - code with `_` in numeric literals is recognized as Python 3.6+\n\n - most letters in numeric literals are lowercased (e.g., in `1e10`, `0x01`)\n\n - hexadecimal digits are always uppercased (e.g. `0xBADC0DE`)\n\n- added `blackd`, see [its documentation](#blackd) for more info (#349)\n\n- adjacent string literals are now correctly split into multiple lines (#463)\n\n- trailing comma is now added to single imports that don't fit on a line (#250)\n\n- cache is now populated when `--check` is successful for a file which speeds up\n consecutive checks of properly formatted unmodified files (#448)\n\n- whitespace at the beginning of the file is now removed (#399)\n\n- fixed mangling [pweave](http://mpastell.com/pweave/) and\n [Spyder IDE](https://pythonhosted.org/spyder/) special comments (#532)\n\n- fixed unstable formatting when unpacking big tuples (#267)\n\n- fixed parsing of `__future__` imports with renames (#389)\n\n- fixed scope of `# fmt: off` when directly preceding `yield` and other nodes (#385)\n\n- fixed formatting of lambda expressions with default arguments (#468)\n\n- fixed `async for` statements: _Black_ no longer breaks them into separate lines (#372)\n\n- note: the Vim plugin stopped registering `,=` as a default chord as it turned out to\n be a bad idea (#415)\n\n### 18.6b4\n\n- hotfix: don't freeze when multiple comments directly precede `# fmt: off` (#371)\n\n### 18.6b3\n\n- typing stub files (`.pyi`) now have blank lines added after constants (#340)\n\n- `# fmt: off` and `# fmt: on` are now much more dependable:\n\n - they now work also within bracket pairs (#329)\n\n - they now correctly work across function/class boundaries (#335)\n\n - they now work when an indentation block starts with empty lines or misaligned\n comments (#334)\n\n- made Click not fail on invalid environments; note that Click is right but the\n likelihood we'll need to access non-ASCII file paths when dealing with Python source\n code is low (#277)\n\n- fixed improper formatting of f-strings with quotes inside interpolated expressions\n (#322)\n\n- fixed unnecessary slowdown when long list literals where found in a file\n\n- fixed unnecessary slowdown on AST nodes with very many siblings\n\n- fixed cannibalizing backslashes during string normalization\n\n- fixed a crash due to symbolic links pointing outside of the project directory (#338)\n\n### 18.6b2\n\n- added `--config` (#65)\n\n- added `-h` equivalent to `--help` (#316)\n\n- fixed improper unmodified file caching when `-S` was used\n\n- fixed extra space in string unpacking (#305)\n\n- fixed formatting of empty triple quoted strings (#313)\n\n- fixed unnecessary slowdown in comment placement calculation on lines without comments\n\n### 18.6b1\n\n- hotfix: don't output human-facing information on stdout (#299)\n\n- hotfix: don't output cake emoji on non-zero return code (#300)\n\n### 18.6b0\n\n- added `--include` and `--exclude` (#270)\n\n- added `--skip-string-normalization` (#118)\n\n- added `--verbose` (#283)\n\n- the header output in `--diff` now actually conforms to the unified diff spec\n\n- fixed long trivial assignments being wrapped in unnecessary parentheses (#273)\n\n- fixed unnecessary parentheses when a line contained multiline strings (#232)\n\n- fixed stdin handling not working correctly if an old version of Click was used (#276)\n\n- _Black_ now preserves line endings when formatting a file in place (#258)\n\n### 18.5b1\n\n- added `--pyi` (#249)\n\n- added `--py36` (#249)\n\n- Python grammar pickle caches are stored with the formatting caches, making _Black_\n work in environments where site-packages is not user-writable (#192)\n\n- _Black_ now enforces a PEP 257 empty line after a class-level docstring (and/or\n fields) and the first method\n\n- fixed invalid code produced when standalone comments were present in a trailer that\n was omitted from line splitting on a large expression (#237)\n\n- fixed optional parentheses being removed within `# fmt: off` sections (#224)\n\n- fixed invalid code produced when stars in very long imports were incorrectly wrapped\n in optional parentheses (#234)\n\n- fixed unstable formatting when inline comments were moved around in a trailer that was\n omitted from line splitting on a large expression (#238)\n\n- fixed extra empty line between a class declaration and the first method if no class\n docstring or fields are present (#219)\n\n- fixed extra empty line between a function signature and an inner function or inner\n class (#196)\n\n### 18.5b0\n\n- call chains are now formatted according to the\n [fluent interfaces](https://en.wikipedia.org/wiki/Fluent_interface) style (#67)\n\n- data structure literals (tuples, lists, dictionaries, and sets) are now also always\n exploded like imports when they don't fit in a single line (#152)\n\n- slices are now formatted according to PEP 8 (#178)\n\n- parentheses are now also managed automatically on the right-hand side of assignments\n and return statements (#140)\n\n- math operators now use their respective priorities for delimiting multiline\n expressions (#148)\n\n- optional parentheses are now omitted on expressions that start or end with a bracket\n and only contain a single operator (#177)\n\n- empty parentheses in a class definition are now removed (#145, #180)\n\n- string prefixes are now standardized to lowercase and `u` is removed on Python 3.6+\n only code and Python 2.7+ code with the `unicode_literals` future import (#188, #198,\n #199)\n\n- typing stub files (`.pyi`) are now formatted in a style that is consistent with PEP\n 484 (#207, #210)\n\n- progress when reformatting many files is now reported incrementally\n\n- fixed trailers (content with brackets) being unnecessarily exploded into their own\n lines after a dedented closing bracket (#119)\n\n- fixed an invalid trailing comma sometimes left in imports (#185)\n\n- fixed non-deterministic formatting when multiple pairs of removable parentheses were\n used (#183)\n\n- fixed multiline strings being unnecessarily wrapped in optional parentheses in long\n assignments (#215)\n\n- fixed not splitting long from-imports with only a single name\n\n- fixed Python 3.6+ file discovery by also looking at function calls with unpacking.\n This fixed non-deterministic formatting if trailing commas where used both in function\n signatures with stars and function calls with stars but the former would be\n reformatted to a single line.\n\n- fixed crash on dealing with optional parentheses (#193)\n\n- fixed \"is\", \"is not\", \"in\", and \"not in\" not considered operators for splitting\n purposes\n\n- fixed crash when dead symlinks where encountered\n\n### 18.4a4\n\n- don't populate the cache on `--check` (#175)\n\n### 18.4a3\n\n- added a \"cache\"; files already reformatted that haven't changed on disk won't be\n reformatted again (#109)\n\n- `--check` and `--diff` are no longer mutually exclusive (#149)\n\n- generalized star expression handling, including double stars; this fixes\n multiplication making expressions \"unsafe\" for trailing commas (#132)\n\n- _Black_ no longer enforces putting empty lines behind control flow statements (#90)\n\n- _Black_ now splits imports like \"Mode 3 + trailing comma\" of isort (#127)\n\n- fixed comment indentation when a standalone comment closes a block (#16, #32)\n\n- fixed standalone comments receiving extra empty lines if immediately preceding a\n class, def, or decorator (#56, #154)\n\n- fixed `--diff` not showing entire path (#130)\n\n- fixed parsing of complex expressions after star and double stars in function calls\n (#2)\n\n- fixed invalid splitting on comma in lambda arguments (#133)\n\n- fixed missing splits of ternary expressions (#141)\n\n### 18.4a2\n\n- fixed parsing of unaligned standalone comments (#99, #112)\n\n- fixed placement of dictionary unpacking inside dictionary literals (#111)\n\n- Vim plugin now works on Windows, too\n\n- fixed unstable formatting when encountering unnecessarily escaped quotes in a string\n (#120)\n\n### 18.4a1\n\n- added `--quiet` (#78)\n\n- added automatic parentheses management (#4)\n\n- added [pre-commit](https://pre-commit.com) integration (#103, #104)\n\n- fixed reporting on `--check` with multiple files (#101, #102)\n\n- fixed removing backslash escapes from raw strings (#100, #105)\n\n### 18.4a0\n\n- added `--diff` (#87)\n\n- add line breaks before all delimiters, except in cases like commas, to better comply\n with PEP 8 (#73)\n\n- standardize string literals to use double quotes (almost) everywhere (#75)\n\n- fixed handling of standalone comments within nested bracketed expressions; _Black_\n will no longer produce super long lines or put all standalone comments at the end of\n the expression (#22)\n\n- fixed 18.3a4 regression: don't crash and burn on empty lines with trailing whitespace\n (#80)\n\n- fixed 18.3a4 regression: `# yapf: disable` usage as trailing comment would cause\n _Black_ to not emit the rest of the file (#95)\n\n- when CTRL+C is pressed while formatting many files, _Black_ no longer freaks out with\n a flurry of asyncio-related exceptions\n\n- only allow up to two empty lines on module level and only single empty lines within\n functions (#74)\n\n### 18.3a4\n\n- `# fmt: off` and `# fmt: on` are implemented (#5)\n\n- automatic detection of deprecated Python 2 forms of print statements and exec\n statements in the formatted file (#49)\n\n- use proper spaces for complex expressions in default values of typed function\n arguments (#60)\n\n- only return exit code 1 when --check is used (#50)\n\n- don't remove single trailing commas from square bracket indexing (#59)\n\n- don't omit whitespace if the previous factor leaf wasn't a math operator (#55)\n\n- omit extra space in kwarg unpacking if it's the first argument (#46)\n\n- omit extra space in\n [Sphinx auto-attribute comments](http://www.sphinx-doc.org/en/stable/ext/autodoc.html#directive-autoattribute)\n (#68)\n\n### 18.3a3\n\n- don't remove single empty lines outside of bracketed expressions (#19)\n\n- added ability to pipe formatting from stdin to stdin (#25)\n\n- restored ability to format code with legacy usage of `async` as a name (#20, #42)\n\n- even better handling of numpy-style array indexing (#33, again)\n\n### 18.3a2\n\n- changed positioning of binary operators to occur at beginning of lines instead of at\n the end, following\n [a recent change to PEP 8](https://github.com/python/peps/commit/c59c4376ad233a62ca4b3a6060c81368bd21e85b)\n (#21)\n\n- ignore empty bracket pairs while splitting. This avoids very weirdly looking\n formattings (#34, #35)\n\n- remove a trailing comma if there is a single argument to a call\n\n- if top level functions were separated by a comment, don't put four empty lines after\n the upper function\n\n- fixed unstable formatting of newlines with imports\n\n- fixed unintentional folding of post scriptum standalone comments into last statement\n if it was a simple statement (#18, #28)\n\n- fixed missing space in numpy-style array indexing (#33)\n\n- fixed spurious space after star-based unary expressions (#31)\n\n### 18.3a1\n\n- added `--check`\n\n- only put trailing commas in function signatures and calls if it's safe to do so. If\n the file is Python 3.6+ it's always safe, otherwise only safe if there are no `*args`\n or `**kwargs` used in the signature or call. (#8)\n\n- fixed invalid spacing of dots in relative imports (#6, #13)\n\n- fixed invalid splitting after comma on unpacked variables in for-loops (#23)\n\n- fixed spurious space in parenthesized set expressions (#7)\n\n- fixed spurious space after opening parentheses and in default arguments (#14, #17)\n\n- fixed spurious space after unary operators when the operand was a complex expression\n (#15)\n\n### 18.3a0\n\n- first published version, Happy 🍰 Day 2018!\n\n- alpha quality\n\n- date-versioned (see: https://calver.org/)\n\n## Authors\n\nGlued together by [Łukasz Langa](mailto:lukasz@langa.pl).\n\nMaintained with [Carol Willing](mailto:carolcode@willingconsulting.com),\n[Carl Meyer](mailto:carl@oddbird.net),\n[Jelle Zijlstra](mailto:jelle.zijlstra@gmail.com),\n[Mika Naylor](mailto:mail@autophagy.io), and\n[Zsolt Dollenstein](mailto:zsol.zsol@gmail.com).\n\nMultiple contributions by:\n\n- [Abdur-Rahmaan Janhangeer](mailto:cryptolabour@gmail.com)\n- [Adam Johnson](mailto:me@adamj.eu)\n- [Alexander Huynh](mailto:github@grande.coffee)\n- [Andrew Thorp](mailto:andrew.thorp.dev@gmail.com)\n- [Andrey](mailto:dyuuus@yandex.ru)\n- [Andy Freeland](mailto:andy@andyfreeland.net)\n- [Anthony Sottile](mailto:asottile@umich.edu)\n- [Arjaan Buijk](mailto:arjaan.buijk@gmail.com)\n- [Artem Malyshev](mailto:proofit404@gmail.com)\n- [Asger Hautop Drewsen](mailto:asgerdrewsen@gmail.com)\n- [Augie Fackler](mailto:raf@durin42.com)\n- [Aviskar KC](mailto:aviskarkc10@gmail.com)\n- [Benjamin Woodruff](mailto:github@benjam.info)\n- [Brandt Bucher](mailto:brandtbucher@gmail.com)\n- Charles Reid\n- [Christian Heimes](mailto:christian@python.org)\n- [Chuck Wooters](mailto:chuck.wooters@microsoft.com)\n- [Daniel Hahler](mailto:github@thequod.de)\n- [Daniel M. Capella](mailto:polycitizen@gmail.com)\n- Daniele Esposti\n- dylanjblack\n- [Eli Treuherz](mailto:eli@treuherz.com)\n- [Florent Thiery](mailto:fthiery@gmail.com)\n- hauntsaninja\n- Hugo van Kemenade\n- [Ivan Katanić](mailto:ivan.katanic@gmail.com)\n- [Jason Fried](mailto:me@jasonfried.info)\n- [jgirardet](mailto:ijkl@netc.fr)\n- [Joe Antonakakis](mailto:jma353@cornell.edu)\n- [Jon Dufresne](mailto:jon.dufresne@gmail.com)\n- [Jonas Obrist](mailto:ojiidotch@gmail.com)\n- [Josh Bode](mailto:joshbode@fastmail.com)\n- [Juan Luis Cano Rodríguez](mailto:hello@juanlu.space)\n- [Katie McLaughlin](mailto:katie@glasnt.com)\n- Lawrence Chan\n- [Linus Groh](mailto:mail@linusgroh.de)\n- [Luka Sterbic](mailto:luka.sterbic@gmail.com)\n- Mariatta\n- [Matt VanEseltine](mailto:vaneseltine@gmail.com)\n- [Michael Flaxman](mailto:michael.flaxman@gmail.com)\n- [Michael J. Sullivan](mailto:sully@msully.net)\n- [Michael McClimon](mailto:michael@mcclimon.org)\n- [Miguel Gaiowski](mailto:miggaiowski@gmail.com)\n- [Mike](mailto:roshi@fedoraproject.org)\n- [Min ho Kim](mailto:minho42@gmail.com)\n- [Miroslav Shubernetskiy](mailto:miroslav@miki725.com)\n- [Neraste](mailto:neraste.herr10@gmail.com)\n- [Ofek Lev](mailto:ofekmeister@gmail.com)\n- [Osaetin Daniel](mailto:osaetindaniel@gmail.com)\n- [Pablo Galindo](mailto:Pablogsal@gmail.com)\n- [Peter Bengtsson](mailto:mail@peterbe.com)\n- pmacosta\n- [Rishikesh Jha](mailto:rishijha424@gmail.com)\n- [Stavros Korokithakis](mailto:hi@stavros.io)\n- [Stephen Rosen](mailto:sirosen@globus.org)\n- [Sunil Kapil](mailto:snlkapil@gmail.com)\n- [Thom Lu](mailto:thomas.c.lu@gmail.com)\n- [Tom Christie](mailto:tom@tomchristie.com)\n- [Tzu-ping Chung](mailto:uranusjr@gmail.com)\n- [Utsav Shah](mailto:ukshah2@illinois.edu)\n- vezeli\n- [Vishwas B Sharma](mailto:sharma.vishwas88@gmail.com)\n- [Yngve Høiseth](mailto:yngve@hoiseth.net)\n- [Yurii Karabas](mailto:1998uriyyo@gmail.com)\n\n\n", + "description": "", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", @@ -61,13 +61,13 @@ { "comment_text": "", "digests": { - "md5": "067efd0498107b5fb2299fbfb000b0b6", - "sha256": "1b30e59be925fafc1ee4565e5e08abef6b03fe455102883820fe5ee2e4734e0b" + "md5": "4a420234749e1ea350581160ef51cd02", + "sha256": "3471ff321348d851b6f3047f4ed42c88622ac038caf7c2d160bd653334c88e88" }, "downloads": -1, "filename": "black-19.10b0-py36-none-any.whl", "has_sig": true, - "md5_digest": "067efd0498107b5fb2299fbfb000b0b6", + "md5_digest": "4a420234749e1ea350581160ef51cd02", "packagetype": "bdist_wheel", "python_version": "py36", "requires_python": ">=3.6", @@ -81,13 +81,13 @@ { "comment_text": "", "digests": { - "md5": "496632a95b73b8f5c5081d795a4e6af1", - "sha256": "c2edb73a08e9e0e6f65a0e6af18b059b8b1cdd5bef997d7a0b181df93dc81539" + "md5": "c383543109a66a5a99113e6326db5251", + "sha256": "6cada614d5d2132698c6d5fff384657273d922c4fffa6a2f0de9e03e25b8913a" }, "downloads": -1, "filename": "black-19.10b0.tar.gz", "has_sig": true, - "md5_digest": "496632a95b73b8f5c5081d795a4e6af1", + "md5_digest": "c383543109a66a5a99113e6326db5251", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", diff --git a/tests/repositories/fixtures/pypi.org/json/black/21.11b0.json b/tests/repositories/fixtures/pypi.org/json/black/21.11b0.json index f816ef3b96b..a9bd489ecfc 100644 --- a/tests/repositories/fixtures/pypi.org/json/black/21.11b0.json +++ b/tests/repositories/fixtures/pypi.org/json/black/21.11b0.json @@ -113,13 +113,13 @@ { "comment_text": "", "digests": { - "md5": "945da11b34c11738560fc6698cffa425", - "sha256": "0b1f66cbfadcd332ceeaeecf6373d9991d451868d2e2219ad0ac1213fb701117" + "md5": "294e105f34e2e21286a49bfcfb8fb6ae", + "sha256": "e16b6879ed61f9268994b879174fad1cb2319a651afd20f8cf036428ac65f846" }, "downloads": -1, "filename": "black-21.11b0-py3-none-any.whl", "has_sig": false, - "md5_digest": "945da11b34c11738560fc6698cffa425", + "md5_digest": "294e105f34e2e21286a49bfcfb8fb6ae", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.2", @@ -133,13 +133,13 @@ { "comment_text": "", "digests": { - "md5": "6040b4e4c6ccc4e7eb81bb2634ef299a", - "sha256": "83f3852301c8dcb229e9c444dd79f573c8d31c7c2dad9bbaaa94c808630e32aa" + "md5": "f01267bf2613f825dd6684629c1c829e", + "sha256": "f23c482185d842e2f19d506e55c004061167e3c677c063ecd721042c62086ada" }, "downloads": -1, "filename": "black-21.11b0.tar.gz", "has_sig": false, - "md5_digest": "6040b4e4c6ccc4e7eb81bb2634ef299a", + "md5_digest": "f01267bf2613f825dd6684629c1c829e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.2", diff --git a/tests/repositories/fixtures/pypi.org/json/cachecontrol.json b/tests/repositories/fixtures/pypi.org/json/cachecontrol.json index f134f04f648..2220d763339 100644 --- a/tests/repositories/fixtures/pypi.org/json/cachecontrol.json +++ b/tests/repositories/fixtures/pypi.org/json/cachecontrol.json @@ -1,52 +1,12 @@ { "name": "CacheControl", "files": [ - { - "filename": "CacheControl-0.12.0.tar.gz", - "url": "https://files.pythonhosted.org/packages/41/ae/b9c375b001f13d73c0d8eba2264f6de955769f7cef9140d7fc192814255e/CacheControl-0.12.0.tar.gz", - "hashes": { - "md5": "807c457b3b7df9d1f23b1aad7f9c9a22", - "sha256": "ce479e88e697dc088297a5781daa2e812aa0dc888dc439602a308af6f4ff09e8" - } - }, - { - "filename": "CacheControl-0.12.1.tar.gz", - "url": "https://files.pythonhosted.org/packages/3a/f7/075de886ad249f4ca08615ebd8bec9ce995ed6852790b6d9df38ae059e43/CacheControl-0.12.1.tar.gz", - "hashes": { - "md5": "c6c5944d3a6f73bb752a4b4e2e1ffca5", - "sha256": "99c1506b98d53c222493e0ff65904c91aaedd7c8e235cb4f00287ddbbb597072" - } - }, - { - "filename": "CacheControl-0.12.2.tar.gz", - "url": "https://files.pythonhosted.org/packages/d2/6c/221f699710a6a643bd9a4324cf22ffb9fb73a089d2bfbed5fe4694f3caaf/CacheControl-0.12.2.tar.gz", - "hashes": { - "md5": "38667f538f36c641eb0b00d0db145823", - "sha256": "d7d919830d7edc5f4b355fa678a2ea49e9ccb67966abc373ec20f93f3f471265" - } - }, - { - "filename": "CacheControl-0.12.3.tar.gz", - "url": "https://files.pythonhosted.org/packages/a3/b3/6bb6c1535a283f01fe0c4e9644784756fee2ec080e2a6097f1c59325609e/CacheControl-0.12.3.tar.gz", - "hashes": { - "md5": "45bf98a2e3435438dcee89e519b34195", - "sha256": "a9fc50e216c7c101f4ec4312f012dea501c2859cb256c7a68186a172ab71f632" - } - }, - { - "filename": "CacheControl-0.12.4.tar.gz", - "url": "https://files.pythonhosted.org/packages/98/f5/76619a63f0e4a1d2f5a1792ebc233a395c648c63d3461dc0331479ef120a/CacheControl-0.12.4.tar.gz", - "hashes": { - "md5": "464675fc575b3a0b841598cb916be516", - "sha256": "a7d21ba4e3633d95ac9fed5be205ee6d1da36bdc4b8914eb7a57ff50b7e5628c" - } - }, { "filename": "CacheControl-0.12.5.tar.gz", "url": "https://files.pythonhosted.org/packages/5e/f0/2c193ed1f17c97ae539da7e1c2d48b80d8cccb1917163b26a91ca4355aa6/CacheControl-0.12.5.tar.gz", "hashes": { - "md5": "f1baef403e8dd68c5a203e2eb23a0f2e", - "sha256": "cef77effdf51b43178f6a2d3b787e3734f98ade253fa3187f3bb7315aaa42ff7" + "md5": "b9499189d24a2695f6ceb879b0764417", + "sha256": "963350642919d6d747288db041fe68a8dabb1aa3d3cef3587dbf2ec092592049" }, "requires-python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" } diff --git a/tests/repositories/fixtures/pypi.org/json/cachecontrol/0.12.5.json b/tests/repositories/fixtures/pypi.org/json/cachecontrol/0.12.5.json index 9caccabb548..6f218ee4d93 100644 --- a/tests/repositories/fixtures/pypi.org/json/cachecontrol/0.12.5.json +++ b/tests/repositories/fixtures/pypi.org/json/cachecontrol/0.12.5.json @@ -50,13 +50,13 @@ { "comment_text": "", "digests": { - "md5": "f1baef403e8dd68c5a203e2eb23a0f2e", - "sha256": "cef77effdf51b43178f6a2d3b787e3734f98ade253fa3187f3bb7315aaa42ff7" + "md5": "b9499189d24a2695f6ceb879b0764417", + "sha256": "963350642919d6d747288db041fe68a8dabb1aa3d3cef3587dbf2ec092592049" }, "downloads": -1, "filename": "CacheControl-0.12.5.tar.gz", "has_sig": false, - "md5_digest": "f1baef403e8dd68c5a203e2eb23a0f2e", + "md5_digest": "b9499189d24a2695f6ceb879b0764417", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", diff --git a/tests/repositories/fixtures/pypi.org/json/cleo.json b/tests/repositories/fixtures/pypi.org/json/cleo.json new file mode 100644 index 00000000000..88543fda1d7 --- /dev/null +++ b/tests/repositories/fixtures/pypi.org/json/cleo.json @@ -0,0 +1,44 @@ +{ + "files": [ + { + "core-metadata": { + "sha256": "892426a14eeae04120b2baa0212d7090f3a22e64ffd5d0ad3bc4c515b59a9c89" + }, + "data-dist-info-metadata": { + "sha256": "892426a14eeae04120b2baa0212d7090f3a22e64ffd5d0ad3bc4c515b59a9c89" + }, + "filename": "cleo-1.0.0a5-py3-none-any.whl", + "hashes": { + "md5": "eaf14b3f99b2b88c0846ecc9a5a18af4", + "sha256": "20dbd69ed5c27e2889a2d428b9b01771f6073e4a1483a731e3c14c07a666aa9f" + }, + "requires-python": ">=3.7,<4.0", + "size": 78701, + "upload-time": "2022-06-03T20:16:19.386916Z", + "url": "https://files.pythonhosted.org/packages/45/0c/3825603bf62f360829b1eea29a43dadce30829067e288170b3bf738aafd0/cleo-1.0.0a5-py3-none-any.whl", + "yanked": false + }, + { + "core-metadata": false, + "data-dist-info-metadata": false, + "filename": "cleo-1.0.0a5.tar.gz", + "hashes": { + "md5": "92e181952976e09b9d1c583da6c3e2fc", + "sha256": "88f0a4275a17f2ab4d013786b8b9522d4c60bd37d8fc9b3def0fb27f4ac1e694" + }, + "requires-python": ">=3.7,<4.0", + "size": 61431, + "upload-time": "2022-06-03T20:16:21.133890Z", + "url": "https://files.pythonhosted.org/packages/2f/16/1c1902b225756745f9860451a44a2e2a3c26ee91c72295e83c63df605ed1/cleo-1.0.0a5.tar.gz", + "yanked": false + } + ], + "meta": { + "_last-serial": 20402192, + "api-version": "1.1" + }, + "name": "cleo", + "versions": [ + "1.0.0a5" + ] +} diff --git a/tests/repositories/fixtures/pypi.org/json/cleo/1.0.0a5.json b/tests/repositories/fixtures/pypi.org/json/cleo/1.0.0a5.json index 570ed2f108b..5cc33953e91 100644 --- a/tests/repositories/fixtures/pypi.org/json/cleo/1.0.0a5.json +++ b/tests/repositories/fixtures/pypi.org/json/cleo/1.0.0a5.json @@ -48,13 +48,13 @@ { "comment_text": "", "digests": { - "md5": "4c78006d13e68c0c0796b954b1df0a3f", - "sha256": "ff53056589300976e960f75afb792dfbfc9c78dcbb5a448e207a17b643826360" + "md5": "eaf14b3f99b2b88c0846ecc9a5a18af4", + "sha256": "20dbd69ed5c27e2889a2d428b9b01771f6073e4a1483a731e3c14c07a666aa9f" }, "downloads": -1, "filename": "cleo-1.0.0a5-py3-none-any.whl", "has_sig": false, - "md5_digest": "4c78006d13e68c0c0796b954b1df0a3f", + "md5_digest": "eaf14b3f99b2b88c0846ecc9a5a18af4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7,<4.0", @@ -68,13 +68,13 @@ { "comment_text": "", "digests": { - "md5": "90e60b2ad117d3534f92a4ce37f9f462", - "sha256": "097c9d0e0332fd53cc89fc11eb0a6ba0309e6a3933c08f7b38558555486925d3" + "md5": "92e181952976e09b9d1c583da6c3e2fc", + "sha256": "88f0a4275a17f2ab4d013786b8b9522d4c60bd37d8fc9b3def0fb27f4ac1e694" }, "downloads": -1, "filename": "cleo-1.0.0a5.tar.gz", "has_sig": false, - "md5_digest": "90e60b2ad117d3534f92a4ce37f9f462", + "md5_digest": "92e181952976e09b9d1c583da6c3e2fc", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7,<4.0", diff --git a/tests/repositories/fixtures/pypi.org/json/clikit.json b/tests/repositories/fixtures/pypi.org/json/clikit.json index ea10b9cee34..8616c086091 100644 --- a/tests/repositories/fixtures/pypi.org/json/clikit.json +++ b/tests/repositories/fixtures/pypi.org/json/clikit.json @@ -5,8 +5,8 @@ "filename": "clikit-0.2.4-py2.py3-none-any.whl", "url": "https://files.pythonhosted.org/packages/7b/0d/bb4c8a2d0edca8c300373ed736fb4680cf73be5be2ff84544dee5f979c14/clikit-0.2.4-py2.py3-none-any.whl", "hashes": { - "md5": "280f18c82d0810c9b5ca11380529c04c", - "sha256": "a7597999555aeb2ce9946f07187f690ab6864213f337e51250178c4bd19bd810" + "md5": "c3558fef2a1148bb1df96376def5c8fe", + "sha256": "60900adbac91d6d2cefc88efe2639ce3090f4520106596ac855bee3763f276c0" }, "requires-python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" }, @@ -14,8 +14,8 @@ "filename": "clikit-0.2.4.tar.gz", "url": "https://files.pythonhosted.org/packages/c5/33/14fad4c82f256b0ef60dd25d4b6d8145b463da5274fd9cd842f06af318ed/clikit-0.2.4.tar.gz", "hashes": { - "md5": "2543daad83b072e960ded5f68074a443", - "sha256": "d6807cf4a41e6b981b056075c0aefca2db1dabc597ed18fa4d92b8b2e2678835" + "md5": "f7cdbad3508038a04561f646aae68146", + "sha256": "0fdd41e86e8b118a8b1e94ef2835925ada541d481c9b3b2fc635fa68713e6125" }, "requires-python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" } diff --git a/tests/repositories/fixtures/pypi.org/json/clikit/0.2.4.json b/tests/repositories/fixtures/pypi.org/json/clikit/0.2.4.json index 633cf18be8c..00c7fbf0352 100644 --- a/tests/repositories/fixtures/pypi.org/json/clikit/0.2.4.json +++ b/tests/repositories/fixtures/pypi.org/json/clikit/0.2.4.json @@ -13,7 +13,7 @@ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], - "description": "# CliKit\n\nCliKit is a group of utilities to build beautiful and testable command line interfaces.\n\nThis is at the core of [Cleo](https://github.com/sdispater/cleo).\n", + "description": "", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", @@ -53,13 +53,13 @@ { "comment_text": "", "digests": { - "md5": "280f18c82d0810c9b5ca11380529c04c", - "sha256": "a7597999555aeb2ce9946f07187f690ab6864213f337e51250178c4bd19bd810" + "md5": "c3558fef2a1148bb1df96376def5c8fe", + "sha256": "60900adbac91d6d2cefc88efe2639ce3090f4520106596ac855bee3763f276c0" }, "downloads": -1, "filename": "clikit-0.2.4-py2.py3-none-any.whl", "has_sig": false, - "md5_digest": "280f18c82d0810c9b5ca11380529c04c", + "md5_digest": "c3558fef2a1148bb1df96376def5c8fe", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", @@ -73,13 +73,13 @@ { "comment_text": "", "digests": { - "md5": "2543daad83b072e960ded5f68074a443", - "sha256": "d6807cf4a41e6b981b056075c0aefca2db1dabc597ed18fa4d92b8b2e2678835" + "md5": "f7cdbad3508038a04561f646aae68146", + "sha256": "0fdd41e86e8b118a8b1e94ef2835925ada541d481c9b3b2fc635fa68713e6125" }, "downloads": -1, "filename": "clikit-0.2.4.tar.gz", "has_sig": false, - "md5_digest": "2543daad83b072e960ded5f68074a443", + "md5_digest": "f7cdbad3508038a04561f646aae68146", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", diff --git a/tests/repositories/fixtures/pypi.org/json/colorama.json b/tests/repositories/fixtures/pypi.org/json/colorama.json index 62320e74c64..463302eb1ad 100644 --- a/tests/repositories/fixtures/pypi.org/json/colorama.json +++ b/tests/repositories/fixtures/pypi.org/json/colorama.json @@ -5,16 +5,16 @@ "filename": "colorama-0.3.9-py2.py3-none-any.whl", "url": "https://files.pythonhosted.org/packages/db/c8/7dcf9dbcb22429512708fe3a547f8b6101c0d02137acbd892505aee57adf/colorama-0.3.9-py2.py3-none-any.whl", "hashes": { - "md5": "cc0c01c7b3b34d0354d813e9ab26aca3", - "sha256": "463f8483208e921368c9f306094eb6f725c6ca42b0f97e313cb5d5512459feda" + "md5": "faef2bbd3c2ecc43e0969877d67b4c92", + "sha256": "5b632359f1ed2b7676a869812ba0edaacb99be04679b29eb56c07a5e137ab5a2" } }, { "filename": "colorama-0.3.9.tar.gz", "url": "https://files.pythonhosted.org/packages/e6/76/257b53926889e2835355d74fec73d82662100135293e17d382e2b74d1669/colorama-0.3.9.tar.gz", "hashes": { - "md5": "3a0e415259690f4dd7455c2683ee5850", - "sha256": "48eb22f4f8461b1df5734a074b57042430fb06e1d61bd1e11b078c0fe6d7a1f1" + "md5": "8323a5b84fdf7ad810804e51fc256b39", + "sha256": "4c5a15209723ce1330a5c193465fe221098f761e9640d823a2ce7c03f983137f" } } ], diff --git a/tests/repositories/fixtures/pypi.org/json/colorama/0.3.9.json b/tests/repositories/fixtures/pypi.org/json/colorama/0.3.9.json index 6ddef249f6c..e0fd27a132d 100644 --- a/tests/repositories/fixtures/pypi.org/json/colorama/0.3.9.json +++ b/tests/repositories/fixtures/pypi.org/json/colorama/0.3.9.json @@ -49,13 +49,13 @@ { "comment_text": "", "digests": { - "md5": "cc0c01c7b3b34d0354d813e9ab26aca3", - "sha256": "463f8483208e921368c9f306094eb6f725c6ca42b0f97e313cb5d5512459feda" + "md5": "faef2bbd3c2ecc43e0969877d67b4c92", + "sha256": "5b632359f1ed2b7676a869812ba0edaacb99be04679b29eb56c07a5e137ab5a2" }, "downloads": -1, "filename": "colorama-0.3.9-py2.py3-none-any.whl", "has_sig": false, - "md5_digest": "cc0c01c7b3b34d0354d813e9ab26aca3", + "md5_digest": "faef2bbd3c2ecc43e0969877d67b4c92", "packagetype": "bdist_wheel", "python_version": "2.7", "size": 20181, @@ -65,13 +65,13 @@ { "comment_text": "", "digests": { - "md5": "3a0e415259690f4dd7455c2683ee5850", - "sha256": "48eb22f4f8461b1df5734a074b57042430fb06e1d61bd1e11b078c0fe6d7a1f1" + "md5": "8323a5b84fdf7ad810804e51fc256b39", + "sha256": "4c5a15209723ce1330a5c193465fe221098f761e9640d823a2ce7c03f983137f" }, "downloads": -1, "filename": "colorama-0.3.9.tar.gz", "has_sig": false, - "md5_digest": "3a0e415259690f4dd7455c2683ee5850", + "md5_digest": "8323a5b84fdf7ad810804e51fc256b39", "packagetype": "sdist", "python_version": "source", "size": 25053, diff --git a/tests/repositories/fixtures/pypi.org/json/discord-py.json b/tests/repositories/fixtures/pypi.org/json/discord-py.json new file mode 100644 index 00000000000..fd5845edbfe --- /dev/null +++ b/tests/repositories/fixtures/pypi.org/json/discord-py.json @@ -0,0 +1,44 @@ +{ + "files": [ + { + "core-metadata": { + "sha256": "9a67e27fe067ace2169e406619fcf39ac779d60060bb658cb85dc4682c85f634" + }, + "data-dist-info-metadata": { + "sha256": "9a67e27fe067ace2169e406619fcf39ac779d60060bb658cb85dc4682c85f634" + }, + "filename": "discord.py-2.0.0-py3-none-any.whl", + "hashes": { + "md5": "8ffc907807f8351401dbe4408dcaff79", + "sha256": "054c3d8cf89a8e37a691e0268232dad23e07f4e9a06f33454c3bafeaba34a9b7" + }, + "requires-python": ">=3.8.0", + "size": 1059049, + "upload-time": "2022-08-18T03:47:52.438785Z", + "url": "https://files.pythonhosted.org/packages/0e/d9/7b057cab41c16144925ba4f96dab576a8ebb7b80a98d40e06bd94298eb3b/discord.py-2.0.0-py3-none-any.whl", + "yanked": false + }, + { + "core-metadata": false, + "data-dist-info-metadata": false, + "filename": "discord.py-2.0.0.tar.gz", + "hashes": { + "md5": "6c0505a6032342b29f31f9979f37d277", + "sha256": "b86fa9dd562684f7a52564e6dfe0216f6c172a009c0d86b8dea8bdd6ffa6b1f4" + }, + "requires-python": ">=3.8.0", + "size": 955054, + "upload-time": "2022-08-18T03:47:54.173712Z", + "url": "https://files.pythonhosted.org/packages/4c/73/fb89115b07588bf7a46e9eca972b89dd62b5856abd52297fe130b41d9d63/discord.py-2.0.0.tar.gz", + "yanked": false + } + ], + "meta": { + "_last-serial": 19260702, + "api-version": "1.1" + }, + "name": "discord-py", + "versions": [ + "2.0.0" + ] +} diff --git a/tests/repositories/fixtures/pypi.org/json/discord-py/2.0.0.json b/tests/repositories/fixtures/pypi.org/json/discord-py/2.0.0.json index be44790b769..5201120cb2e 100644 --- a/tests/repositories/fixtures/pypi.org/json/discord-py/2.0.0.json +++ b/tests/repositories/fixtures/pypi.org/json/discord-py/2.0.0.json @@ -71,13 +71,13 @@ { "comment_text": "", "digests": { - "md5": "4df2fceef99934d1fdac5a9b0aa94173", - "sha256": "18b06870bdc85d29e0d55f4a4b2abe9d7cdae2b197e23d49f82886ba27ba1aec" + "md5": "8ffc907807f8351401dbe4408dcaff79", + "sha256": "054c3d8cf89a8e37a691e0268232dad23e07f4e9a06f33454c3bafeaba34a9b7" }, "downloads": -1, "filename": "discord.py-2.0.0-py3-none-any.whl", "has_sig": false, - "md5_digest": "4df2fceef99934d1fdac5a9b0aa94173", + "md5_digest": "8ffc907807f8351401dbe4408dcaff79", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.8.0", @@ -91,13 +91,13 @@ { "comment_text": "", "digests": { - "md5": "3aaca51997210bd2ae4d4b5401c00ab7", - "sha256": "c36f26935938194c3465c2abf8ecfbbf5560c50b189f1b746d6f00d1e78c0d3b" + "md5": "6c0505a6032342b29f31f9979f37d277", + "sha256": "b86fa9dd562684f7a52564e6dfe0216f6c172a009c0d86b8dea8bdd6ffa6b1f4" }, "downloads": -1, "filename": "discord.py-2.0.0.tar.gz", "has_sig": false, - "md5_digest": "3aaca51997210bd2ae4d4b5401c00ab7", + "md5_digest": "6c0505a6032342b29f31f9979f37d277", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.8.0", diff --git a/tests/repositories/fixtures/pypi.org/json/funcsigs.json b/tests/repositories/fixtures/pypi.org/json/funcsigs.json index 2b42d6bee3e..fa281d8b055 100644 --- a/tests/repositories/fixtures/pypi.org/json/funcsigs.json +++ b/tests/repositories/fixtures/pypi.org/json/funcsigs.json @@ -5,16 +5,16 @@ "filename": "funcsigs-1.0.2-py2.py3-none-any.whl", "url": "https://files.pythonhosted.org/packages/69/cb/f5be453359271714c01b9bd06126eaf2e368f1fddfff30818754b5ac2328/funcsigs-1.0.2-py2.py3-none-any.whl", "hashes": { - "md5": "701d58358171f34b6d1197de2923a35a", - "sha256": "330cc27ccbf7f1e992e69fef78261dc7c6569012cf397db8d3de0234e6c937ca" + "md5": "bb61ae651a30926a4b4723e68f97238f", + "sha256": "510ab97424949e726b4b44294018e90142c9aadf8e737cf3a125b4cffed42e79" } }, { "filename": "funcsigs-1.0.2.tar.gz", "url": "https://files.pythonhosted.org/packages/94/4a/db842e7a0545de1cdb0439bb80e6e42dfe82aaeaadd4072f2263a4fbed23/funcsigs-1.0.2.tar.gz", "hashes": { - "md5": "7e583285b1fb8a76305d6d68f4ccc14e", - "sha256": "a7bb0f2cf3a3fd1ab2732cb49eba4252c2af4240442415b4abce3b87022a8f50" + "md5": "e6206f7ae6f315c05108d5b587cccc3e", + "sha256": "c55716fcd1228645c214b44568d1fb9af2e28668a9c58e72a17a89a75d24ecd6" } } ], diff --git a/tests/repositories/fixtures/pypi.org/json/funcsigs/1.0.2.json b/tests/repositories/fixtures/pypi.org/json/funcsigs/1.0.2.json index 487ed79f531..9b35de33490 100644 --- a/tests/repositories/fixtures/pypi.org/json/funcsigs/1.0.2.json +++ b/tests/repositories/fixtures/pypi.org/json/funcsigs/1.0.2.json @@ -48,13 +48,13 @@ { "comment_text": "", "digests": { - "md5": "701d58358171f34b6d1197de2923a35a", - "sha256": "330cc27ccbf7f1e992e69fef78261dc7c6569012cf397db8d3de0234e6c937ca" + "md5": "bb61ae651a30926a4b4723e68f97238f", + "sha256": "510ab97424949e726b4b44294018e90142c9aadf8e737cf3a125b4cffed42e79" }, "downloads": -1, "filename": "funcsigs-1.0.2-py2.py3-none-any.whl", "has_sig": true, - "md5_digest": "701d58358171f34b6d1197de2923a35a", + "md5_digest": "bb61ae651a30926a4b4723e68f97238f", "packagetype": "bdist_wheel", "python_version": "2.7", "size": 17697, @@ -64,13 +64,13 @@ { "comment_text": "", "digests": { - "md5": "7e583285b1fb8a76305d6d68f4ccc14e", - "sha256": "a7bb0f2cf3a3fd1ab2732cb49eba4252c2af4240442415b4abce3b87022a8f50" + "md5": "e6206f7ae6f315c05108d5b587cccc3e", + "sha256": "c55716fcd1228645c214b44568d1fb9af2e28668a9c58e72a17a89a75d24ecd6" }, "downloads": -1, "filename": "funcsigs-1.0.2.tar.gz", "has_sig": true, - "md5_digest": "7e583285b1fb8a76305d6d68f4ccc14e", + "md5_digest": "e6206f7ae6f315c05108d5b587cccc3e", "packagetype": "sdist", "python_version": "source", "size": 27947, diff --git a/tests/repositories/fixtures/pypi.org/json/futures.json b/tests/repositories/fixtures/pypi.org/json/futures.json new file mode 100644 index 00000000000..41bb30b02b0 --- /dev/null +++ b/tests/repositories/fixtures/pypi.org/json/futures.json @@ -0,0 +1,44 @@ +{ + "files": [ + { + "core-metadata": { + "sha256": "02a2b035758c39be414a32a2582d2c4f072465cb99b487c727d145d863052ffe" + }, + "data-dist-info-metadata": { + "sha256": "02a2b035758c39be414a32a2582d2c4f072465cb99b487c727d145d863052ffe" + }, + "filename": "futures-3.2.0-py2-none-any.whl", + "hashes": { + "md5": "33e76564a87766c3e186d986ddc55bd8", + "sha256": "d89e1540e8b553fbda912230db359954365a1f5d0d0fa7fab96ad3969d9d5a93" + }, + "requires-python": ">=2.6, <3", + "size": 15847, + "upload-time": "2017-11-30T23:22:35.590688Z", + "url": "https://files.pythonhosted.org/packages/2d/99/b2c4e9d5a30f6471e410a146232b4118e697fa3ffc06d6a65efde84debd0/futures-3.2.0-py2-none-any.whl", + "yanked": false + }, + { + "core-metadata": false, + "data-dist-info-metadata": false, + "filename": "futures-3.2.0.tar.gz", + "hashes": { + "md5": "40eb168dab84e606df3fdb7e67fe27b7", + "sha256": "baf0d469c9e541b747986b7404cd63a5496955bd0c43a3cc068c449b09b7d4a4" + }, + "requires-python": ">=2.6, <3", + "size": 27320, + "upload-time": "2017-11-30T23:22:36.994073Z", + "url": "https://files.pythonhosted.org/packages/1f/9e/7b2ff7e965fc654592269f2906ade1c7d705f1bf25b7d469fa153f7d19eb/futures-3.2.0.tar.gz", + "yanked": false + } + ], + "meta": { + "_last-serial": 15602876, + "api-version": "1.1" + }, + "name": "futures", + "versions": [ + "3.2.0" + ] +} diff --git a/tests/repositories/fixtures/pypi.org/json/futures/3.2.0.json b/tests/repositories/fixtures/pypi.org/json/futures/3.2.0.json new file mode 100644 index 00000000000..5214a1bcc03 --- /dev/null +++ b/tests/repositories/fixtures/pypi.org/json/futures/3.2.0.json @@ -0,0 +1,89 @@ +{ + "info": { + "author": "Alex Grönholm", + "author_email": "alex.gronholm@nextday.fi", + "bugtrack_url": null, + "classifiers": [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: Python Software Foundation License", + "Programming Language :: Python :: 2 :: Only", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7" + ], + "description": "", + "description_content_type": null, + "docs_url": "https://pythonhosted.org/futures/", + "download_url": "", + "downloads": { + "last_day": -1, + "last_month": -1, + "last_week": -1 + }, + "dynamic": null, + "home_page": "https://github.com/agronholm/pythonfutures", + "keywords": "", + "license": "PSF", + "maintainer": "", + "maintainer_email": "", + "name": "futures", + "package_url": "https://pypi.org/project/futures/", + "platform": "", + "project_url": "https://pypi.org/project/futures/", + "project_urls": { + "Homepage": "https://github.com/agronholm/pythonfutures" + }, + "provides_extra": null, + "release_url": "https://pypi.org/project/futures/3.2.0/", + "requires_dist": null, + "requires_python": ">=2.6, <3", + "summary": "Backport of the concurrent.futures package from Python 3", + "version": "3.2.0", + "yanked": false, + "yanked_reason": null + }, + "last_serial": 15602876, + "urls": [ + { + "comment_text": "", + "digests": { + "md5": "33e76564a87766c3e186d986ddc55bd8", + "sha256": "d89e1540e8b553fbda912230db359954365a1f5d0d0fa7fab96ad3969d9d5a93" + }, + "downloads": -1, + "filename": "futures-3.2.0-py2-none-any.whl", + "has_sig": false, + "md5_digest": "33e76564a87766c3e186d986ddc55bd8", + "packagetype": "bdist_wheel", + "python_version": "py2", + "requires_python": ">=2.6, <3", + "size": 15847, + "upload_time": "2017-11-30T23:22:35", + "upload_time_iso_8601": "2017-11-30T23:22:35.590688Z", + "url": "https://files.pythonhosted.org/packages/2d/99/b2c4e9d5a30f6471e410a146232b4118e697fa3ffc06d6a65efde84debd0/futures-3.2.0-py2-none-any.whl", + "yanked": false, + "yanked_reason": null + }, + { + "comment_text": "", + "digests": { + "md5": "40eb168dab84e606df3fdb7e67fe27b7", + "sha256": "baf0d469c9e541b747986b7404cd63a5496955bd0c43a3cc068c449b09b7d4a4" + }, + "downloads": -1, + "filename": "futures-3.2.0.tar.gz", + "has_sig": false, + "md5_digest": "40eb168dab84e606df3fdb7e67fe27b7", + "packagetype": "sdist", + "python_version": "source", + "requires_python": ">=2.6, <3", + "size": 27320, + "upload_time": "2017-11-30T23:22:36", + "upload_time_iso_8601": "2017-11-30T23:22:36.994073Z", + "url": "https://files.pythonhosted.org/packages/1f/9e/7b2ff7e965fc654592269f2906ade1c7d705f1bf25b7d469fa153f7d19eb/futures-3.2.0.tar.gz", + "yanked": false, + "yanked_reason": null + } + ], + "vulnerabilities": [] +} diff --git a/tests/repositories/fixtures/pypi.org/json/hbmqtt.json b/tests/repositories/fixtures/pypi.org/json/hbmqtt.json index 8032605d360..20f4a9764eb 100644 --- a/tests/repositories/fixtures/pypi.org/json/hbmqtt.json +++ b/tests/repositories/fixtures/pypi.org/json/hbmqtt.json @@ -1,342 +1,10 @@ { "files": [ - { - "filename": "hbmqtt-0.1-py3.4.egg", - "hashes": { - "sha256": "9f8b970df1d2ae066232398ef25f0f0e78ca056bb94546cf4a5abdbca11264f0" - }, - "requires-python": null, - "url": "https://files.pythonhosted.org/packages/55/77/254c0c8fd2f76b675b4bf86a1e311ced1275ecc31f4d023721fe4176d5bd/hbmqtt-0.1-py3.4.egg", - "yanked": false - }, - { - "filename": "hbmqtt-0.1.tar.gz", - "hashes": { - "sha256": "dbc1ac9a7d176f238a2426ea83f37035b8e9362ccfc21b00d56304b9611fb2e1" - }, - "requires-python": null, - "url": "https://files.pythonhosted.org/packages/fc/48/25d1fc267ccf01c02a677d4d18ec1ced1792e22f96e8e0f822c372c54ced/hbmqtt-0.1.tar.gz", - "yanked": false - }, - { - "filename": "hbmqtt-0.2-py3.4.egg", - "hashes": { - "sha256": "3122a884d0dda0bb1ca77245c37a6b4c0dce1be01886a629fd7521ee12728940" - }, - "requires-python": null, - "url": "https://files.pythonhosted.org/packages/d2/f6/2c5b5d4a00520b0d414766303d3c34005957e8eeab075a4e85198f51d8d5/hbmqtt-0.2-py3.4.egg", - "yanked": false - }, - { - "filename": "hbmqtt-0.2.tar.gz", - "hashes": { - "sha256": "74bce279020646a7d0057df62dd6b9c3cdf800be28334297f1d0a675a3135d34" - }, - "requires-python": null, - "url": "https://files.pythonhosted.org/packages/8a/2c/f810278f1747f5065a3e02d1c1fb50ec24795e5fdd8817636ee86cb0e3db/hbmqtt-0.2.tar.gz", - "yanked": false - }, - { - "filename": "hbmqtt-0.3.macosx-10.6-intel.tar.gz", - "hashes": { - "sha256": "73a2bd9fe49bb34cf0e62bb891ff6212c6eaadc87d6f613481f048329b7fd5a4" - }, - "requires-python": null, - "url": "https://files.pythonhosted.org/packages/d5/0f/1519d8109bbc1475dcd47199b9ba4add6548b78b63c5c1732c24b895e8ad/hbmqtt-0.3.macosx-10.6-intel.tar.gz", - "yanked": false - }, - { - "filename": "hbmqtt-0.3.tar.gz", - "hashes": { - "sha256": "a8b9d3e3ebb9320de53d18d843855153ac983fdedc656aa7ac71e4223182a56d" - }, - "requires-python": null, - "url": "https://files.pythonhosted.org/packages/a7/a2/0973f49c64ef86dab91d42aa68f002948dd2d3ef427383c19cd6fb5c1e37/hbmqtt-0.3.tar.gz", - "yanked": false - }, - { - "filename": "hbmqtt-0.4.macosx-10.6-intel.tar.gz", - "hashes": { - "sha256": "c00c34a7318fb395053c41627f826615c1e4fe6166a162b1e6b4dd863ac6e5c4" - }, - "requires-python": null, - "url": "https://files.pythonhosted.org/packages/6c/94/926d102eab2e399842f1871858bb45f59c60b2cb561e6bba2e1b2f544bcf/hbmqtt-0.4.macosx-10.6-intel.tar.gz", - "yanked": false - }, - { - "filename": "hbmqtt-0.4.tar.gz", - "hashes": { - "sha256": "3e3b34af8e5ad73be32499aa4992ba94582c1cdbcaba3a691e5825a25b27e1ee" - }, - "requires-python": null, - "url": "https://files.pythonhosted.org/packages/41/9c/c2d51d88e87cbeb61dba3812caa3a3b725ebf1f6ae1b413359707539313a/hbmqtt-0.4.tar.gz", - "yanked": false - }, - { - "filename": "hbmqtt-0.5.macosx-10.6-intel.tar.gz", - "hashes": { - "sha256": "d81b84811bc82b919f91454592e302bb810bef7bd82a34bd1b57a2dc954f79d4" - }, - "requires-python": null, - "url": "https://files.pythonhosted.org/packages/91/e7/e23871fb0622e3ed4f2e2637b2ef8fd40d521912a78efb829c3f78711b6d/hbmqtt-0.5.macosx-10.6-intel.tar.gz", - "yanked": false - }, - { - "filename": "hbmqtt-0.5.tar.gz", - "hashes": { - "sha256": "bfe38e2b13181fab352512a8bf61e6e7b8167be46937b87117fd70c3ef863937" - }, - "requires-python": null, - "url": "https://files.pythonhosted.org/packages/bf/8f/948baa9fe730b79cc0bbc69fab0a15b53e5cd91935cd8afd507cadf1553e/hbmqtt-0.5.tar.gz", - "yanked": false - }, - { - "filename": "hbmqtt-0.5.1-py34-none-any.whl", - "hashes": { - "sha256": "699fe6917cadf6fe535d331e282eee45423275b56ce6bb6b225d789bd742db53" - }, - "requires-python": null, - "url": "https://files.pythonhosted.org/packages/75/f2/3ec5faf3be0b6407fdfe504e0d3af7568e821286b602b6744b8743722e19/hbmqtt-0.5.1-py34-none-any.whl", - "yanked": false - }, - { - "filename": "hbmqtt-0.6-py34-none-any.whl", - "hashes": { - "sha256": "dd95125c7132ee753ceb5a15a5a0ce04bd86f9983b4a2dae3a9c1fc46dafa942" - }, - "requires-python": "", - "url": "https://files.pythonhosted.org/packages/fa/d7/c4c71b8388cf20dfc8705d6c635e15c3ef268cf0ab23ad1ef25a1e9be86d/hbmqtt-0.6-py34-none-any.whl", - "yanked": false - }, - { - "filename": "hbmqtt-0.6.tar.gz", - "hashes": { - "sha256": "8caeb4d7d091d3dd2cad78981f5242fa20f625458d0f114637adcbef3839abd4" - }, - "requires-python": "", - "url": "https://files.pythonhosted.org/packages/ba/3f/af82c3d1a67d7f0b7e3d4446b3c0dd4913e7e00edb3c43a3b44b868adc44/hbmqtt-0.6.tar.gz", - "yanked": false - }, - { - "filename": "hbmqtt-0.6.1-py34-none-any.whl", - "hashes": { - "sha256": "3f6ca2d0e9fd239c658e6024c03d7156a3d41299e5aec246ec41dc76fa04db84" - }, - "requires-python": null, - "url": "https://files.pythonhosted.org/packages/4f/f8/846766e3bee221457cd4332001d92e1d95a02b66f3dfdbb66f4677bbd3ba/hbmqtt-0.6.1-py34-none-any.whl", - "yanked": false - }, - { - "filename": "hbmqtt-0.6.2-py34-none-any.whl", - "hashes": { - "sha256": "8ef4587daabc651aaf9dd358b01d3deb5ff384e2d2412650f01b136b8de3dcc2" - }, - "requires-python": null, - "url": "https://files.pythonhosted.org/packages/3c/85/1618dc19ec571cb2251269107f42bd8b1b67007ea076ef9f31c437ec41d2/hbmqtt-0.6.2-py34-none-any.whl", - "yanked": false - }, - { - "filename": "hbmqtt-0.6.3-py34-none-any.whl", - "hashes": { - "sha256": "8c3290a6d8afbdd74bd5b7f31d3e85f9a1b274a0e26367b0b52eda38323d3f03" - }, - "requires-python": null, - "url": "https://files.pythonhosted.org/packages/10/9c/3bda698c0be0e112d4295f726496b7e3e4518818d08d5a035f7832e40114/hbmqtt-0.6.3-py34-none-any.whl", - "yanked": false - }, - { - "filename": "hbmqtt-0.7-py34.py35-none-any.whl", - "hashes": { - "sha256": "7b01ca7b9874f12ae2333ef27a33b8480611be50aeb62587882bcfb521f99203" - }, - "requires-python": null, - "url": "https://files.pythonhosted.org/packages/89/e2/ee7c6fa7468954d67b90819710a4582bfa3f4565cef1f510332d1c9612ba/hbmqtt-0.7-py34.py35-none-any.whl", - "yanked": false - }, - { - "filename": "hbmqtt-0.7.1-py34.py35-none-any.whl", - "hashes": { - "sha256": "d6ee222bc182615fa99e5c9e71aa6b4e23d266b1d284dda8e3cc93fc3478d311" - }, - "requires-python": null, - "url": "https://files.pythonhosted.org/packages/fd/75/7c2ee26f2c2ff3c796d1c4d577c26b559eb82e57fffb221304c16fd8a134/hbmqtt-0.7.1-py34.py35-none-any.whl", - "yanked": false - }, - { - "filename": "hbmqtt-0.7.3-py34.py35-none-any.whl", - "hashes": { - "sha256": "21a4482c74511061a24a678c74785677e7c26601fa516298a6aaa80527b4ba2f" - }, - "requires-python": null, - "url": "https://files.pythonhosted.org/packages/03/8f/473d217c22d174dbbd47de3c6ed2bc5424a30cd08f0b5c8c4440ac514dd4/hbmqtt-0.7.3-py34.py35-none-any.whl", - "yanked": false - }, - { - "filename": "hbmqtt-0.8.dev20160507052755-py34.py35-none-any.whl", - "hashes": { - "sha256": "c284329b0037d79648c5828f18c0f09ce62764df1d31f53aebb221561903adcb" - }, - "requires-python": null, - "url": "https://files.pythonhosted.org/packages/8e/f2/bd6306a45035c7d7a89727e3378035cd0f530b3a59af9c2308618f314357/hbmqtt-0.8.dev20160507052755-py34.py35-none-any.whl", - "yanked": false - }, - { - "filename": "hbmqtt-0.8.macosx-10.6-intel.tar.gz", - "hashes": { - "sha256": "c046161359f4b6ee8874da9a05f06db9ebc9bd494e478f7c735f0c54e0aa7eb4" - }, - "requires-python": null, - "url": "https://files.pythonhosted.org/packages/1c/d7/7949b2a5ce4fd6fdc2e2af92a5843417689fdccf84382814f14c82b2ff0f/hbmqtt-0.8.macosx-10.6-intel.tar.gz", - "yanked": false - }, - { - "filename": "hbmqtt-0.8.tar.gz", - "hashes": { - "sha256": "ef341b64c653b62fe5a93747363a97b90e1b97dd9a8968f80349fb40971fe8d4" - }, - "requires-python": null, - "url": "https://files.pythonhosted.org/packages/4f/bf/e8b686f9cc98396de0e7258d95ebb8914b44fd63e5e0117eb6f443c7f2cf/hbmqtt-0.8.tar.gz", - "yanked": false - }, - { - "filename": "hbmqtt-0.9.macosx-10.6-intel.tar.gz", - "hashes": { - "sha256": "a682dbdea33b95bb18122ba3e2d2606b6dc95f0d955f997a981b73a476da6452" - }, - "requires-python": null, - "url": "https://files.pythonhosted.org/packages/d7/56/0899ca18cc204fbb8d01f466b64bbec4b7938ed5f95c4e1c7a97a1131f87/hbmqtt-0.9.macosx-10.6-intel.tar.gz", - "yanked": false - }, - { - "filename": "hbmqtt-0.9.tar.gz", - "hashes": { - "sha256": "9e290992f66424f0ab67c790c839d76dc1c477329a8fab6a6c466362180ff07f" - }, - "requires-python": null, - "url": "https://files.pythonhosted.org/packages/e0/cc/4428dc925d9119d9242a2af10c8185de621c7e3758d2ed9c4fa5a2bf9b18/hbmqtt-0.9.tar.gz", - "yanked": false - }, - { - "filename": "hbmqtt-0.9.1-py34.py35-none-any.whl", - "hashes": { - "sha256": "b3b786ea3c50a2b1da6a05d56bccc910626cf607071eeaf1360648e2e0bf4b0b" - }, - "requires-python": "", - "url": "https://files.pythonhosted.org/packages/af/94/1593797f833c490f029b9a7cfbc8e3c38d9f05c7fe841d768e92decbee7c/hbmqtt-0.9.1-py34.py35-none-any.whl", - "yanked": false - }, - { - "filename": "hbmqtt-0.9.1.tar.gz", - "hashes": { - "sha256": "3d730429f1d6f9fc10ffceea1b516bb38e9c90b97fd30c31672f39823cc39812" - }, - "requires-python": "", - "url": "https://files.pythonhosted.org/packages/a1/e2/594b1c63d970eb5bcbe88c30cb41ca046c722ce17181045e54b7a894a9fc/hbmqtt-0.9.1.tar.gz", - "yanked": false - }, - { - "filename": "hbmqtt-0.9.2-py2.py3-none-any.whl", - "hashes": { - "sha256": "380a42018df78c480488659183341c369ae3cd0375914f77f979250bcacb21ae" - }, - "requires-python": "", - "url": "https://files.pythonhosted.org/packages/64/2d/128401e6b45f71e51e5705a95cbfd327f83ad9220d5e8212756825ec8f25/hbmqtt-0.9.2-py2.py3-none-any.whl", - "yanked": false - }, - { - "filename": "hbmqtt-0.9.2.tar.gz", - "hashes": { - "sha256": "6f61e05007648a4f33e300fafcf42776ca95508ba1141799f94169427ce5018c" - }, - "requires-python": "", - "url": "https://files.pythonhosted.org/packages/42/e4/74d299d9cca3aae4be607ea8f3de1a76a3d63cf397da5c0ea0fb128dce79/hbmqtt-0.9.2.tar.gz", - "yanked": false - }, - { - "filename": "hbmqtt-0.9.3-py2.py3-none-any.whl", - "hashes": { - "sha256": "957b946b9ccd89d71401a6240160f30363ecfe813703d53083156c6ded07a8ba" - }, - "requires-python": "", - "url": "https://files.pythonhosted.org/packages/8f/ff/cdd3c040dd4a0c3994b7bc88d02f38b5fa50300e5f6416cf748783f2a2ea/hbmqtt-0.9.3-py2.py3-none-any.whl", - "yanked": false - }, - { - "filename": "hbmqtt-0.9.3.tar.gz", - "hashes": { - "sha256": "ba437eedae43496bb9b7e006f096758adfb854df95bd1d711cfec053d23fe207" - }, - "requires-python": "", - "url": "https://files.pythonhosted.org/packages/fe/0e/1470eb7ff7bef15e11c81674fe34c47ae05f5e334c500f2184bb08767222/hbmqtt-0.9.3.tar.gz", - "yanked": false - }, - { - "filename": "hbmqtt-0.9.4-py2.py3-none-any.whl", - "hashes": { - "sha256": "1592d7b74fba12361808c9f687fc7a38b4da386a599dfab175f3d292a73c8f60" - }, - "requires-python": "", - "url": "https://files.pythonhosted.org/packages/39/03/2c3042967200e995587a869b5974b9e28e53cae6bbd5e7256ef8a405c4f4/hbmqtt-0.9.4-py2.py3-none-any.whl", - "yanked": false - }, - { - "filename": "hbmqtt-0.9.4-py34.py35-none-any.whl", - "hashes": { - "sha256": "719bdff59055256e2933567bd329f2fb3a8a70f6fa03f68183ac6c6305bdfca5" - }, - "requires-python": "", - "url": "https://files.pythonhosted.org/packages/7c/55/fbc09e1321419b1d67e3723ba58770c42c8f78c14d219a97f53893c53f9a/hbmqtt-0.9.4-py34.py35-none-any.whl", - "yanked": false - }, - { - "filename": "hbmqtt-0.9.4.tar.gz", - "hashes": { - "sha256": "48f2f3ef2beb9924a4c2c10263630e65cf8d11f72c812748a0b2c1b09499602b" - }, - "requires-python": "", - "url": "https://files.pythonhosted.org/packages/8c/91/52b70dcff86befc43c9755594c6322965fc755ba6c4ed25ff737950974e5/hbmqtt-0.9.4.tar.gz", - "yanked": false - }, - { - "filename": "hbmqtt-0.9.5-py2.py3-none-any.whl", - "hashes": { - "sha256": "235fffa4645005536fefb9945084165d9e26cbf889b767f7d896aa929b99d49e" - }, - "requires-python": "", - "url": "https://files.pythonhosted.org/packages/e6/3c/de08eeef75dc4bd86673f48ca4a97b51c9524cf2a32f1ef8ce0bfae81270/hbmqtt-0.9.5-py2.py3-none-any.whl", - "yanked": false - }, - { - "filename": "hbmqtt-0.9.5.tar.gz", - "hashes": { - "sha256": "9886b1c8321d16e971376dc609b902e0c84118846642b5e09f08a4ca876a7f2a" - }, - "requires-python": "", - "url": "https://files.pythonhosted.org/packages/88/93/fae9bc11ce60ad0b76639eebb3f9bb9c5c8deb52864349a7f6bb487d2b0c/hbmqtt-0.9.5.tar.gz", - "yanked": false - }, - { - "filename": "hbmqtt-0.9.6-py3.8.egg", - "hashes": { - "sha256": "57799a933500caadb472000ba0c1e043d4768608cd8142104f89c53930d8613c" - }, - "requires-python": "", - "url": "https://files.pythonhosted.org/packages/4f/4b/69014d0fd585b45bfdb77ef0e70bcf035fc8fc798c2a0610fd7cfae56cfd/hbmqtt-0.9.6-py3.8.egg", - "yanked": false - }, - { - "filename": "hbmqtt-0.9.6.linux-x86_64.tar.gz", - "hashes": { - "sha256": "c83ba91dc5cf9a01f83afb5380701504f69bdf9ea1c071f4dfdc1cba412fcd63" - }, - "requires-python": "", - "url": "https://files.pythonhosted.org/packages/ee/27/912d1d8c307a72985edf0b6ad9fc1c32e22bfc42efbd0244902c43bd9307/hbmqtt-0.9.6.linux-x86_64.tar.gz", - "yanked": false - }, { "filename": "hbmqtt-0.9.6.tar.gz", "hashes": { - "sha256": "6764d3c7cf6d056238c04709c23dbb72e2b0227495efd871c2f1da10a4472cd9" + "md5": "b284e3118882f169aa618a856cd91c5f", + "sha256": "379f1d9044997c69308ac2e01621c817b5394e1fbe0696e62538ae2dd0aa7e07" }, "requires-python": "", "url": "https://files.pythonhosted.org/packages/b4/7c/7e1d47e740915bd628f4038083469c5919e759a638f45abab01e09e933cb/hbmqtt-0.9.6.tar.gz", diff --git a/tests/repositories/fixtures/pypi.org/json/hbmqtt/0.9.6.json b/tests/repositories/fixtures/pypi.org/json/hbmqtt/0.9.6.json index 5d58083834f..48ccf5b404f 100644 --- a/tests/repositories/fixtures/pypi.org/json/hbmqtt/0.9.6.json +++ b/tests/repositories/fixtures/pypi.org/json/hbmqtt/0.9.6.json @@ -90,13 +90,13 @@ { "comment_text": "", "digests": { - "md5": "cc1f010f129465cc396339640fcffed9", - "sha256": "6764d3c7cf6d056238c04709c23dbb72e2b0227495efd871c2f1da10a4472cd9" + "md5": "b284e3118882f169aa618a856cd91c5f", + "sha256": "379f1d9044997c69308ac2e01621c817b5394e1fbe0696e62538ae2dd0aa7e07" }, "downloads": -1, "filename": "hbmqtt-0.9.6.tar.gz", "has_sig": false, - "md5_digest": "cc1f010f129465cc396339640fcffed9", + "md5_digest": "b284e3118882f169aa618a856cd91c5f", "packagetype": "sdist", "python_version": "source", "requires_python": null, diff --git a/tests/repositories/fixtures/pypi.org/json/importlib-metadata.json b/tests/repositories/fixtures/pypi.org/json/importlib-metadata.json index 2796a50aadb..ee4ff1bafec 100644 --- a/tests/repositories/fixtures/pypi.org/json/importlib-metadata.json +++ b/tests/repositories/fixtures/pypi.org/json/importlib-metadata.json @@ -3,8 +3,8 @@ "files": [ { "hashes": { - "md5": "8ae1f31228e29443c08e07501a99d1b8", - "sha256": "dc15b2969b4ce36305c51eebe62d418ac7791e9a157911d58bfb1f9ccd8e2070" + "md5": "7cfd9d7d6dbaf8c0ea81cc0c86a63c30", + "sha256": "7e161a9fc58a218ba5d2d49827331b977cc421fd42f681488fb90c0ce9ad0097" }, "filename": "importlib_metadata-1.7.0-py2.py3-none-any.whl", "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7", @@ -12,8 +12,8 @@ }, { "hashes": { - "md5": "4505ea85600cca1e693a4f8f5dd27ba8", - "sha256": "90bb658cdbbf6d1735b6341ce708fc7024a3e14e99ffdc5783edea9f9b077f83" + "md5": "35624f96c0aceaa5959f79a1a14f3586", + "sha256": "7a20a5d402d450dd394334e4c6f4f48e728cdef1e52d72f75837a6a455927a1a" }, "filename": "importlib_metadata-1.7.0.tar.gz", "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7", diff --git a/tests/repositories/fixtures/pypi.org/json/importlib-metadata/1.7.0.json b/tests/repositories/fixtures/pypi.org/json/importlib-metadata/1.7.0.json index 595674750f8..bcc44460c10 100644 --- a/tests/repositories/fixtures/pypi.org/json/importlib-metadata/1.7.0.json +++ b/tests/repositories/fixtures/pypi.org/json/importlib-metadata/1.7.0.json @@ -99,13 +99,13 @@ { "comment_text": "", "digests": { - "md5": "8ae1f31228e29443c08e07501a99d1b8", - "sha256": "dc15b2969b4ce36305c51eebe62d418ac7791e9a157911d58bfb1f9ccd8e2070" + "md5": "7cfd9d7d6dbaf8c0ea81cc0c86a63c30", + "sha256": "7e161a9fc58a218ba5d2d49827331b977cc421fd42f681488fb90c0ce9ad0097" }, "downloads": -1, "filename": "importlib_metadata-1.7.0-py2.py3-none-any.whl", "has_sig": false, - "md5_digest": "8ae1f31228e29443c08e07501a99d1b8", + "md5_digest": "7cfd9d7d6dbaf8c0ea81cc0c86a63c30", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7", @@ -119,13 +119,13 @@ { "comment_text": "", "digests": { - "md5": "4505ea85600cca1e693a4f8f5dd27ba8", - "sha256": "90bb658cdbbf6d1735b6341ce708fc7024a3e14e99ffdc5783edea9f9b077f83" + "md5": "35624f96c0aceaa5959f79a1a14f3586", + "sha256": "7a20a5d402d450dd394334e4c6f4f48e728cdef1e52d72f75837a6a455927a1a" }, "downloads": -1, "filename": "importlib_metadata-1.7.0.tar.gz", "has_sig": false, - "md5_digest": "4505ea85600cca1e693a4f8f5dd27ba8", + "md5_digest": "35624f96c0aceaa5959f79a1a14f3586", "packagetype": "sdist", "python_version": "source", "requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7", diff --git a/tests/repositories/fixtures/pypi.org/json/ipython.json b/tests/repositories/fixtures/pypi.org/json/ipython.json new file mode 100644 index 00000000000..d5f7bef227d --- /dev/null +++ b/tests/repositories/fixtures/pypi.org/json/ipython.json @@ -0,0 +1,142 @@ +{ + "files": [ + { + "core-metadata": { + "sha256": "ad06c78c59547c822f72c2758b51935ae8e4056bd8909a8fd8912bf7d9f88fa7" + }, + "data-dist-info-metadata": { + "sha256": "ad06c78c59547c822f72c2758b51935ae8e4056bd8909a8fd8912bf7d9f88fa7" + }, + "filename": "ipython-4.1.0rc1-py2.py3-none-any.whl", + "hashes": { + "md5": "ae0b233f09e1047a0240d30345b8ff91", + "sha256": "b593bcf0c53490f56809805a94b289403c8025859583a71f50c2305860ad187d" + }, + "requires-python": null, + "size": 736900, + "upload-time": "2016-01-26T19:58:35.544443Z", + "url": "https://files.pythonhosted.org/packages/ac/02/04a5d372b4e64f9c97b2846646aec1ce4532885005aa4ba51eb20b80e17f/ipython-4.1.0rc1-py2.py3-none-any.whl", + "yanked": false + }, + { + "core-metadata": false, + "data-dist-info-metadata": false, + "filename": "ipython-4.1.0rc1.tar.gz", + "hashes": { + "md5": "1bdec8cbb110f7c7b991c8d45f626fd4", + "sha256": "d5203d06ac3225a746f856b592aeaffa3d1a7f1efa535263b06bdebc094d9701" + }, + "requires-python": null, + "size": 4933377, + "upload-time": "2016-01-26T19:58:53.938491Z", + "url": "https://files.pythonhosted.org/packages/a0/de/f71f0c8b8a26ef28cc968fbf1859729ad3e68146cd2eb4a759e9c88da218/ipython-4.1.0rc1.tar.gz", + "yanked": false + }, + { + "core-metadata": false, + "data-dist-info-metadata": false, + "filename": "ipython-4.1.0rc1.zip", + "hashes": { + "md5": "1f18b85e1d93dc10554ade23864f02cc", + "sha256": "8fe8ae7e62942f58b24b908fa2bee3dce0e2470a8cd22ea753f2de9bedf5ffc5" + }, + "requires-python": null, + "size": 5100723, + "upload-time": "2016-01-26T19:59:14.449245Z", + "url": "https://files.pythonhosted.org/packages/71/f0/9d670266b840b8b921dc7106ecddd892f6fb893424883498e1ba3ec3a3a1/ipython-4.1.0rc1.zip", + "yanked": false + }, + { + "core-metadata": { + "sha256": "130f1323b932eb7b6fefa2928c20eaeebfa90ef94c06347a3a960566b98bdcd0" + }, + "data-dist-info-metadata": { + "sha256": "130f1323b932eb7b6fefa2928c20eaeebfa90ef94c06347a3a960566b98bdcd0" + }, + "filename": "ipython-5.7.0-py2-none-any.whl", + "hashes": { + "md5": "cf35939995e0fd8c44fca7509308abde", + "sha256": "3d93d3995e2e52a98dc4f44361cd5bf68dbde62925d1f820b97d8f0e1d941f73" + }, + "requires-python": null, + "size": 760413, + "upload-time": "2018-05-10T18:56:05.083695Z", + "url": "https://files.pythonhosted.org/packages/52/19/aadde98d6bde1667d0bf431fb2d22451f880aaa373e0a241c7e7cb5815a0/ipython-5.7.0-py2-none-any.whl", + "yanked": false + }, + { + "core-metadata": { + "sha256": "5251032152a45b01a679c73fab3a836053167987c9343251cd29bd39b8f9f1c7" + }, + "data-dist-info-metadata": { + "sha256": "5251032152a45b01a679c73fab3a836053167987c9343251cd29bd39b8f9f1c7" + }, + "filename": "ipython-5.7.0-py3-none-any.whl", + "hashes": { + "md5": "8805d83c415de06f5eadd55aeb2fa738", + "sha256": "b94c7a3971290024ffaa916d51ee377ee85f8860a62b5f30c58f5376f0956a06" + }, + "requires-python": null, + "size": 760415, + "upload-time": "2018-05-10T18:56:07.665559Z", + "url": "https://files.pythonhosted.org/packages/c7/b6/03e0b5b0972e6161d16c4cec8d41a20372bd0634f8cb4cc0c984b8a91db6/ipython-5.7.0-py3-none-any.whl", + "yanked": false + }, + { + "core-metadata": false, + "data-dist-info-metadata": false, + "filename": "ipython-5.7.0.tar.gz", + "hashes": { + "md5": "01f2808ebe78ff2f28dc39be3aa635ca", + "sha256": "4e7fb265e0264498bd0d62c6261936a658bf3d38beb8a7b10cd2c6327c62ac2a" + }, + "requires-python": null, + "size": 4977745, + "upload-time": "2018-05-10T18:56:17.132984Z", + "url": "https://files.pythonhosted.org/packages/3c/fd/559fead731a29eaa55cc235c8029807b2520976a937c30e9ee603f3bb566/ipython-5.7.0.tar.gz", + "yanked": false + }, + { + "core-metadata": { + "sha256": "3b26900950637e01c03a8de278805adb022c5bbb1e94db2f31d137b5266b7726" + }, + "data-dist-info-metadata": { + "sha256": "3b26900950637e01c03a8de278805adb022c5bbb1e94db2f31d137b5266b7726" + }, + "filename": "ipython-7.5.0-py3-none-any.whl", + "hashes": { + "md5": "99a386eca39b536033c71aacf9f98e2b", + "sha256": "634f505893bbbdb79d1a04d89f4633d8cfc41115337847fbf9d5a23610fc3e3d" + }, + "requires-python": ">=3.5", + "size": 770001, + "upload-time": "2019-04-25T15:38:21.726776Z", + "url": "https://files.pythonhosted.org/packages/a9/2e/41dce4ed129057e05a555a7f9629aa2d5f81fdcd4d16568bc24b75a1d2c9/ipython-7.5.0-py3-none-any.whl", + "yanked": false + }, + { + "core-metadata": false, + "data-dist-info-metadata": false, + "filename": "ipython-7.5.0.tar.gz", + "hashes": { + "md5": "0e8c1d7c14f309f6cd2dfd4e48e75cb1", + "sha256": "cd2a17ac273fea8bf8953118a2d83bad94f592f0db3e83fff9129a1842e36dbe" + }, + "requires-python": ">=3.5", + "size": 5118610, + "upload-time": "2019-04-25T15:38:33.098872Z", + "url": "https://files.pythonhosted.org/packages/75/74/9b0ef91c8e356c907bb12297000951acb804583b54eeaddc342c5bad4d96/ipython-7.5.0.tar.gz", + "yanked": false + } + ], + "meta": { + "_last-serial": 22152965, + "api-version": "1.1" + }, + "name": "ipython", + "versions": [ + "4.1.0rc1", + "5.7.0", + "7.5.0" + ] +} diff --git a/tests/repositories/fixtures/pypi.org/json/ipython/4.1.0rc1.json b/tests/repositories/fixtures/pypi.org/json/ipython/4.1.0rc1.json index df84973213d..150ef97f33e 100644 --- a/tests/repositories/fixtures/pypi.org/json/ipython/4.1.0rc1.json +++ b/tests/repositories/fixtures/pypi.org/json/ipython/4.1.0rc1.json @@ -14,7 +14,7 @@ "Programming Language :: Python :: 3", "Topic :: System :: Shells" ], - "description": "IPython provides a rich toolkit to help you make the most out of using Python\ninteractively. Its main components are:\n\n* A powerful interactive Python shell\n* A `Jupyter `_ kernel to work with Python code in Jupyter\n notebooks and other interactive frontends.\n\nThe enhanced interactive Python shells have the following main features:\n\n* Comprehensive object introspection.\n\n* Input history, persistent across sessions.\n\n* Caching of output results during a session with automatically generated\n references.\n\n* Extensible tab completion, with support by default for completion of python\n variables and keywords, filenames and function keywords.\n\n* Extensible system of 'magic' commands for controlling the environment and\n performing many tasks related either to IPython or the operating system.\n\n* A rich configuration system with easy switching between different setups\n (simpler than changing $PYTHONSTARTUP environment variables every time).\n\n* Session logging and reloading.\n\n* Extensible syntax processing for special purpose situations.\n\n* Access to the system shell with user-extensible alias system.\n\n* Easily embeddable in other Python programs and GUIs.\n\n* Integrated access to the pdb debugger and the Python profiler.\n\nThe latest development version is always available from IPython's `GitHub\nsite `_.", + "description": "", "docs_url": null, "download_url": "https://github.com/ipython/ipython/downloads", "downloads": { @@ -74,13 +74,13 @@ { "comment_text": "", "digests": { - "md5": "512f0431c850c75a12baa9f8c4a9f12f", - "sha256": "4d0a08f3fd8837502bf33e9497a5ab28fe63e2fa4201765f378cb139c7a60d5f" + "md5": "ae0b233f09e1047a0240d30345b8ff91", + "sha256": "b593bcf0c53490f56809805a94b289403c8025859583a71f50c2305860ad187d" }, "downloads": -1, "filename": "ipython-4.1.0rc1-py2.py3-none-any.whl", "has_sig": false, - "md5_digest": "512f0431c850c75a12baa9f8c4a9f12f", + "md5_digest": "ae0b233f09e1047a0240d30345b8ff91", "packagetype": "bdist_wheel", "python_version": "py2.py3", "size": 736900, @@ -90,13 +90,13 @@ { "comment_text": "", "digests": { - "md5": "2aff56d8e78341f64663bcbc81366376", - "sha256": "6244a8e3293088ee31c1854abe1a1e7a409cf3ac2fb7579aa9616bdfadd3d4dc" + "md5": "1bdec8cbb110f7c7b991c8d45f626fd4", + "sha256": "d5203d06ac3225a746f856b592aeaffa3d1a7f1efa535263b06bdebc094d9701" }, "downloads": -1, "filename": "ipython-4.1.0rc1.tar.gz", "has_sig": false, - "md5_digest": "2aff56d8e78341f64663bcbc81366376", + "md5_digest": "1bdec8cbb110f7c7b991c8d45f626fd4", "packagetype": "sdist", "python_version": "source", "size": 4933377, @@ -106,13 +106,13 @@ { "comment_text": "", "digests": { - "md5": "a9ff233f176dd99b076b81dc8904ab7a", - "sha256": "efa3a5a676648cb18e2a2d3cd6353f3c83f0f704df8eb0eb6ae7d0dcbf187ea1" + "md5": "c641fd1d26083c589503ede5b9321f47", + "sha256": "83bf3b3b5d3b7afdfc885c5906a9e146dc840143e75ba62f241afb0e4c701a94" }, "downloads": -1, "filename": "ipython-4.1.0rc1.zip", "has_sig": false, - "md5_digest": "a9ff233f176dd99b076b81dc8904ab7a", + "md5_digest": "c641fd1d26083c589503ede5b9321f47", "packagetype": "sdist", "python_version": "source", "size": 5100723, diff --git a/tests/repositories/fixtures/pypi.org/json/ipython/5.7.0.json b/tests/repositories/fixtures/pypi.org/json/ipython/5.7.0.json new file mode 100644 index 00000000000..3d46159c746 --- /dev/null +++ b/tests/repositories/fixtures/pypi.org/json/ipython/5.7.0.json @@ -0,0 +1,154 @@ +{ + "info": { + "author": "The IPython Development Team", + "author_email": "ipython-dev@python.org", + "bugtrack_url": null, + "classifiers": [ + "Framework :: IPython", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Topic :: System :: Shells" + ], + "description": "", + "description_content_type": "", + "docs_url": null, + "download_url": "", + "downloads": { + "last_day": -1, + "last_month": -1, + "last_week": -1 + }, + "dynamic": null, + "home_page": "https://ipython.org", + "keywords": "Interactive,Interpreter,Shell,Embedding", + "license": "BSD", + "maintainer": "", + "maintainer_email": "", + "name": "ipython", + "package_url": "https://pypi.org/project/ipython/", + "platform": "Linux", + "project_url": "https://pypi.org/project/ipython/", + "project_urls": { + "Homepage": "https://ipython.org" + }, + "provides_extra": null, + "release_url": "https://pypi.org/project/ipython/5.7.0/", + "requires_dist": [ + "setuptools (>=18.5)", + "decorator", + "pickleshare", + "simplegeneric (>0.8)", + "traitlets (>=4.2)", + "prompt-toolkit (<2.0.0,>=1.0.4)", + "pygments", + "backports.shutil-get-terminal-size; python_version == \"2.7\"", + "pathlib2; python_version == \"2.7\" or python_version == \"3.3\"", + "pexpect; sys_platform != \"win32\"", + "appnope; sys_platform == \"darwin\"", + "colorama; sys_platform == \"win32\"", + "win-unicode-console (>=0.5); sys_platform == \"win32\" and python_version < \"3.6\"", + "nbformat; extra == 'all'", + "ipykernel; extra == 'all'", + "pygments; extra == 'all'", + "testpath; extra == 'all'", + "notebook; extra == 'all'", + "nbconvert; extra == 'all'", + "ipyparallel; extra == 'all'", + "qtconsole; extra == 'all'", + "Sphinx (>=1.3); extra == 'all'", + "requests; extra == 'all'", + "nose (>=0.10.1); extra == 'all'", + "ipywidgets; extra == 'all'", + "Sphinx (>=1.3); extra == 'doc'", + "ipykernel; extra == 'kernel'", + "nbconvert; extra == 'nbconvert'", + "nbformat; extra == 'nbformat'", + "notebook; extra == 'notebook'", + "ipywidgets; extra == 'notebook'", + "ipyparallel; extra == 'parallel'", + "qtconsole; extra == 'qtconsole'", + "nose (>=0.10.1); extra == 'test'", + "requests; extra == 'test'", + "testpath; extra == 'test'", + "pygments; extra == 'test'", + "nbformat; extra == 'test'", + "ipykernel; extra == 'test'", + "mock; python_version == \"2.7\" and extra == 'test'", + "numpy; python_version >= \"3.4\" and extra == 'test'" + ], + "requires_python": "", + "summary": "IPython: Productive Interactive Computing", + "version": "5.7.0", + "yanked": false, + "yanked_reason": null + }, + "last_serial": 22152965, + "urls": [ + { + "comment_text": "", + "digests": { + "md5": "cf35939995e0fd8c44fca7509308abde", + "sha256": "3d93d3995e2e52a98dc4f44361cd5bf68dbde62925d1f820b97d8f0e1d941f73" + }, + "downloads": -1, + "filename": "ipython-5.7.0-py2-none-any.whl", + "has_sig": false, + "md5_digest": "cf35939995e0fd8c44fca7509308abde", + "packagetype": "bdist_wheel", + "python_version": "py2", + "requires_python": null, + "size": 760413, + "upload_time": "2018-05-10T18:56:05", + "upload_time_iso_8601": "2018-05-10T18:56:05.083695Z", + "url": "https://files.pythonhosted.org/packages/52/19/aadde98d6bde1667d0bf431fb2d22451f880aaa373e0a241c7e7cb5815a0/ipython-5.7.0-py2-none-any.whl", + "yanked": false, + "yanked_reason": null + }, + { + "comment_text": "", + "digests": { + "md5": "8805d83c415de06f5eadd55aeb2fa738", + "sha256": "b94c7a3971290024ffaa916d51ee377ee85f8860a62b5f30c58f5376f0956a06" + }, + "downloads": -1, + "filename": "ipython-5.7.0-py3-none-any.whl", + "has_sig": false, + "md5_digest": "8805d83c415de06f5eadd55aeb2fa738", + "packagetype": "bdist_wheel", + "python_version": "py3", + "requires_python": null, + "size": 760415, + "upload_time": "2018-05-10T18:56:07", + "upload_time_iso_8601": "2018-05-10T18:56:07.665559Z", + "url": "https://files.pythonhosted.org/packages/c7/b6/03e0b5b0972e6161d16c4cec8d41a20372bd0634f8cb4cc0c984b8a91db6/ipython-5.7.0-py3-none-any.whl", + "yanked": false, + "yanked_reason": null + }, + { + "comment_text": "", + "digests": { + "md5": "01f2808ebe78ff2f28dc39be3aa635ca", + "sha256": "4e7fb265e0264498bd0d62c6261936a658bf3d38beb8a7b10cd2c6327c62ac2a" + }, + "downloads": -1, + "filename": "ipython-5.7.0.tar.gz", + "has_sig": false, + "md5_digest": "01f2808ebe78ff2f28dc39be3aa635ca", + "packagetype": "sdist", + "python_version": "source", + "requires_python": null, + "size": 4977745, + "upload_time": "2018-05-10T18:56:17", + "upload_time_iso_8601": "2018-05-10T18:56:17.132984Z", + "url": "https://files.pythonhosted.org/packages/3c/fd/559fead731a29eaa55cc235c8029807b2520976a937c30e9ee603f3bb566/ipython-5.7.0.tar.gz", + "yanked": false, + "yanked_reason": null + } + ], + "vulnerabilities": [] +} diff --git a/tests/repositories/fixtures/pypi.org/json/ipython/7.5.0.json b/tests/repositories/fixtures/pypi.org/json/ipython/7.5.0.json new file mode 100644 index 00000000000..59ec524e312 --- /dev/null +++ b/tests/repositories/fixtures/pypi.org/json/ipython/7.5.0.json @@ -0,0 +1,137 @@ +{ + "info": { + "author": "The IPython Development Team", + "author_email": "ipython-dev@python.org", + "bugtrack_url": null, + "classifiers": [ + "Framework :: IPython", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Topic :: System :: Shells" + ], + "description": "", + "description_content_type": "", + "docs_url": null, + "download_url": "", + "downloads": { + "last_day": -1, + "last_month": -1, + "last_week": -1 + }, + "dynamic": null, + "home_page": "https://ipython.org", + "keywords": "Interactive,Interpreter,Shell,Embedding", + "license": "BSD", + "maintainer": "", + "maintainer_email": "", + "name": "ipython", + "package_url": "https://pypi.org/project/ipython/", + "platform": "Linux", + "project_url": "https://pypi.org/project/ipython/", + "project_urls": { + "Documentation": "https://ipython.readthedocs.io/", + "Funding": "https://numfocus.org/", + "Homepage": "https://ipython.org", + "Source": "https://github.com/ipython/ipython", + "Tracker": "https://github.com/ipython/ipython/issues" + }, + "provides_extra": null, + "release_url": "https://pypi.org/project/ipython/7.5.0/", + "requires_dist": [ + "setuptools (>=18.5)", + "jedi (>=0.10)", + "decorator", + "pickleshare", + "traitlets (>=4.2)", + "prompt-toolkit (<2.1.0,>=2.0.0)", + "pygments", + "backcall", + "typing; python_version == \"3.4\"", + "pexpect; sys_platform != \"win32\"", + "appnope; sys_platform == \"darwin\"", + "colorama; sys_platform == \"win32\"", + "win-unicode-console (>=0.5); sys_platform == \"win32\" and python_version < \"3.6\"", + "nbconvert; extra == 'all'", + "ipywidgets; extra == 'all'", + "pygments; extra == 'all'", + "ipykernel; extra == 'all'", + "notebook; extra == 'all'", + "ipyparallel; extra == 'all'", + "requests; extra == 'all'", + "Sphinx (>=1.3); extra == 'all'", + "nbformat; extra == 'all'", + "nose (>=0.10.1); extra == 'all'", + "numpy; extra == 'all'", + "testpath; extra == 'all'", + "qtconsole; extra == 'all'", + "Sphinx (>=1.3); extra == 'doc'", + "ipykernel; extra == 'kernel'", + "nbconvert; extra == 'nbconvert'", + "nbformat; extra == 'nbformat'", + "notebook; extra == 'notebook'", + "ipywidgets; extra == 'notebook'", + "ipyparallel; extra == 'parallel'", + "qtconsole; extra == 'qtconsole'", + "nose (>=0.10.1); extra == 'test'", + "requests; extra == 'test'", + "testpath; extra == 'test'", + "pygments; extra == 'test'", + "nbformat; extra == 'test'", + "ipykernel; extra == 'test'", + "numpy; extra == 'test'" + ], + "requires_python": ">=3.5", + "summary": "IPython: Productive Interactive Computing", + "version": "7.5.0", + "yanked": false, + "yanked_reason": null + }, + "last_serial": 22152965, + "urls": [ + { + "comment_text": "", + "digests": { + "md5": "99a386eca39b536033c71aacf9f98e2b", + "sha256": "634f505893bbbdb79d1a04d89f4633d8cfc41115337847fbf9d5a23610fc3e3d" + }, + "downloads": -1, + "filename": "ipython-7.5.0-py3-none-any.whl", + "has_sig": false, + "md5_digest": "99a386eca39b536033c71aacf9f98e2b", + "packagetype": "bdist_wheel", + "python_version": "py3", + "requires_python": ">=3.5", + "size": 770001, + "upload_time": "2019-04-25T15:38:21", + "upload_time_iso_8601": "2019-04-25T15:38:21.726776Z", + "url": "https://files.pythonhosted.org/packages/a9/2e/41dce4ed129057e05a555a7f9629aa2d5f81fdcd4d16568bc24b75a1d2c9/ipython-7.5.0-py3-none-any.whl", + "yanked": false, + "yanked_reason": null + }, + { + "comment_text": "", + "digests": { + "md5": "0e8c1d7c14f309f6cd2dfd4e48e75cb1", + "sha256": "cd2a17ac273fea8bf8953118a2d83bad94f592f0db3e83fff9129a1842e36dbe" + }, + "downloads": -1, + "filename": "ipython-7.5.0.tar.gz", + "has_sig": false, + "md5_digest": "0e8c1d7c14f309f6cd2dfd4e48e75cb1", + "packagetype": "sdist", + "python_version": "source", + "requires_python": ">=3.5", + "size": 5118610, + "upload_time": "2019-04-25T15:38:33", + "upload_time_iso_8601": "2019-04-25T15:38:33.098872Z", + "url": "https://files.pythonhosted.org/packages/75/74/9b0ef91c8e356c907bb12297000951acb804583b54eeaddc342c5bad4d96/ipython-7.5.0.tar.gz", + "yanked": false, + "yanked_reason": null + } + ], + "vulnerabilities": [] +} diff --git a/tests/repositories/fixtures/pypi.org/json/isort.json b/tests/repositories/fixtures/pypi.org/json/isort.json index cef290e0f1c..49644c68803 100644 --- a/tests/repositories/fixtures/pypi.org/json/isort.json +++ b/tests/repositories/fixtures/pypi.org/json/isort.json @@ -5,24 +5,24 @@ "filename": "isort-4.3.4-py2-none-any.whl", "url": "https://files.pythonhosted.org/packages/41/d8/a945da414f2adc1d9e2f7d6e7445b27f2be42766879062a2e63616ad4199/isort-4.3.4-py2-none-any.whl", "hashes": { - "md5": "f0ad7704b6dc947073398ba290c3517f", - "sha256": "ec9ef8f4a9bc6f71eec99e1806bfa2de401650d996c59330782b89a5555c1497" + "md5": "e84fb6f2278ee4d0bd719a4d44863d9f", + "sha256": "3bbfc8f6119a46a48064487afb0b3ca9daa4b09fbfd94336a24c7616b71db2ca" } }, { "filename": "isort-4.3.4-py3-none-any.whl", "url": "https://files.pythonhosted.org/packages/1f/2c/22eee714d7199ae0464beda6ad5fedec8fee6a2f7ffd1e8f1840928fe318/isort-4.3.4-py3-none-any.whl", "hashes": { - "md5": "fbaac4cd669ac21ea9e21ab1ea3180db", - "sha256": "1153601da39a25b14ddc54955dbbacbb6b2d19135386699e2ad58517953b34af" + "md5": "baa2e5dc4e89511b6bc54e969d040a08", + "sha256": "e7aa083302c758b358e10a3a1c707adcc9f8ab57795e99246ac72eeffe7f2b20" } }, { "filename": "isort-4.3.4.tar.gz", "url": "https://files.pythonhosted.org/packages/b1/de/a628d16fdba0d38cafb3d7e34d4830f2c9cb3881384ce5c08c44762e1846/isort-4.3.4.tar.gz", "hashes": { - "md5": "fb554e9c8f9aa76e333a03d470a5cf52", - "sha256": "b9c40e9750f3d77e6e4d441d8b0266cf555e7cdabdcff33c4fd06366ca761ef8" + "md5": "9244631852cf8bd8559f7ab78bf4ec78", + "sha256": "234ad07e1e2780c27fa56364eefa734bee991b0d744337ef7e7ce3d5b1b59f39" } } ], diff --git a/tests/repositories/fixtures/pypi.org/json/isort/4.3.4.json b/tests/repositories/fixtures/pypi.org/json/isort/4.3.4.json index e08ac7272a5..d434a1b16e3 100644 --- a/tests/repositories/fixtures/pypi.org/json/isort/4.3.4.json +++ b/tests/repositories/fixtures/pypi.org/json/isort/4.3.4.json @@ -21,7 +21,7 @@ "Topic :: Software Development :: Libraries", "Topic :: Utilities" ], - "description": ".. image:: https://raw.github.com/timothycrosley/isort/master/logo.png\n :alt: isort\n\n########\n\n.. image:: https://badge.fury.io/py/isort.svg\n :target: https://badge.fury.io/py/isort\n :alt: PyPI version\n\n.. image:: https://travis-ci.org/timothycrosley/isort.svg?branch=master\n :target: https://travis-ci.org/timothycrosley/isort\n :alt: Build Status\n\n\n.. image:: https://coveralls.io/repos/timothycrosley/isort/badge.svg?branch=release%2F2.6.0&service=github\n :target: https://coveralls.io/github/timothycrosley/isort?branch=release%2F2.6.0\n :alt: Coverage\n\n.. image:: https://img.shields.io/github/license/mashape/apistatus.svg\n :target: https://pypi.python.org/pypi/hug/\n :alt: License\n\n.. image:: https://badges.gitter.im/Join%20Chat.svg\n :alt: Join the chat at https://gitter.im/timothycrosley/isort\n :target: https://gitter.im/timothycrosley/isort?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\n\n\nisort your python imports for you so you don't have to.\n\nisort is a Python utility / library to sort imports alphabetically, and automatically separated into sections.\nIt provides a command line utility, Python library and `plugins for various editors `_ to quickly sort all your imports.\nIt currently cleanly supports Python 2.7 - 3.6 without any dependencies.\n\n.. image:: https://raw.github.com/timothycrosley/isort/develop/example.gif\n :alt: Example Usage\n\nBefore isort:\n\n.. code-block:: python\n\n from my_lib import Object\n\n print(\"Hey\")\n\n import os\n\n from my_lib import Object3\n\n from my_lib import Object2\n\n import sys\n\n from third_party import lib15, lib1, lib2, lib3, lib4, lib5, lib6, lib7, lib8, lib9, lib10, lib11, lib12, lib13, lib14\n\n import sys\n\n from __future__ import absolute_import\n\n from third_party import lib3\n\n print(\"yo\")\n\nAfter isort:\n\n.. code-block:: python\n\n from __future__ import absolute_import\n\n import os\n import sys\n\n from third_party import (lib1, lib2, lib3, lib4, lib5, lib6, lib7, lib8,\n lib9, lib10, lib11, lib12, lib13, lib14, lib15)\n\n from my_lib import Object, Object2, Object3\n\n print(\"Hey\")\n print(\"yo\")\n\nInstalling isort\n================\n\nInstalling isort is as simple as:\n\n.. code-block:: bash\n\n pip install isort\n\nor if you prefer\n\n.. code-block:: bash\n\n easy_install isort\n\nUsing isort\n===========\n\n**From the command line**:\n\n.. code-block:: bash\n\n isort mypythonfile.py mypythonfile2.py\n\nor recursively:\n\n.. code-block:: bash\n\n isort -rc .\n\n*which is equivalent to:*\n\n.. code-block:: bash\n\n isort **/*.py\n\nor to see the proposed changes without applying them:\n\n.. code-block:: bash\n\n isort mypythonfile.py --diff\n\nFinally, to atomically run isort against a project, only applying changes if they don't introduce syntax errors do:\n\n.. code-block:: bash\n\n isort -rc --atomic .\n\n(Note: this is disabled by default as it keeps isort from being able to run against code written using a different version of Python)\n\n**From within Python**:\n\n.. code-block:: bash\n\n from isort import SortImports\n\n SortImports(\"pythonfile.py\")\n\nor:\n\n.. code-block:: bash\n\n from isort import SortImports\n\n new_contents = SortImports(file_contents=old_contents).output\n\n**From within Kate:**\n\n.. code-block:: bash\n\n ctrl+[\n\nor:\n\n.. code-block:: bash\n\n menu > Python > Sort Imports\n\nInstalling isort's Kate plugin\n==============================\n\nFor KDE 4.13+ / Pate 2.0+:\n\n.. code-block:: bash\n\n wget https://raw.github.com/timothycrosley/isort/master/kate_plugin/isort_plugin.py --output-document ~/.kde/share/apps/kate/pate/isort_plugin.py\n wget https://raw.github.com/timothycrosley/isort/master/kate_plugin/isort_plugin_ui.rc --output-document ~/.kde/share/apps/kate/pate/isort_plugin_ui.rc\n wget https://raw.github.com/timothycrosley/isort/master/kate_plugin/katepart_isort.desktop --output-document ~/.kde/share/kde4/services/katepart_isort.desktop\n\nFor all older versions:\n\n.. code-block:: bash\n\n wget https://raw.github.com/timothycrosley/isort/master/kate_plugin/isort_plugin_old.py --output-document ~/.kde/share/apps/kate/pate/isort_plugin.py\n\nYou will then need to restart kate and enable Python Plugins as well as the isort plugin itself.\n\nInstalling isort's for your preferred text editor\n=================================================\n\nSeveral plugins have been written that enable to use isort from within a variety of text-editors.\nYou can find a full list of them `on the isort wiki `_.\nAdditionally, I will enthusiastically accept pull requests that include plugins for other text editors\nand add documentation for them as I am notified.\n\nHow does isort work?\n====================\n\nisort parses specified files for global level import lines (imports outside of try / except blocks, functions, etc..)\nand puts them all at the top of the file grouped together by the type of import:\n\n- Future\n- Python Standard Library\n- Third Party\n- Current Python Project\n- Explicitly Local (. before import, as in: ``from . import x``)\n- Custom Separate Sections (Defined by forced_separate list in configuration file)\n- Custom Sections (Defined by sections list in configuration file)\n\nInside of each section the imports are sorted alphabetically. isort automatically removes duplicate python imports,\nand wraps long from imports to the specified line length (defaults to 80).\n\nWhen will isort not work?\n=========================\n\nIf you ever have the situation where you need to have a try / except block in the middle of top-level imports or if\nyour import order is directly linked to precedence.\n\nFor example: a common practice in Django settings files is importing * from various settings files to form\na new settings file. In this case if any of the imports change order you are changing the settings definition itself.\n\nHowever, you can configure isort to skip over just these files - or even to force certain imports to the top.\n\nConfiguring isort\n=================\n\nIf you find the default isort settings do not work well for your project, isort provides several ways to adjust\nthe behavior.\n\nTo configure isort for a single user create a ``~/.isort.cfg`` file:\n\n.. code-block:: ini\n\n [settings]\n line_length=120\n force_to_top=file1.py,file2.py\n skip=file3.py,file4.py\n known_future_library=future,pies\n known_standard_library=std,std2\n known_third_party=randomthirdparty\n known_first_party=mylib1,mylib2\n indent=' '\n multi_line_output=3\n length_sort=1\n forced_separate=django.contrib,django.utils\n default_section=FIRSTPARTY\n no_lines_before=LOCALFOLDER\n\nAdditionally, you can specify project level configuration simply by placing a ``.isort.cfg`` file at the root of your\nproject. isort will look up to 25 directories up, from the file it is ran against, to find a project specific configuration.\n\nOr, if you prefer, you can add an isort section to your project's ``setup.cfg`` or ``tox.ini`` file with any desired settings.\n\nYou can then override any of these settings by using command line arguments, or by passing in override values to the\nSortImports class.\n\nFinally, as of version 3.0 isort supports editorconfig files using the standard syntax defined here:\nhttp://editorconfig.org/\n\nMeaning you place any standard isort configuration parameters within a .editorconfig file under the ``*.py`` section\nand they will be honored.\n\nFor a full list of isort settings and their meanings `take a look at the isort wiki `_.\n\nMulti line output modes\n=======================\n\nYou will notice above the \"multi_line_output\" setting. This setting defines how from imports wrap when they extend\npast the line_length limit and has 6 possible settings:\n\n**0 - Grid**\n\n.. code-block:: python\n\n from third_party import (lib1, lib2, lib3,\n lib4, lib5, ...)\n\n**1 - Vertical**\n\n.. code-block:: python\n\n from third_party import (lib1,\n lib2,\n lib3\n lib4,\n lib5,\n ...)\n\n**2 - Hanging Indent**\n\n.. code-block:: python\n\n from third_party import \\\n lib1, lib2, lib3, \\\n lib4, lib5, lib6\n\n**3 - Vertical Hanging Indent**\n\n.. code-block:: python\n\n from third_party import (\n lib1,\n lib2,\n lib3,\n lib4,\n )\n\n**4 - Hanging Grid**\n\n.. code-block:: python\n\n from third_party import (\n lib1, lib2, lib3, lib4,\n lib5, ...)\n\n**5 - Hanging Grid Grouped**\n\n.. code-block:: python\n\n from third_party import (\n lib1, lib2, lib3, lib4,\n lib5, ...\n )\n\n**6 - NOQA**\n\n.. code-block:: python\n\n from third_party import lib1, lib2, lib3, ... # NOQA\n\nAlternatively, you can set ``force_single_line`` to ``True`` (``-sl`` on the command line) and every import will appear on its\nown line:\n\n.. code-block:: python\n\n from third_party import lib1\n from third_party import lib2\n from third_party import lib3\n ...\n\nNote: to change the how constant indents appear - simply change the indent property with the following accepted formats:\n* Number of spaces you would like. For example: 4 would cause standard 4 space indentation.\n* Tab\n* A verbatim string with quotes around it.\n\nFor example:\n\n.. code-block:: python\n\n \" \"\n\nis equivalent to 4.\n\nFor the import styles that use parentheses, you can control whether or not to\ninclude a trailing comma after the last import with the ``include_trailing_comma``\noption (defaults to ``False``).\n\nIntelligently Balanced Multi-line Imports\n=========================================\n\nAs of isort 3.1.0 support for balanced multi-line imports has been added.\nWith this enabled isort will dynamically change the import length to the one that produces the most balanced grid,\nwhile staying below the maximum import length defined.\n\nExample:\n\n.. code-block:: python\n\n from __future__ import (absolute_import, division,\n print_function, unicode_literals)\n\nWill be produced instead of:\n\n.. code-block:: python\n\n from __future__ import (absolute_import, division, print_function,\n unicode_literals)\n\nTo enable this set ``balanced_wrapping`` to ``True`` in your config or pass the ``-e`` option into the command line utility.\n\nCustom Sections and Ordering\n============================\n\nYou can change the section order with ``sections`` option from the default of:\n\n.. code-block:: ini\n\n FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER\n\nto your preference:\n\n.. code-block:: ini\n\n sections=FUTURE,STDLIB,FIRSTPARTY,THIRDPARTY,LOCALFOLDER\n\nYou also can define your own sections and their order.\n\nExample:\n\n.. code-block:: ini\n\n known_django=django\n known_pandas=pandas,numpy\n sections=FUTURE,STDLIB,DJANGO,THIRDPARTY,PANDAS,FIRSTPARTY,LOCALFOLDER\n\nwould create two new sections with the specified known modules.\n\nThe ``no_lines_before`` option will prevent the listed sections from being split from the previous section by an empty line.\n\nExample:\n\n.. code-block:: ini\n\n sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER\n no_lines_before=LOCALFOLDER\n\nwould produce a section with both FIRSTPARTY and LOCALFOLDER modules combined.\n\nAuto-comment import sections\n============================\n\nSome projects prefer to have import sections uniquely titled to aid in identifying the sections quickly\nwhen visually scanning. isort can automate this as well. To do this simply set the ``import_heading_{section_name}``\nsetting for each section you wish to have auto commented - to the desired comment.\n\nFor Example:\n\n.. code-block:: ini\n\n import_heading_stdlib=Standard Library\n import_heading_firstparty=My Stuff\n\nWould lead to output looking like the following:\n\n.. code-block:: python\n\n # Standard Library\n import os\n import sys\n\n import django.settings\n\n # My Stuff\n import myproject.test\n\nOrdering by import length\n=========================\n\nisort also makes it easy to sort your imports by length, simply by setting the ``length_sort`` option to ``True``.\nThis will result in the following output style:\n\n.. code-block:: python\n\n from evn.util import (\n Pool,\n Dict,\n Options,\n Constant,\n DecayDict,\n UnexpectedCodePath,\n )\n\nSkip processing of imports (outside of configuration)\n=====================================================\n\nTo make isort ignore a single import simply add a comment at the end of the import line containing the text ``isort:skip``:\n\n.. code-block:: python\n\n import module # isort:skip\n\nor:\n\n.. code-block:: python\n\n from xyz import (abc, # isort:skip\n yo,\n hey)\n\nTo make isort skip an entire file simply add ``isort:skip_file`` to the module's doc string:\n\n.. code-block:: python\n\n \"\"\" my_module.py\n Best module ever\n\n isort:skip_file\n \"\"\"\n\n import b\n import a\n\nAdding an import to multiple files\n==================================\n\nisort makes it easy to add an import statement across multiple files, while being assured it's correctly placed.\n\nFrom the command line:\n\n.. code-block:: bash\n\n isort -a \"from __future__ import print_function\" *.py\n\nfrom within Kate:\n\n.. code-block::\n\n ctrl+]\n\nor:\n\n.. code-block::\n\n menu > Python > Add Import\n\nRemoving an import from multiple files\n======================================\n\nisort also makes it easy to remove an import from multiple files, without having to be concerned with how it was originally\nformatted.\n\nFrom the command line:\n\n.. code-block:: bash\n\n isort -r \"os.system\" *.py\n\nfrom within Kate:\n\n.. code-block::\n\n ctrl+shift+]\n\nor:\n\n.. code-block::\n\n menu > Python > Remove Import\n\nUsing isort to verify code\n==========================\n\nThe ``--check-only`` option\n---------------------------\n\nisort can also be used to used to verify that code is correctly formatted by running it with ``-c``.\nAny files that contain incorrectly sorted and/or formatted imports will be outputted to ``stderr``.\n\n.. code-block:: bash\n\n isort **/*.py -c -vb\n\n SUCCESS: /home/timothy/Projects/Open_Source/isort/isort_kate_plugin.py Everything Looks Good!\n ERROR: /home/timothy/Projects/Open_Source/isort/isort/isort.py Imports are incorrectly sorted.\n\nOne great place this can be used is with a pre-commit git hook, such as this one by @acdha:\n\nhttps://gist.github.com/acdha/8717683\n\nThis can help to ensure a certain level of code quality throughout a project.\n\n\nGit hook\n--------\n\nisort provides a hook function that can be integrated into your Git pre-commit script to check\nPython code before committing.\n\nTo cause the commit to fail if there are isort errors (strict mode), include the following in\n``.git/hooks/pre-commit``:\n\n.. code-block:: python\n\n #!/usr/bin/env python\n import sys\n from isort.hooks import git_hook\n\n sys.exit(git_hook(strict=True))\n\nIf you just want to display warnings, but allow the commit to happen anyway, call ``git_hook`` without\nthe `strict` parameter.\n\nSetuptools integration\n----------------------\n\nUpon installation, isort enables a ``setuptools`` command that checks Python files\ndeclared by your project.\n\nRunning ``python setup.py isort`` on the command line will check the files\nlisted in your ``py_modules`` and ``packages``. If any warning is found,\nthe command will exit with an error code:\n\n.. code-block:: bash\n\n $ python setup.py isort\n\nAlso, to allow users to be able to use the command without having to install\nisort themselves, add isort to the setup_requires of your ``setup()`` like so:\n\n.. code-block:: python\n\n setup(\n name=\"project\",\n packages=[\"project\"],\n\n setup_requires=[\n \"isort\"\n ]\n )\n\n\nWhy isort?\n==========\n\nisort simply stands for import sort. It was originally called \"sortImports\" however I got tired of typing the extra\ncharacters and came to the realization camelCase is not pythonic.\n\nI wrote isort because in an organization I used to work in the manager came in one day and decided all code must\nhave alphabetically sorted imports. The code base was huge - and he meant for us to do it by hand. However, being a\nprogrammer - I'm too lazy to spend 8 hours mindlessly performing a function, but not too lazy to spend 16\nhours automating it. I was given permission to open source sortImports and here we are :)\n\n--------------------------------------------\n\nThanks and I hope you find isort useful!\n\n~Timothy Crosley\n", + "description": "", "description_content_type": null, "docs_url": null, "download_url": "", @@ -55,13 +55,13 @@ { "comment_text": "", "digests": { - "md5": "f0ad7704b6dc947073398ba290c3517f", - "sha256": "ec9ef8f4a9bc6f71eec99e1806bfa2de401650d996c59330782b89a5555c1497" + "md5": "e84fb6f2278ee4d0bd719a4d44863d9f", + "sha256": "3bbfc8f6119a46a48064487afb0b3ca9daa4b09fbfd94336a24c7616b71db2ca" }, "downloads": -1, "filename": "isort-4.3.4-py2-none-any.whl", "has_sig": false, - "md5_digest": "f0ad7704b6dc947073398ba290c3517f", + "md5_digest": "e84fb6f2278ee4d0bd719a4d44863d9f", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, @@ -75,13 +75,13 @@ { "comment_text": "", "digests": { - "md5": "fbaac4cd669ac21ea9e21ab1ea3180db", - "sha256": "1153601da39a25b14ddc54955dbbacbb6b2d19135386699e2ad58517953b34af" + "md5": "baa2e5dc4e89511b6bc54e969d040a08", + "sha256": "e7aa083302c758b358e10a3a1c707adcc9f8ab57795e99246ac72eeffe7f2b20" }, "downloads": -1, "filename": "isort-4.3.4-py3-none-any.whl", "has_sig": false, - "md5_digest": "fbaac4cd669ac21ea9e21ab1ea3180db", + "md5_digest": "baa2e5dc4e89511b6bc54e969d040a08", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, @@ -95,13 +95,13 @@ { "comment_text": "", "digests": { - "md5": "fb554e9c8f9aa76e333a03d470a5cf52", - "sha256": "b9c40e9750f3d77e6e4d441d8b0266cf555e7cdabdcff33c4fd06366ca761ef8" + "md5": "9244631852cf8bd8559f7ab78bf4ec78", + "sha256": "234ad07e1e2780c27fa56364eefa734bee991b0d744337ef7e7ce3d5b1b59f39" }, "downloads": -1, "filename": "isort-4.3.4.tar.gz", "has_sig": false, - "md5_digest": "fb554e9c8f9aa76e333a03d470a5cf52", + "md5_digest": "9244631852cf8bd8559f7ab78bf4ec78", "packagetype": "sdist", "python_version": "source", "requires_python": null, diff --git a/tests/repositories/fixtures/pypi.org/json/jupyter.json b/tests/repositories/fixtures/pypi.org/json/jupyter.json index aa7043c6016..e15282129c1 100644 --- a/tests/repositories/fixtures/pypi.org/json/jupyter.json +++ b/tests/repositories/fixtures/pypi.org/json/jupyter.json @@ -5,24 +5,24 @@ "filename": "jupyter-1.0.0-py2.py3-none-any.whl", "url": "https://files.pythonhosted.org/packages/83/df/0f5dd132200728a86190397e1ea87cd76244e42d39ec5e88efd25b2abd7e/jupyter-1.0.0-py2.py3-none-any.whl", "hashes": { - "md5": "f81d039e084c2c0c4da9e4a86446b863", - "sha256": "5b290f93b98ffbc21c0c7e749f054b3267782166d72fa5e3ed1ed4eaf34a2b78" + "md5": "b2f5e2daab779c7bda0be38925ab1b92", + "sha256": "83c4591b9c7392ea5f91e0d9f8e98d894f76e8e669260788f0fcb281ec0b3b1f" } }, { "filename": "jupyter-1.0.0.tar.gz", "url": "https://files.pythonhosted.org/packages/c9/a9/371d0b8fe37dd231cf4b2cff0a9f0f25e98f3a73c3771742444be27f2944/jupyter-1.0.0.tar.gz", "hashes": { - "md5": "c6030444c7eb6c05a4d7b1768c72aed7", - "sha256": "d9dc4b3318f310e34c82951ea5d6683f67bed7def4b259fafbfe4f1beb1d8e5f" + "md5": "78acaec88533ea6b6e761e7d086a1d04", + "sha256": "3ef1e86ba0556ea5922b846416a41acfd2625830d996c7d06d80c90bed1dc193" } }, { "filename": "jupyter-1.0.0.zip", "url": "https://files.pythonhosted.org/packages/fc/21/a372b73e3a498b41b92ed915ada7de2ad5e16631546329c03e484c3bf4e9/jupyter-1.0.0.zip", "hashes": { - "md5": "25142b08e2ad7142b6f920bc8cc8dfeb", - "sha256": "3e1f86076bbb7c8c207829390305a2b1fe836d471ed54be66a3b8c41e7f46cc7" + "md5": "7b7a957694a73ac0c19fe46c216c0ea0", + "sha256": "4a855b9717c3ea24fd8ca4fd91ab5995894aecc4d20e7f39c28786a2c1869fae" } } ], diff --git a/tests/repositories/fixtures/pypi.org/json/jupyter/1.0.0.json b/tests/repositories/fixtures/pypi.org/json/jupyter/1.0.0.json index 3f305d40af1..644b4618729 100644 --- a/tests/repositories/fixtures/pypi.org/json/jupyter/1.0.0.json +++ b/tests/repositories/fixtures/pypi.org/json/jupyter/1.0.0.json @@ -15,7 +15,7 @@ "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4" ], - "description": "Install the Jupyter system, including the notebook, qtconsole, and the IPython kernel.", + "description": "", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", @@ -50,13 +50,13 @@ { "comment_text": "", "digests": { - "md5": "f81d039e084c2c0c4da9e4a86446b863", - "sha256": "5b290f93b98ffbc21c0c7e749f054b3267782166d72fa5e3ed1ed4eaf34a2b78" + "md5": "b2f5e2daab779c7bda0be38925ab1b92", + "sha256": "83c4591b9c7392ea5f91e0d9f8e98d894f76e8e669260788f0fcb281ec0b3b1f" }, "downloads": -1, "filename": "jupyter-1.0.0-py2.py3-none-any.whl", "has_sig": false, - "md5_digest": "f81d039e084c2c0c4da9e4a86446b863", + "md5_digest": "b2f5e2daab779c7bda0be38925ab1b92", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, @@ -70,13 +70,13 @@ { "comment_text": "", "digests": { - "md5": "c6030444c7eb6c05a4d7b1768c72aed7", - "sha256": "d9dc4b3318f310e34c82951ea5d6683f67bed7def4b259fafbfe4f1beb1d8e5f" + "md5": "78acaec88533ea6b6e761e7d086a1d04", + "sha256": "3ef1e86ba0556ea5922b846416a41acfd2625830d996c7d06d80c90bed1dc193" }, "downloads": -1, "filename": "jupyter-1.0.0.tar.gz", "has_sig": false, - "md5_digest": "c6030444c7eb6c05a4d7b1768c72aed7", + "md5_digest": "78acaec88533ea6b6e761e7d086a1d04", "packagetype": "sdist", "python_version": "source", "requires_python": null, @@ -90,13 +90,13 @@ { "comment_text": "", "digests": { - "md5": "25142b08e2ad7142b6f920bc8cc8dfeb", - "sha256": "3e1f86076bbb7c8c207829390305a2b1fe836d471ed54be66a3b8c41e7f46cc7" + "md5": "7b7a957694a73ac0c19fe46c216c0ea0", + "sha256": "4a855b9717c3ea24fd8ca4fd91ab5995894aecc4d20e7f39c28786a2c1869fae" }, "downloads": -1, "filename": "jupyter-1.0.0.zip", "has_sig": false, - "md5_digest": "25142b08e2ad7142b6f920bc8cc8dfeb", + "md5_digest": "7b7a957694a73ac0c19fe46c216c0ea0", "packagetype": "sdist", "python_version": "source", "requires_python": null, diff --git a/tests/repositories/fixtures/pypi.org/json/lockfile.json b/tests/repositories/fixtures/pypi.org/json/lockfile.json index d5bfefe15b0..e5b45c870d2 100644 --- a/tests/repositories/fixtures/pypi.org/json/lockfile.json +++ b/tests/repositories/fixtures/pypi.org/json/lockfile.json @@ -5,16 +5,16 @@ "filename": "lockfile-0.12.2-py2.py3-none-any.whl", "url": "https://files.pythonhosted.org/packages/c8/22/9460e311f340cb62d26a38c419b1381b8593b0bb6b5d1f056938b086d362/lockfile-0.12.2-py2.py3-none-any.whl", "hashes": { - "md5": "07b04864472c90cdf4452cf250687334", - "sha256": "6c3cb24f344923d30b2785d5ad75182c8ea7ac1b6171b08657258ec7429d50fa" + "md5": "71d44ac2adeca84c00c0291e1635382a", + "sha256": "62e668c1cb0ef8eeb837d21c2f5a5748ea6eed3d079669df290fda8172825f90" } }, { "filename": "lockfile-0.12.2.tar.gz", "url": "https://files.pythonhosted.org/packages/17/47/72cb04a58a35ec495f96984dddb48232b551aafb95bde614605b754fe6f7/lockfile-0.12.2.tar.gz", "hashes": { - "md5": "a6a1a82957a23afdf44cfdd039b65ff9", - "sha256": "6aed02de03cba24efabcd600b30540140634fc06cfa603822d508d5361e9f799" + "md5": "303430a1d9089ff9326cecbe57e35a32", + "sha256": "58c5fd9fc313dc5bf5702eeab043cde1bed7149b09bec681a82064226a331a37" } } ], diff --git a/tests/repositories/fixtures/pypi.org/json/lockfile/0.12.2.json b/tests/repositories/fixtures/pypi.org/json/lockfile/0.12.2.json index b44e77b1a57..36ffa5d3fbc 100644 --- a/tests/repositories/fixtures/pypi.org/json/lockfile/0.12.2.json +++ b/tests/repositories/fixtures/pypi.org/json/lockfile/0.12.2.json @@ -49,13 +49,13 @@ { "comment_text": "", "digests": { - "md5": "07b04864472c90cdf4452cf250687334", - "sha256": "6c3cb24f344923d30b2785d5ad75182c8ea7ac1b6171b08657258ec7429d50fa" + "md5": "71d44ac2adeca84c00c0291e1635382a", + "sha256": "62e668c1cb0ef8eeb837d21c2f5a5748ea6eed3d079669df290fda8172825f90" }, "downloads": -1, "filename": "lockfile-0.12.2-py2.py3-none-any.whl", "has_sig": false, - "md5_digest": "07b04864472c90cdf4452cf250687334", + "md5_digest": "71d44ac2adeca84c00c0291e1635382a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, @@ -66,13 +66,13 @@ { "comment_text": "", "digests": { - "md5": "a6a1a82957a23afdf44cfdd039b65ff9", - "sha256": "6aed02de03cba24efabcd600b30540140634fc06cfa603822d508d5361e9f799" + "md5": "303430a1d9089ff9326cecbe57e35a32", + "sha256": "58c5fd9fc313dc5bf5702eeab043cde1bed7149b09bec681a82064226a331a37" }, "downloads": -1, "filename": "lockfile-0.12.2.tar.gz", "has_sig": false, - "md5_digest": "a6a1a82957a23afdf44cfdd039b65ff9", + "md5_digest": "303430a1d9089ff9326cecbe57e35a32", "packagetype": "sdist", "python_version": "source", "requires_python": null, diff --git a/tests/repositories/fixtures/pypi.org/json/more-itertools.json b/tests/repositories/fixtures/pypi.org/json/more-itertools.json index 1ef39b1373e..22bdf37b2e8 100644 --- a/tests/repositories/fixtures/pypi.org/json/more-itertools.json +++ b/tests/repositories/fixtures/pypi.org/json/more-itertools.json @@ -5,24 +5,24 @@ "filename": "more_itertools-4.1.0-py2-none-any.whl", "url": "https://files.pythonhosted.org/packages/4a/88/c28e2a2da8f3dc3a391d9c97ad949f2ea0c05198222e7e6af176e5bf9b26/more_itertools-4.1.0-py2-none-any.whl", "hashes": { - "md5": "2a6a4b9abf941edf6d190fc995c0c935", - "sha256": "11a625025954c20145b37ff6309cd54e39ca94f72f6bb9576d1195db6fa2442e" + "md5": "c70269eabc5fae5e0d93c2eca638720e", + "sha256": "5dd7dfd88d2fdaea446da478ffef8d7151fdf26ee92ac7ed7b14e8d71efe4b62" } }, { "filename": "more_itertools-4.1.0-py3-none-any.whl", "url": "https://files.pythonhosted.org/packages/7a/46/886917c6a4ce49dd3fff250c01c5abac5390d57992751384fe61befc4877/more_itertools-4.1.0-py3-none-any.whl", "hashes": { - "md5": "3229d872f8d193e36119ec76e1b0c097", - "sha256": "0dd8f72eeab0d2c3bd489025bb2f6a1b8342f9b198f6fc37b52d15cfa4531fea" + "md5": "26d7c309ef806b4e563d2a7e4ceafb14", + "sha256": "29b1e1661aaa56875ce090fa219fa84dfc13daecb52cd4fae321f6f57b419ec4" } }, { "filename": "more-itertools-4.1.0.tar.gz", "url": "https://files.pythonhosted.org/packages/db/0b/f5660bf6299ec5b9f17bd36096fa8148a1c843fa77ddfddf9bebac9301f7/more-itertools-4.1.0.tar.gz", "hashes": { - "md5": "246f46686d95879fbad37855c115dc52", - "sha256": "c9ce7eccdcb901a2c75d326ea134e0886abfbea5f93e91cc95de9507c0816c44" + "md5": "bf351a1050242ce3af7e475a4da1a26b", + "sha256": "bab2dc6f4be8f9a4a72177842c5283e2dff57c167439a03e3d8d901e854f0f2e" } } ], diff --git a/tests/repositories/fixtures/pypi.org/json/more-itertools/4.1.0.json b/tests/repositories/fixtures/pypi.org/json/more-itertools/4.1.0.json index 7f86866b37f..9157397727b 100644 --- a/tests/repositories/fixtures/pypi.org/json/more-itertools/4.1.0.json +++ b/tests/repositories/fixtures/pypi.org/json/more-itertools/4.1.0.json @@ -47,13 +47,13 @@ { "comment_text": "", "digests": { - "md5": "2a6a4b9abf941edf6d190fc995c0c935", - "sha256": "11a625025954c20145b37ff6309cd54e39ca94f72f6bb9576d1195db6fa2442e" + "md5": "c70269eabc5fae5e0d93c2eca638720e", + "sha256": "5dd7dfd88d2fdaea446da478ffef8d7151fdf26ee92ac7ed7b14e8d71efe4b62" }, "downloads": -1, "filename": "more_itertools-4.1.0-py2-none-any.whl", "has_sig": false, - "md5_digest": "2a6a4b9abf941edf6d190fc995c0c935", + "md5_digest": "c70269eabc5fae5e0d93c2eca638720e", "packagetype": "bdist_wheel", "python_version": "py2", "size": 47987, @@ -63,13 +63,13 @@ { "comment_text": "", "digests": { - "md5": "3229d872f8d193e36119ec76e1b0c097", - "sha256": "0dd8f72eeab0d2c3bd489025bb2f6a1b8342f9b198f6fc37b52d15cfa4531fea" + "md5": "26d7c309ef806b4e563d2a7e4ceafb14", + "sha256": "29b1e1661aaa56875ce090fa219fa84dfc13daecb52cd4fae321f6f57b419ec4" }, "downloads": -1, "filename": "more_itertools-4.1.0-py3-none-any.whl", "has_sig": false, - "md5_digest": "3229d872f8d193e36119ec76e1b0c097", + "md5_digest": "26d7c309ef806b4e563d2a7e4ceafb14", "packagetype": "bdist_wheel", "python_version": "py3", "size": 47988, @@ -79,13 +79,13 @@ { "comment_text": "", "digests": { - "md5": "246f46686d95879fbad37855c115dc52", - "sha256": "c9ce7eccdcb901a2c75d326ea134e0886abfbea5f93e91cc95de9507c0816c44" + "md5": "bf351a1050242ce3af7e475a4da1a26b", + "sha256": "bab2dc6f4be8f9a4a72177842c5283e2dff57c167439a03e3d8d901e854f0f2e" }, "downloads": -1, "filename": "more-itertools-4.1.0.tar.gz", "has_sig": false, - "md5_digest": "246f46686d95879fbad37855c115dc52", + "md5_digest": "bf351a1050242ce3af7e475a4da1a26b", "packagetype": "sdist", "python_version": "source", "size": 51310, diff --git a/tests/repositories/fixtures/pypi.org/json/pastel.json b/tests/repositories/fixtures/pypi.org/json/pastel.json new file mode 100644 index 00000000000..1aee564768a --- /dev/null +++ b/tests/repositories/fixtures/pypi.org/json/pastel.json @@ -0,0 +1,44 @@ +{ + "files": [ + { + "core-metadata": { + "sha256": "cf50590355f03d1956c461705e74e4cf1f34730179656436d3c2a8dede08c4f7" + }, + "data-dist-info-metadata": { + "sha256": "cf50590355f03d1956c461705e74e4cf1f34730179656436d3c2a8dede08c4f7" + }, + "filename": "pastel-0.1.0-py3-none-any.whl", + "hashes": { + "md5": "632fcf45cc28aed4a4dce1324d1bd1d1", + "sha256": "d88b34efa115392ee42c55d6f82cdf5e5e08221ef2e18a16ae696a80008c3499" + }, + "requires-python": null, + "size": 6718, + "upload-time": "2017-02-01T23:26:20.148511Z", + "url": "https://files.pythonhosted.org/packages/9b/7e/7d701686013c0d7dae62e0977467232a6adc2e562c23878eb3cd4f97d02e/pastel-0.1.0-py3-none-any.whl", + "yanked": false + }, + { + "core-metadata": false, + "data-dist-info-metadata": false, + "filename": "pastel-0.1.0.tar.gz", + "hashes": { + "md5": "43ea5f07660f630da18ae1827f5b4333", + "sha256": "22f14474c4120b37c54ac2173b49b0ac1de9283ca714be6eb3ea8b39296285a9" + }, + "requires-python": null, + "size": 4490, + "upload-time": "2017-02-01T23:26:21.720111Z", + "url": "https://files.pythonhosted.org/packages/bd/13/a68f2e448b471e8c49e9b596d569ae167a5135ac672b1dc5f24f62f9c15f/pastel-0.1.0.tar.gz", + "yanked": false + } + ], + "meta": { + "_last-serial": 8202286, + "api-version": "1.1" + }, + "name": "pastel", + "versions": [ + "0.1.0" + ] +} diff --git a/tests/repositories/fixtures/pypi.org/json/pastel/0.1.0.json b/tests/repositories/fixtures/pypi.org/json/pastel/0.1.0.json new file mode 100644 index 00000000000..103dafbb4e8 --- /dev/null +++ b/tests/repositories/fixtures/pypi.org/json/pastel/0.1.0.json @@ -0,0 +1,93 @@ +{ + "info": { + "author": "Sébastien Eustace", + "author_email": "sebastien@eustace.io", + "bugtrack_url": null, + "classifiers": [ + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy" + ], + "description": "", + "description_content_type": null, + "docs_url": null, + "download_url": "https://github.com/sdispater/pastel/archive/0.1.0.tar.gz", + "downloads": { + "last_day": -1, + "last_month": -1, + "last_week": -1 + }, + "dynamic": null, + "home_page": "https://github.com/sdispater/pastel", + "keywords": "", + "license": "MIT", + "maintainer": "", + "maintainer_email": "", + "name": "pastel", + "package_url": "https://pypi.org/project/pastel/", + "platform": "UNKNOWN", + "project_url": "https://pypi.org/project/pastel/", + "project_urls": { + "Download": "https://github.com/sdispater/pastel/archive/0.1.0.tar.gz", + "Homepage": "https://github.com/sdispater/pastel" + }, + "provides_extra": null, + "release_url": "https://pypi.org/project/pastel/0.1.0/", + "requires_dist": null, + "requires_python": "", + "summary": "Bring colors to your terminal.", + "version": "0.1.0", + "yanked": false, + "yanked_reason": null + }, + "last_serial": 8202286, + "urls": [ + { + "comment_text": "", + "digests": { + "md5": "632fcf45cc28aed4a4dce1324d1bd1d1", + "sha256": "d88b34efa115392ee42c55d6f82cdf5e5e08221ef2e18a16ae696a80008c3499" + }, + "downloads": -1, + "filename": "pastel-0.1.0-py3-none-any.whl", + "has_sig": false, + "md5_digest": "632fcf45cc28aed4a4dce1324d1bd1d1", + "packagetype": "bdist_wheel", + "python_version": "py3", + "requires_python": null, + "size": 6718, + "upload_time": "2017-02-01T23:26:20", + "upload_time_iso_8601": "2017-02-01T23:26:20.148511Z", + "url": "https://files.pythonhosted.org/packages/9b/7e/7d701686013c0d7dae62e0977467232a6adc2e562c23878eb3cd4f97d02e/pastel-0.1.0-py3-none-any.whl", + "yanked": false, + "yanked_reason": null + }, + { + "comment_text": "", + "digests": { + "md5": "43ea5f07660f630da18ae1827f5b4333", + "sha256": "22f14474c4120b37c54ac2173b49b0ac1de9283ca714be6eb3ea8b39296285a9" + }, + "downloads": -1, + "filename": "pastel-0.1.0.tar.gz", + "has_sig": false, + "md5_digest": "43ea5f07660f630da18ae1827f5b4333", + "packagetype": "sdist", + "python_version": "source", + "requires_python": null, + "size": 4490, + "upload_time": "2017-02-01T23:26:21", + "upload_time_iso_8601": "2017-02-01T23:26:21.720111Z", + "url": "https://files.pythonhosted.org/packages/bd/13/a68f2e448b471e8c49e9b596d569ae167a5135ac672b1dc5f24f62f9c15f/pastel-0.1.0.tar.gz", + "yanked": false, + "yanked_reason": null + } + ], + "vulnerabilities": [] +} diff --git a/tests/repositories/fixtures/pypi.org/json/pluggy.json b/tests/repositories/fixtures/pypi.org/json/pluggy.json index 9a09d0fc128..204851f5e62 100644 --- a/tests/repositories/fixtures/pypi.org/json/pluggy.json +++ b/tests/repositories/fixtures/pypi.org/json/pluggy.json @@ -5,8 +5,8 @@ "filename": "pluggy-0.6.0.tar.gz", "url": "https://files.pythonhosted.org/packages/11/bf/cbeb8cdfaffa9f2ea154a30ae31a9d04a1209312e2919138b4171a1f8199/pluggy-0.6.0.tar.gz", "hashes": { - "md5": "ffdde7c3a5ba9a440404570366ffb6d5", - "sha256": "7f8ae7f5bdf75671a718d2daf0a64b7885f74510bcd98b1a0bb420eb9a9d0cff" + "md5": "ef8a88abcd501afd47cb22245fe4315a", + "sha256": "a982e208d054867661d27c6d2a86b17ba05fbb6b1bdc01f42660732dd107f865" } } ], diff --git a/tests/repositories/fixtures/pypi.org/json/pluggy/0.6.0.json b/tests/repositories/fixtures/pypi.org/json/pluggy/0.6.0.json index 1ce124ceb65..d551cd42025 100644 --- a/tests/repositories/fixtures/pypi.org/json/pluggy/0.6.0.json +++ b/tests/repositories/fixtures/pypi.org/json/pluggy/0.6.0.json @@ -50,13 +50,13 @@ { "comment_text": "", "digests": { - "md5": "ffdde7c3a5ba9a440404570366ffb6d5", - "sha256": "7f8ae7f5bdf75671a718d2daf0a64b7885f74510bcd98b1a0bb420eb9a9d0cff" + "md5": "ef8a88abcd501afd47cb22245fe4315a", + "sha256": "a982e208d054867661d27c6d2a86b17ba05fbb6b1bdc01f42660732dd107f865" }, "downloads": -1, "filename": "pluggy-0.6.0.tar.gz", "has_sig": false, - "md5_digest": "ffdde7c3a5ba9a440404570366ffb6d5", + "md5_digest": "ef8a88abcd501afd47cb22245fe4315a", "packagetype": "sdist", "python_version": "source", "size": 19678, diff --git a/tests/repositories/fixtures/pypi.org/json/poetry-core.json b/tests/repositories/fixtures/pypi.org/json/poetry-core.json index 38b248a3c1d..5809479e33f 100644 --- a/tests/repositories/fixtures/pypi.org/json/poetry-core.json +++ b/tests/repositories/fixtures/pypi.org/json/poetry-core.json @@ -1,18 +1,10 @@ { "files": [ - { - "filename": "poetry_core-1.5.0-py3-none-any.whl", - "hashes": { - "sha256": "e216b70f013c47b82a72540d34347632c5bfe59fd54f5fe5d51f6a68b19aaf84" - }, - "requires-python": ">=3.7,<4.0", - "url": "https://files.pythonhosted.org/packages/2d/99/6b0c5fe90e247b2b7b96a27cdf39ee59a02aab3c01d7243fc0c63cd7fb73/poetry_core-1.5.0-py3-none-any.whl", - "yanked": false - }, { "filename": "poetry_core-1.5.0.tar.gz", "hashes": { - "sha256": "253521bb7104e1df81f64d7b49ea1825057c91fa156d7d0bd752fefdad6f8c7a" + "md5": "3f9b36a7a94cd235bfd5f05794828445", + "sha256": "0ae8d28caf5c12ec1714b16d2e7157ddd52397ea6bfdeba5a9432e449a0184da" }, "requires-python": ">=3.7,<4.0", "url": "https://files.pythonhosted.org/packages/57/bb/2435fef60bb01f6c0891d9482c7053b50e90639f0f74d7658e99bdd4da69/poetry_core-1.5.0.tar.gz", diff --git a/tests/repositories/fixtures/pypi.org/json/poetry-core/1.5.0.json b/tests/repositories/fixtures/pypi.org/json/poetry-core/1.5.0.json index 9cfc450c625..0eace86e46e 100644 --- a/tests/repositories/fixtures/pypi.org/json/poetry-core/1.5.0.json +++ b/tests/repositories/fixtures/pypi.org/json/poetry-core/1.5.0.json @@ -52,7 +52,6 @@ { "comment_text": "", "digests": { - "blake2b_256": "2d996b0c5fe90e247b2b7b96a27cdf39ee59a02aab3c01d7243fc0c63cd7fb73", "md5": "be7589b4902793e66d7d979bd8581591", "sha256": "e216b70f013c47b82a72540d34347632c5bfe59fd54f5fe5d51f6a68b19aaf84" }, @@ -73,14 +72,13 @@ { "comment_text": "", "digests": { - "blake2b_256": "57bb2435fef60bb01f6c0891d9482c7053b50e90639f0f74d7658e99bdd4da69", - "md5": "481671a4895af7cdda4944eab67f3843", - "sha256": "253521bb7104e1df81f64d7b49ea1825057c91fa156d7d0bd752fefdad6f8c7a" + "md5": "3f9b36a7a94cd235bfd5f05794828445", + "sha256": "0ae8d28caf5c12ec1714b16d2e7157ddd52397ea6bfdeba5a9432e449a0184da" }, "downloads": -1, "filename": "poetry_core-1.5.0.tar.gz", "has_sig": false, - "md5_digest": "481671a4895af7cdda4944eab67f3843", + "md5_digest": "3f9b36a7a94cd235bfd5f05794828445", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7,<4.0", diff --git a/tests/repositories/fixtures/pypi.org/json/poetry.json b/tests/repositories/fixtures/pypi.org/json/poetry.json index f3aa04a8b98..854f3c7e6e7 100644 --- a/tests/repositories/fixtures/pypi.org/json/poetry.json +++ b/tests/repositories/fixtures/pypi.org/json/poetry.json @@ -1,84 +1,12 @@ { "name": "poetry", "files": [ - { - "filename": "poetry-0.12.0-py2.py3-none-any.whl", - "url": "https://files.pythonhosted.org/packages/9f/34/cb438970b165513f66f681082092871aa3b88be60218f74ca933a8af4009/poetry-0.12.0-py2.py3-none-any.whl", - "hashes": { - "md5": "e41b413e4ee8d551cc867adb968843a5", - "sha256": "1c818dcca72a9dc5cd13a30e29654986e3e288f6b158673e3d5b2cc51dec2309" - }, - "requires-python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" - }, - { - "filename": "poetry-0.12.0.tar.gz", - "url": "https://files.pythonhosted.org/packages/c6/68/471e26c5d04474aa51b4eb3173645b0e8987e4fb632a035488278d626438/poetry-0.12.0.tar.gz", - "hashes": { - "md5": "18c57cdba5fc86cb74b36e766114959b", - "sha256": "f8565669c5b7679fb5a560a1f93d367f7729f5f2ad1ed06e835549196e764fdb" - }, - "requires-python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" - }, - { - "filename": "poetry-0.12.1-py2.py3-none-any.whl", - "url": "https://files.pythonhosted.org/packages/de/b4/087632dcc5d0d54bbc2c66a91d23ab6550c26e0849eab0ce713c638cbcb9/poetry-0.12.1-py2.py3-none-any.whl", - "hashes": { - "md5": "01da4d43121437cd730160b803d4fe48", - "sha256": "2f1c3f3545ff0b192f543a35523ece22824bdee0954627960a7562ec0e377113" - }, - "requires-python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" - }, - { - "filename": "poetry-0.12.1.tar.gz", - "url": "https://files.pythonhosted.org/packages/89/90/1698d2d1f7c3d25b62c701995cce4f0432308c9899614e34489e8d5c364a/poetry-0.12.1.tar.gz", - "hashes": { - "md5": "9dd2e98a85a36bde43d0f10b991d6982", - "sha256": "adefe0e70c91bc98b272a2c0dd7ac67882de62972eafac7625606b14cc49c8a9" - }, - "requires-python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" - }, - { - "filename": "poetry-0.12.2-py2.py3-none-any.whl", - "url": "https://files.pythonhosted.org/packages/a5/62/4f4c9a0c49145e5368829806baa202f760403299d3a6a4d8d9e2dd277f85/poetry-0.12.2-py2.py3-none-any.whl", - "hashes": { - "md5": "8d52945ff3e6d057f0a5c8d43dbdd1be", - "sha256": "07bb0d57798b54564526a83b3b6ee31450e3ff9c91580deff7970402e8cf9648" - }, - "requires-python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" - }, - { - "filename": "poetry-0.12.2.tar.gz", - "url": "https://files.pythonhosted.org/packages/72/9d/30c6c7b2823bda75a568827fe518bc6fc7d59a199336767afb7ac888da4c/poetry-0.12.2.tar.gz", - "hashes": { - "md5": "03a09bf2b231701bc698e9fe2e237bd0", - "sha256": "1b9c7a70ac71a416c2b4ec69b89e37fa39afd965a1d0fe58a01e3121d89e98ef" - }, - "requires-python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" - }, - { - "filename": "poetry-0.12.3-py2.py3-none-any.whl", - "url": "https://files.pythonhosted.org/packages/91/5c/fd1507d5950bf31050650b0ea973c3aa98cd231ed0a18ab36eefde7db9c3/poetry-0.12.3-py2.py3-none-any.whl", - "hashes": { - "md5": "541da5e58318b5b5804ee068c9c98468", - "sha256": "936365627f5a29921886c5d2f9aef688899e691af706d136bf17d291a4f33d9b" - }, - "requires-python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" - }, - { - "filename": "poetry-0.12.3.tar.gz", - "url": "https://files.pythonhosted.org/packages/23/86/9166b68a9b9084eca5a3a53ef6131b3318a0b9c48ee8593623330e164c85/poetry-0.12.3.tar.gz", - "hashes": { - "md5": "48e88e9ae840e2f0c5da5cd00c8b5b1e", - "sha256": "dbc6f7269f8015d2f2408471f2b2eec2365b5bfd20cff8d9824664b67505aaae" - }, - "requires-python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" - }, { "filename": "poetry-0.12.4-py2.py3-none-any.whl", "url": "https://files.pythonhosted.org/packages/1b/af/013cdcc6f9d4c0bf025b3924981991a8b034db7818fd324c525b7e8a2b6c/poetry-0.12.4-py2.py3-none-any.whl", "hashes": { - "md5": "a7975e8b090eb3e006814d5e7c2c986f", - "sha256": "9d3759bf7f3d8107262cda917b615c185da57e96785a696dd1f117526917f850" + "md5": "763b00c6295dfdc3d0223eb35eadffb3", + "sha256": "1819c1587198652bafb1698b6ef1f70f4ff85682e536ca991509e9b1e679cc21" }, "requires-python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" }, @@ -86,8 +14,8 @@ "filename": "poetry-0.12.4.tar.gz", "url": "https://files.pythonhosted.org/packages/b5/4f/8a864e12a4a03f13467d5ac3d0cc67e75130ae966e3528e9ecbe3df980d6/poetry-0.12.4.tar.gz", "hashes": { - "md5": "c3d1d7576d2ee6663b59e12236a163e9", - "sha256": "fc924ef535c9229aac4f7cfda948e64e890417242d808c0880febb0ea333b9f6" + "md5": "49660b27968a8b2cfe0c451e4489a8ae", + "sha256": "484b55eea5617b4bc20ca538cfcc7e0fcb870fb1390abab4d0af33f22718434d" }, "requires-python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" } diff --git a/tests/repositories/fixtures/pypi.org/json/poetry/0.12.4.json b/tests/repositories/fixtures/pypi.org/json/poetry/0.12.4.json index b0a7530a020..5e41f3e2858 100644 --- a/tests/repositories/fixtures/pypi.org/json/poetry/0.12.4.json +++ b/tests/repositories/fixtures/pypi.org/json/poetry/0.12.4.json @@ -51,13 +51,13 @@ { "comment_text": "", "digests": { - "md5": "a7975e8b090eb3e006814d5e7c2c986f", - "sha256": "9d3759bf7f3d8107262cda917b615c185da57e96785a696dd1f117526917f850" + "md5": "763b00c6295dfdc3d0223eb35eadffb3", + "sha256": "1819c1587198652bafb1698b6ef1f70f4ff85682e536ca991509e9b1e679cc21" }, "downloads": -1, "filename": "poetry-0.12.4-py2.py3-none-any.whl", "has_sig": false, - "md5_digest": "a7975e8b090eb3e006814d5e7c2c986f", + "md5_digest": "763b00c6295dfdc3d0223eb35eadffb3", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", @@ -68,13 +68,13 @@ { "comment_text": "", "digests": { - "md5": "c3d1d7576d2ee6663b59e12236a163e9", - "sha256": "fc924ef535c9229aac4f7cfda948e64e890417242d808c0880febb0ea333b9f6" + "md5": "49660b27968a8b2cfe0c451e4489a8ae", + "sha256": "484b55eea5617b4bc20ca538cfcc7e0fcb870fb1390abab4d0af33f22718434d" }, "downloads": -1, "filename": "poetry-0.12.4.tar.gz", "has_sig": false, - "md5_digest": "c3d1d7576d2ee6663b59e12236a163e9", + "md5_digest": "49660b27968a8b2cfe0c451e4489a8ae", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", diff --git a/tests/repositories/fixtures/pypi.org/json/py.json b/tests/repositories/fixtures/pypi.org/json/py.json index 6838d02b10d..d2e4aaea1cb 100644 --- a/tests/repositories/fixtures/pypi.org/json/py.json +++ b/tests/repositories/fixtures/pypi.org/json/py.json @@ -5,16 +5,16 @@ "filename": "py-1.5.3-py2.py3-none-any.whl", "url": "https://files.pythonhosted.org/packages/67/a5/f77982214dd4c8fd104b066f249adea2c49e25e8703d284382eb5e9ab35a/py-1.5.3-py2.py3-none-any.whl", "hashes": { - "md5": "3184fb17d224b073117a25336040d7c7", - "sha256": "983f77f3331356039fdd792e9220b7b8ee1aa6bd2b25f567a963ff1de5a64f6a" + "md5": "98652ecee6fc3bb5393a17828f93e1fb", + "sha256": "43ee6c7f95e0ec6a906de49906b79d138d89728fff17109d49f086abc2fdd985" } }, { "filename": "py-1.5.3.tar.gz", "url": "https://files.pythonhosted.org/packages/f7/84/b4c6e84672c4ceb94f727f3da8344037b62cee960d80e999b1cd9b832d83/py-1.5.3.tar.gz", "hashes": { - "md5": "667d37a148ad9fb81266492903f2d880", - "sha256": "29c9fab495d7528e80ba1e343b958684f4ace687327e6f789a94bf3d1915f881" + "md5": "623e80cfc06df930414a9ce4bf0fd6c9", + "sha256": "2df2c513c3af11de15f58189ba5539ddc4768c6f33816dc5c03950c8bd6180fa" } } ], diff --git a/tests/repositories/fixtures/pypi.org/json/py/1.5.3.json b/tests/repositories/fixtures/pypi.org/json/py/1.5.3.json index 4c998966bd8..fcad09a3e16 100644 --- a/tests/repositories/fixtures/pypi.org/json/py/1.5.3.json +++ b/tests/repositories/fixtures/pypi.org/json/py/1.5.3.json @@ -51,13 +51,13 @@ { "comment_text": "", "digests": { - "md5": "3184fb17d224b073117a25336040d7c7", - "sha256": "983f77f3331356039fdd792e9220b7b8ee1aa6bd2b25f567a963ff1de5a64f6a" + "md5": "98652ecee6fc3bb5393a17828f93e1fb", + "sha256": "43ee6c7f95e0ec6a906de49906b79d138d89728fff17109d49f086abc2fdd985" }, "downloads": -1, "filename": "py-1.5.3-py2.py3-none-any.whl", "has_sig": false, - "md5_digest": "3184fb17d224b073117a25336040d7c7", + "md5_digest": "98652ecee6fc3bb5393a17828f93e1fb", "packagetype": "bdist_wheel", "python_version": "py2.py3", "size": 84903, @@ -67,13 +67,13 @@ { "comment_text": "", "digests": { - "md5": "667d37a148ad9fb81266492903f2d880", - "sha256": "29c9fab495d7528e80ba1e343b958684f4ace687327e6f789a94bf3d1915f881" + "md5": "623e80cfc06df930414a9ce4bf0fd6c9", + "sha256": "2df2c513c3af11de15f58189ba5539ddc4768c6f33816dc5c03950c8bd6180fa" }, "downloads": -1, "filename": "py-1.5.3.tar.gz", "has_sig": false, - "md5_digest": "667d37a148ad9fb81266492903f2d880", + "md5_digest": "623e80cfc06df930414a9ce4bf0fd6c9", "packagetype": "sdist", "python_version": "source", "size": 202335, diff --git a/tests/repositories/fixtures/pypi.org/json/pylev.json b/tests/repositories/fixtures/pypi.org/json/pylev.json index d48d828091d..52f24de0e21 100644 --- a/tests/repositories/fixtures/pypi.org/json/pylev.json +++ b/tests/repositories/fixtures/pypi.org/json/pylev.json @@ -5,8 +5,8 @@ "filename": "pylev-1.3.0-py2.py3-none-any.whl", "url": "https://files.pythonhosted.org/packages/40/1c/7dff1d242bf1e19f9c6202f0ba4e6fd18cc7ecb8bc85b17b2d16c806e228/pylev-1.3.0-py2.py3-none-any.whl", "hashes": { - "md5": "6da14dfce5034873fc5c2d7a6e83dc29", - "sha256": "1d29a87beb45ebe1e821e7a3b10da2b6b2f4c79b43f482c2df1a1f748a6e114e" + "md5": "4a18ac5d436decb5e4ef80633930559e", + "sha256": "79fe82d35708f7308ec60e7f424b15fc294fb43aca6c673679051a73be1b1e1d" } } ], diff --git a/tests/repositories/fixtures/pypi.org/json/pylev/1.3.0.json b/tests/repositories/fixtures/pypi.org/json/pylev/1.3.0.json index 32299a2452f..37d59287459 100644 --- a/tests/repositories/fixtures/pypi.org/json/pylev/1.3.0.json +++ b/tests/repositories/fixtures/pypi.org/json/pylev/1.3.0.json @@ -11,7 +11,7 @@ "Programming Language :: Python", "Programming Language :: Python :: 3" ], - "description": "pylev\n=====\n\nA pure Python Levenshtein implementation that's not freaking GPL'd.\n\nBased off the Wikipedia code samples at\nhttp://en.wikipedia.org/wiki/Levenshtein_distance.\n\n\nRequirements\n------------\n\n* Python 2.7.X, Python 3.3+ or PyPy 1.6.0+\n\n\nUsage\n-----\n\nUsage is fairly straightforward.::\n\n import pylev\n distance = pylev.levenshtein('kitten', 'sitting')\n assert(distance, 3)\n\n\nLicense\n-------\n\nNew BSD.\n\n\nTests\n-----\n\nSetup::\n\n $ git clone https://github.com/toastdriven/pylev.git\n $ cd pylev\n\nRunning::\n\n $ python -m unittest tests\n\n[![Build Status](https://travis-ci.org/toastdriven/pylev.png)](https://travis-ci.org/toastdriven/pylev)\n\n\nVersion History\n---------------\n\n* v1.3.0\n\n * Implemented a considerably faster variants (orders of magnitude).\n * Tested & working on Python 2.7.4, Python 3.3.1 & PyPy 1.9.0.\n\n* v1.2.0\n\n * Fixed all incorrect spellings of \"Levenshtein\" (there's no \"c\" in it).\n * Old methods are aliased for backward-compatibility.\n\n* v1.1.0\n\n * Implemented a much faster variant (several orders of magnitude).\n * The older variant was renamed to ``classic_levenschtein``.\n * Tested & working on Python 3.3 & PyPy 1.6.0 as well.\n\n* v1.0.2\n\n * Python packaging is **REALLY** hard. Including the README *this time*.\n\n* v1.0.1\n\n * Python packaging is hard. Including the README this time.\n\n* v1.0.0\n\n * Initial release, just the naive implementation of Levenshtein.", + "description": "", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", @@ -46,13 +46,13 @@ { "comment_text": "", "digests": { - "md5": "6da14dfce5034873fc5c2d7a6e83dc29", - "sha256": "1d29a87beb45ebe1e821e7a3b10da2b6b2f4c79b43f482c2df1a1f748a6e114e" + "md5": "4a18ac5d436decb5e4ef80633930559e", + "sha256": "79fe82d35708f7308ec60e7f424b15fc294fb43aca6c673679051a73be1b1e1d" }, "downloads": -1, "filename": "pylev-1.3.0-py2.py3-none-any.whl", "has_sig": false, - "md5_digest": "6da14dfce5034873fc5c2d7a6e83dc29", + "md5_digest": "4a18ac5d436decb5e4ef80633930559e", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, @@ -66,13 +66,13 @@ { "comment_text": "", "digests": { - "md5": "3be579cfc32ce5140cc04001f898741b", - "sha256": "063910098161199b81e453025653ec53556c1be7165a9b7c50be2f4d57eae1c3" + "md5": "4a43a124071fbaceee448320adce16df", + "sha256": "80a7c3932ef653ae7f1d09fb0fd73476b48db58c85a31e6ef401848562c395f0" }, "downloads": -1, "filename": "pylev-1.3.0.tar.gz", "has_sig": false, - "md5_digest": "3be579cfc32ce5140cc04001f898741b", + "md5_digest": "4a43a124071fbaceee448320adce16df", "packagetype": "sdist", "python_version": "source", "requires_python": null, diff --git a/tests/repositories/fixtures/pypi.org/json/pytest.json b/tests/repositories/fixtures/pypi.org/json/pytest.json index 6b600d14a84..6403f8a9a43 100644 --- a/tests/repositories/fixtures/pypi.org/json/pytest.json +++ b/tests/repositories/fixtures/pypi.org/json/pytest.json @@ -5,16 +5,16 @@ "filename": "pytest-3.5.0-py2.py3-none-any.whl", "url": "https://files.pythonhosted.org/packages/ed/96/271c93f75212c06e2a7ec3e2fa8a9c90acee0a4838dc05bf379ea09aae31/pytest-3.5.0-py2.py3-none-any.whl", "hashes": { - "md5": "c0b6697b7130c495aba71cdfcf939cc9", - "sha256": "6266f87ab64692112e5477eba395cfedda53b1933ccd29478e671e73b420c19c" + "md5": "d3b1e9aea9e5b9e7a226d8b08aa43662", + "sha256": "28e4d9c2ae3196d74805c2eba24f350ae4c791a5b9b397c79b41506a48dc64ca" } }, { "filename": "pytest-3.5.0.tar.gz", "url": "https://files.pythonhosted.org/packages/2d/56/6019153cdd743300c5688ab3b07702355283e53c83fbf922242c053ffb7b/pytest-3.5.0.tar.gz", "hashes": { - "md5": "b8e13a4091f07ff1fda081cf40ff99f1", - "sha256": "fae491d1874f199537fd5872b5e1f0e74a009b979df9d53d1553fd03da1703e1" + "md5": "ccd78dac54112045f561c4df86631f19", + "sha256": "677b1d6decd29c041fe64276f29f79fbe66e40c59e445eb251366b4a8ab8bf68" } } ], diff --git a/tests/repositories/fixtures/pypi.org/json/pytest/3.5.0.json b/tests/repositories/fixtures/pypi.org/json/pytest/3.5.0.json index d279d12991b..84db5b64a75 100644 --- a/tests/repositories/fixtures/pypi.org/json/pytest/3.5.0.json +++ b/tests/repositories/fixtures/pypi.org/json/pytest/3.5.0.json @@ -21,7 +21,7 @@ "Topic :: Software Development :: Testing", "Topic :: Utilities" ], - "description": ".. image:: http://docs.pytest.org/en/latest/_static/pytest1.png\n :target: http://docs.pytest.org\n :align: center\n :alt: pytest\n\n------\n\n.. image:: https://img.shields.io/pypi/v/pytest.svg\n :target: https://pypi.python.org/pypi/pytest\n\n.. image:: https://anaconda.org/conda-forge/pytest/badges/version.svg\n :target: https://anaconda.org/conda-forge/pytest\n\n.. image:: https://img.shields.io/pypi/pyversions/pytest.svg\n :target: https://pypi.python.org/pypi/pytest\n\n.. image:: https://img.shields.io/coveralls/pytest-dev/pytest/master.svg\n :target: https://coveralls.io/r/pytest-dev/pytest\n\n.. image:: https://travis-ci.org/pytest-dev/pytest.svg?branch=master\n :target: https://travis-ci.org/pytest-dev/pytest\n\n.. image:: https://ci.appveyor.com/api/projects/status/mrgbjaua7t33pg6b?svg=true\n :target: https://ci.appveyor.com/project/pytestbot/pytest\n\n.. image:: https://www.codetriage.com/pytest-dev/pytest/badges/users.svg\n :target: https://www.codetriage.com/pytest-dev/pytest\n\nThe ``pytest`` framework makes it easy to write small tests, yet\nscales to support complex functional testing for applications and libraries.\n\nAn example of a simple test:\n\n.. code-block:: python\n\n # content of test_sample.py\n def inc(x):\n return x + 1\n\n def test_answer():\n assert inc(3) == 5\n\n\nTo execute it::\n\n $ pytest\n ============================= test session starts =============================\n collected 1 items\n\n test_sample.py F\n\n ================================== FAILURES ===================================\n _________________________________ test_answer _________________________________\n\n def test_answer():\n > assert inc(3) == 5\n E assert 4 == 5\n E + where 4 = inc(3)\n\n test_sample.py:5: AssertionError\n ========================== 1 failed in 0.04 seconds ===========================\n\n\nDue to ``pytest``'s detailed assertion introspection, only plain ``assert`` statements are used. See `getting-started `_ for more examples.\n\n\nFeatures\n--------\n\n- Detailed info on failing `assert statements `_ (no need to remember ``self.assert*`` names);\n\n- `Auto-discovery\n `_\n of test modules and functions;\n\n- `Modular fixtures `_ for\n managing small or parametrized long-lived test resources;\n\n- Can run `unittest `_ (or trial),\n `nose `_ test suites out of the box;\n\n- Python 2.7, Python 3.4+, PyPy 2.3, Jython 2.5 (untested);\n\n- Rich plugin architecture, with over 315+ `external plugins `_ and thriving community;\n\n\nDocumentation\n-------------\n\nFor full documentation, including installation, tutorials and PDF documents, please see http://docs.pytest.org.\n\n\nBugs/Requests\n-------------\n\nPlease use the `GitHub issue tracker `_ to submit bugs or request features.\n\n\nChangelog\n---------\n\nConsult the `Changelog `__ page for fixes and enhancements of each version.\n\n\nLicense\n-------\n\nCopyright Holger Krekel and others, 2004-2017.\n\nDistributed under the terms of the `MIT`_ license, pytest is free and open source software.\n\n.. _`MIT`: https://github.com/pytest-dev/pytest/blob/master/LICENSE\n\n\n", + "description": "", "docs_url": null, "download_url": "", "downloads": { @@ -58,13 +58,13 @@ { "comment_text": "", "digests": { - "md5": "c0b6697b7130c495aba71cdfcf939cc9", - "sha256": "6266f87ab64692112e5477eba395cfedda53b1933ccd29478e671e73b420c19c" + "md5": "d3b1e9aea9e5b9e7a226d8b08aa43662", + "sha256": "28e4d9c2ae3196d74805c2eba24f350ae4c791a5b9b397c79b41506a48dc64ca" }, "downloads": -1, "filename": "pytest-3.5.0-py2.py3-none-any.whl", "has_sig": false, - "md5_digest": "c0b6697b7130c495aba71cdfcf939cc9", + "md5_digest": "d3b1e9aea9e5b9e7a226d8b08aa43662", "packagetype": "bdist_wheel", "python_version": "py2.py3", "size": 194247, @@ -74,13 +74,13 @@ { "comment_text": "", "digests": { - "md5": "b8e13a4091f07ff1fda081cf40ff99f1", - "sha256": "fae491d1874f199537fd5872b5e1f0e74a009b979df9d53d1553fd03da1703e1" + "md5": "ccd78dac54112045f561c4df86631f19", + "sha256": "677b1d6decd29c041fe64276f29f79fbe66e40c59e445eb251366b4a8ab8bf68" }, "downloads": -1, "filename": "pytest-3.5.0.tar.gz", "has_sig": false, - "md5_digest": "b8e13a4091f07ff1fda081cf40ff99f1", + "md5_digest": "ccd78dac54112045f561c4df86631f19", "packagetype": "sdist", "python_version": "source", "size": 830816, diff --git a/tests/repositories/fixtures/pypi.org/json/pytest/3.5.1.json b/tests/repositories/fixtures/pypi.org/json/pytest/3.5.1.json index 684d341cf6c..780be8b8e2b 100644 --- a/tests/repositories/fixtures/pypi.org/json/pytest/3.5.1.json +++ b/tests/repositories/fixtures/pypi.org/json/pytest/3.5.1.json @@ -21,7 +21,7 @@ "Topic :: Software Development :: Testing", "Topic :: Utilities" ], - "description": ".. image:: http://docs.pytest.org/en/latest/_static/pytest1.png\n :target: http://docs.pytest.org\n :align: center\n :alt: pytest\n\n------\n\n.. image:: https://img.shields.io/pypi/v/pytest.svg\n :target: https://pypi.python.org/pypi/pytest\n\n.. image:: https://anaconda.org/conda-forge/pytest/badges/version.svg\n :target: https://anaconda.org/conda-forge/pytest\n\n.. image:: https://img.shields.io/pypi/pyversions/pytest.svg\n :target: https://pypi.python.org/pypi/pytest\n\n.. image:: https://img.shields.io/coveralls/pytest-dev/pytest/master.svg\n :target: https://coveralls.io/r/pytest-dev/pytest\n\n.. image:: https://travis-ci.org/pytest-dev/pytest.svg?branch=master\n :target: https://travis-ci.org/pytest-dev/pytest\n\n.. image:: https://ci.appveyor.com/api/projects/status/mrgbjaua7t33pg6b?svg=true\n :target: https://ci.appveyor.com/project/pytestbot/pytest\n\n.. image:: https://www.codetriage.com/pytest-dev/pytest/badges/users.svg\n :target: https://www.codetriage.com/pytest-dev/pytest\n\nThe ``pytest`` framework makes it easy to write small tests, yet\nscales to support complex functional testing for applications and libraries.\n\nAn example of a simple test:\n\n.. code-block:: python\n\n # content of test_sample.py\n def inc(x):\n return x + 1\n\n def test_answer():\n assert inc(3) == 5\n\n\nTo execute it::\n\n $ pytest\n ============================= test session starts =============================\n collected 1 items\n\n test_sample.py F\n\n ================================== FAILURES ===================================\n _________________________________ test_answer _________________________________\n\n def test_answer():\n > assert inc(3) == 5\n E assert 4 == 5\n E + where 4 = inc(3)\n\n test_sample.py:5: AssertionError\n ========================== 1 failed in 0.04 seconds ===========================\n\n\nDue to ``pytest``'s detailed assertion introspection, only plain ``assert`` statements are used. See `getting-started `_ for more examples.\n\n\nFeatures\n--------\n\n- Detailed info on failing `assert statements `_ (no need to remember ``self.assert*`` names);\n\n- `Auto-discovery\n `_\n of test modules and functions;\n\n- `Modular fixtures `_ for\n managing small or parametrized long-lived test resources;\n\n- Can run `unittest `_ (or trial),\n `nose `_ test suites out of the box;\n\n- Python 2.7, Python 3.4+, PyPy 2.3, Jython 2.5 (untested);\n\n- Rich plugin architecture, with over 315+ `external plugins `_ and thriving community;\n\n\nDocumentation\n-------------\n\nFor full documentation, including installation, tutorials and PDF documents, please see http://docs.pytest.org.\n\n\nBugs/Requests\n-------------\n\nPlease use the `GitHub issue tracker `_ to submit bugs or request features.\n\n\nChangelog\n---------\n\nConsult the `Changelog `__ page for fixes and enhancements of each version.\n\n\nLicense\n-------\n\nCopyright Holger Krekel and others, 2004-2017.\n\nDistributed under the terms of the `MIT`_ license, pytest is free and open source software.\n\n.. _`MIT`: https://github.com/pytest-dev/pytest/blob/master/LICENSE\n\n\n", + "description": "", "description_content_type": "", "docs_url": null, "download_url": "", @@ -66,13 +66,13 @@ { "comment_text": "", "digests": { - "md5": "01b206fe1d54f5255c360743ac9a044d", - "sha256": "829230122facf05a5f81a6d4dfe6454a04978ea3746853b2b84567ecf8e5c526" + "md5": "f1de372a436700e3a785e85c11d15821", + "sha256": "6d3e83b1c1697d220137e436980e73b3ca674f643e666d7c24b0321cb57b76a4" }, "downloads": -1, "filename": "pytest-3.5.1-py2.py3-none-any.whl", "has_sig": false, - "md5_digest": "01b206fe1d54f5255c360743ac9a044d", + "md5_digest": "f1de372a436700e3a785e85c11d15821", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", @@ -86,13 +86,13 @@ { "comment_text": "", "digests": { - "md5": "ffd870ee3ca561695d2f916f0f0f3c0b", - "sha256": "54713b26c97538db6ff0703a12b19aeaeb60b5e599de542e7fca0ec83b9038e8" + "md5": "961104636090457187851ccb9ef0f677", + "sha256": "b8fe151f3e181801dd38583a1c03818fbc662a8fce96c9063a0af624613e78f8" }, "downloads": -1, "filename": "pytest-3.5.1.tar.gz", "has_sig": false, - "md5_digest": "ffd870ee3ca561695d2f916f0f0f3c0b", + "md5_digest": "961104636090457187851ccb9ef0f677", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", diff --git a/tests/repositories/fixtures/pypi.org/json/python-language-server.json b/tests/repositories/fixtures/pypi.org/json/python-language-server.json new file mode 100644 index 00000000000..c17601e5776 --- /dev/null +++ b/tests/repositories/fixtures/pypi.org/json/python-language-server.json @@ -0,0 +1,26 @@ +{ + "files": [ + { + "core-metadata": false, + "data-dist-info-metadata": false, + "filename": "python-language-server-0.21.2.tar.gz", + "hashes": { + "md5": "677602ec38bc1c7b72de6128d90d846b", + "sha256": "91b564e092f3135b2bac70dbd23d283da5ad50269766a76648787b69fe702c7e" + }, + "requires-python": null, + "size": 51676, + "upload-time": "2018-09-06T18:11:28.546667Z", + "url": "https://files.pythonhosted.org/packages/9f/1d/2817b5dc2dd77f897410a11c1c9e2a6d96b3273c53d4219dd9edab7882af/python-language-server-0.21.2.tar.gz", + "yanked": false + } + ], + "meta": { + "_last-serial": 8878952, + "api-version": "1.1" + }, + "name": "python-language-server", + "versions": [ + "0.21.2" + ] +} diff --git a/tests/repositories/fixtures/pypi.org/json/python-language-server/0.21.2.json b/tests/repositories/fixtures/pypi.org/json/python-language-server/0.21.2.json new file mode 100644 index 00000000000..c249c2b8324 --- /dev/null +++ b/tests/repositories/fixtures/pypi.org/json/python-language-server/0.21.2.json @@ -0,0 +1,62 @@ +{ + "info": { + "author": "Palantir Technologies, Inc.", + "author_email": "", + "bugtrack_url": null, + "classifiers": [], + "description": "", + "description_content_type": "", + "docs_url": null, + "download_url": "", + "downloads": { + "last_day": -1, + "last_month": -1, + "last_week": -1 + }, + "dynamic": null, + "home_page": "https://github.com/palantir/python-language-server", + "keywords": "", + "license": "", + "maintainer": "", + "maintainer_email": "", + "name": "python-language-server", + "package_url": "https://pypi.org/project/python-language-server/", + "platform": "", + "project_url": "https://pypi.org/project/python-language-server/", + "project_urls": { + "Homepage": "https://github.com/palantir/python-language-server" + }, + "provides_extra": null, + "release_url": "https://pypi.org/project/python-language-server/0.21.2/", + "requires_dist": null, + "requires_python": "", + "summary": "Python Language Server for the Language Server Protocol", + "version": "0.21.2", + "yanked": false, + "yanked_reason": null + }, + "last_serial": 8878952, + "urls": [ + { + "comment_text": "", + "digests": { + "md5": "677602ec38bc1c7b72de6128d90d846b", + "sha256": "91b564e092f3135b2bac70dbd23d283da5ad50269766a76648787b69fe702c7e" + }, + "downloads": -1, + "filename": "python-language-server-0.21.2.tar.gz", + "has_sig": false, + "md5_digest": "677602ec38bc1c7b72de6128d90d846b", + "packagetype": "sdist", + "python_version": "source", + "requires_python": null, + "size": 51676, + "upload_time": "2018-09-06T18:11:28", + "upload_time_iso_8601": "2018-09-06T18:11:28.546667Z", + "url": "https://files.pythonhosted.org/packages/9f/1d/2817b5dc2dd77f897410a11c1c9e2a6d96b3273c53d4219dd9edab7882af/python-language-server-0.21.2.tar.gz", + "yanked": false, + "yanked_reason": null + } + ], + "vulnerabilities": [] +} diff --git a/tests/repositories/fixtures/pypi.org/json/pyyaml.json b/tests/repositories/fixtures/pypi.org/json/pyyaml.json index 51ce928179b..f890908c1a0 100644 --- a/tests/repositories/fixtures/pypi.org/json/pyyaml.json +++ b/tests/repositories/fixtures/pypi.org/json/pyyaml.json @@ -5,160 +5,88 @@ "filename": "PyYAML-3.13-cp27-cp27m-win32.whl", "url": "https://files.pythonhosted.org/packages/b8/2e/9c2285870c9de070a1fa5ede702ab5fb329901b3cc4028c24f44eda27c5f/PyYAML-3.13-cp27-cp27m-win32.whl", "hashes": { - "md5": "a83441aa7004e474bed6f6daeb61f27a", - "sha256": "d5eef459e30b09f5a098b9cea68bebfeb268697f78d647bd255a085371ac7f3f" + "md5": "57862339584f6f631cb2cd434c0dce22", + "sha256": "0cac9398d467c1d43b14380faeaa90dfc99223c0cf8d08ddb5168156240e9fc0" } }, { "filename": "PyYAML-3.13-cp27-cp27m-win_amd64.whl", "url": "https://files.pythonhosted.org/packages/df/4d/1ef8d60464a171112401e17a3a3e88fdb1d5b44af7606e8652b2f39ee9ce/PyYAML-3.13-cp27-cp27m-win_amd64.whl", "hashes": { - "md5": "dd05ba2d6cb042452a3849dea13b94f0", - "sha256": "e01d3203230e1786cd91ccfdc8f8454c8069c91bee3962ad93b87a4b2860f537" + "md5": "595ab135b3b5d73984b6aa3c430804dc", + "sha256": "22604446b01612af63e369c6bed7a2c454eda9bd5ccb7edf9bfbfd39a14ae464" } }, { "filename": "PyYAML-3.13-cp34-cp34m-win32.whl", "url": "https://files.pythonhosted.org/packages/35/f0/cf0363b5c431c3a828284903aeacc6bdbba342fd4d7871dda9a3b0b00d15/PyYAML-3.13-cp34-cp34m-win32.whl", "hashes": { - "md5": "49365caa070d53e30deceae118e4fea8", - "sha256": "558dd60b890ba8fd982e05941927a3911dc409a63dcb8b634feaa0cda69330d3" + "md5": "febd1e0a6e54bc16ead1a355a41ef2a0", + "sha256": "8e537c28684698935e2c86a5ed6bc5af736e46712e9a7f8a4c69f3694f4b6bc3" } }, { "filename": "PyYAML-3.13-cp34-cp34m-win_amd64.whl", "url": "https://files.pythonhosted.org/packages/8c/bc/8950092a86259dc511e02a4c3a517ed4b28a254e4da134e3c04e5264e5a3/PyYAML-3.13-cp34-cp34m-win_amd64.whl", "hashes": { - "md5": "0c486a54c19dd18b9e65a559886935c4", - "sha256": "d46d7982b62e0729ad0175a9bc7e10a566fc07b224d2c79fafb5e032727eaa04" + "md5": "ca6e472447f541d5a1bf5ff998e8fc2e", + "sha256": "a1ecddafcc43a383acb99f241ca7da0011082dd7a9236495ba8a87fbad0c40d2" } }, { "filename": "PyYAML-3.13-cp35-cp35m-win32.whl", "url": "https://files.pythonhosted.org/packages/29/33/8bbcd3740d9e96cfb57427b8db7a12093402a3a83f2054887e027b2849de/PyYAML-3.13-cp35-cp35m-win32.whl", "hashes": { - "md5": "53ce2b9f6b741fb2f070d12839b5789e", - "sha256": "a7c28b45d9f99102fa092bb213aa12e0aaf9a6a1f5e395d36166639c1f96c3a1" + "md5": "2f45666423475f050b5b5785930e5876", + "sha256": "e0aa0b28e3faf7a8bcb8f4ab3d28e4fb01d687bcfb75e5f6b12d53b82f99b6cc" } }, { "filename": "PyYAML-3.13-cp35-cp35m-win_amd64.whl", "url": "https://files.pythonhosted.org/packages/ad/d4/d895fb7ac1b0828151b829a32cefc8a8b58b4499570520b91af20982b880/PyYAML-3.13-cp35-cp35m-win_amd64.whl", "hashes": { - "md5": "1b70e7ced4c82364bda4ac9094d6e259", - "sha256": "bc558586e6045763782014934bfaf39d48b8ae85a2713117d16c39864085c613" + "md5": "a21cdc697d03b9b446f95e6d6b5ab93e", + "sha256": "b96803e106c5ebbae46018e0523ec7dc970d95b2cf8761d6c0a2c75d8d5c027b" } }, { "filename": "PyYAML-3.13-cp36-cp36m-win32.whl", "url": "https://files.pythonhosted.org/packages/fb/51/0c49c6caafe8d9a27ad9b0ca9f91adda5a5072b9efbbe7585fb97a4c71c4/PyYAML-3.13-cp36-cp36m-win32.whl", "hashes": { - "md5": "8f62197b853b5b387ff588df05cee7a6", - "sha256": "40c71b8e076d0550b2e6380bada1f1cd1017b882f7e16f09a65be98e017f211a" + "md5": "088e59a995c3387ebe666841bc02ab1b", + "sha256": "9a3dbf2d52067e59d74d161655e6d841596cd736ad17f5fdadd9eb9416faddef" } }, { "filename": "PyYAML-3.13-cp36-cp36m-win_amd64.whl", "url": "https://files.pythonhosted.org/packages/4f/ca/5fad249c5032270540c24d2189b0ddf1396aac49b0bdc548162edcf14131/PyYAML-3.13-cp36-cp36m-win_amd64.whl", "hashes": { - "md5": "ff7280dd032d202b417871d39febadec", - "sha256": "3d7da3009c0f3e783b2c873687652d83b1bbfd5c88e9813fb7e5b03c0dd3108b" + "md5": "a4db4b28a9d04264f93d1aaf0d0ae88d", + "sha256": "cc1531e17d6de77b03971719feb1e8e5ff976bea3d645c3772dbb9fbb91ffde1" } }, { "filename": "PyYAML-3.13-cp37-cp37m-win32.whl", "url": "https://files.pythonhosted.org/packages/5c/ed/d6557f70daaaab6ee5cd2f8ccf7bedd63081e522e38679c03840e1acc114/PyYAML-3.13-cp37-cp37m-win32.whl", "hashes": { - "md5": "03ac720a2dcb18f2f1a3d026d281d778", - "sha256": "e170a9e6fcfd19021dd29845af83bb79236068bf5fd4df3327c1be18182b2531" + "md5": "60fd8936e8bdf917a750172f33b62d51", + "sha256": "a0184bd61052fa6942d65c294468116eaf00f43669437d46ad5530f7005c7f37" } }, { "filename": "PyYAML-3.13-cp37-cp37m-win_amd64.whl", "url": "https://files.pythonhosted.org/packages/bf/96/d02ef8e1f3073e07ffdc240444e5041f403f29c0775f9f1653f18221082f/PyYAML-3.13-cp37-cp37m-win_amd64.whl", "hashes": { - "md5": "02ab28701247a80e059daa6efe11e67d", - "sha256": "aa7dd4a6a427aed7df6fb7f08a580d68d9b118d90310374716ae90b710280af1" + "md5": "36d19ecd2632ba0e0a362f2a28d9244a", + "sha256": "84492bd518aeafdf1d2bceae160a60d748f75eb815533d96b8232205161f21f4" } }, { "filename": "PyYAML-3.13.tar.gz", "url": "https://files.pythonhosted.org/packages/9e/a3/1d13970c3f36777c583f136c136f804d70f500168edc1edea6daa7200769/PyYAML-3.13.tar.gz", "hashes": { - "md5": "b78b96636d68ac581c0e2f38158c224f", - "sha256": "3ef3092145e9b70e3ddd2c7ad59bdd0252a94dfe3949721633e41344de00a6bf" - } - }, - { - "filename": "PyYAML-4.2b4-cp27-cp27m-win32.whl", - "url": "https://files.pythonhosted.org/packages/12/9b/efdbaa3c9694b6315a4410e0d494ad50c5ade22ce33f4b482bfaea3930fd/PyYAML-4.2b4-cp27-cp27m-win32.whl", - "hashes": { - "md5": "76e2c2e8adea20377d9a7e6b6713c952", - "sha256": "8d6d96001aa7f0a6a4a95e8143225b5d06e41b1131044913fecb8f85a125714b" - } - }, - { - "filename": "PyYAML-4.2b4-cp27-cp27m-win_amd64.whl", - "url": "https://files.pythonhosted.org/packages/da/81/4ecefcc907b4ba1d181eb031a6da45b79e7b6db8b2376aa3040c4a2d01ea/PyYAML-4.2b4-cp27-cp27m-win_amd64.whl", - "hashes": { - "md5": "2ab351c6736b4e98721b37b14fd88002", - "sha256": "c8a88edd93ee29ede719080b2be6cb2333dfee1dccba213b422a9c8e97f2967b" - } - }, - { - "filename": "PyYAML-4.2b4-cp34-cp34m-win32.whl", - "url": "https://files.pythonhosted.org/packages/41/63/9a082d3be6e53452959b66389646b56ecef2c6e4f205a52ff8196ce49eef/PyYAML-4.2b4-cp34-cp34m-win32.whl", - "hashes": { - "md5": "cae07819a730ec7a811b3a20b31e0103", - "sha256": "3108529b78577327d15eec243f0ff348a0640b0c3478d67ad7f5648f93bac3e2" - } - }, - { - "filename": "PyYAML-4.2b4-cp34-cp34m-win_amd64.whl", - "url": "https://files.pythonhosted.org/packages/96/2b/8c2841d7ea6a319acc62537ad59910d545008ccd87d84b6a7813fb8d724d/PyYAML-4.2b4-cp34-cp34m-win_amd64.whl", - "hashes": { - "md5": "d0e6d73234c356003022281f2e61748a", - "sha256": "254bf6fda2b7c651837acb2c718e213df29d531eebf00edb54743d10bcb694eb" - } - }, - { - "filename": "PyYAML-4.2b4.tar.gz", - "url": "https://files.pythonhosted.org/packages/a8/c6/a8d1555e795dbd0375c3c93b576ca13bbf139db51ea604afa19a2c35fc03/PyYAML-4.2b4.tar.gz", - "hashes": { - "md5": "a842bc7391e145bbe4e7fd0d32da1132", - "sha256": "3c17fb92c8ba2f525e4b5f7941d850e7a48c3a59b32d331e2502a3cdc6648e76" - } - }, - { - "filename": "PyYAML-4.2b4.win32-py2.7.exe", - "url": "https://files.pythonhosted.org/packages/16/06/6157cf397464f883e7d5e22b3c6b8c86025291f62304ccba75285e3cf25b/PyYAML-4.2b4.win32-py2.7.exe", - "hashes": { - "md5": "e8b64f1f531762b4f7a7ee1c32d6819d", - "sha256": "1cbc199009e78f92d9edf554be4fe40fb7b0bef71ba688602a00e97a51909110" - } - }, - { - "filename": "PyYAML-4.2b4.win32-py3.4.exe", - "url": "https://files.pythonhosted.org/packages/47/83/7f39055bd68e0918dde8308fd57f0bf75d1579e2695e8b9a127d0c401a03/PyYAML-4.2b4.win32-py3.4.exe", - "hashes": { - "md5": "5dc5a4b389eab8de7492429ac9f190a7", - "sha256": "6f89b5c95e93945b597776163403d47af72d243f366bf4622ff08bdfd1c950b7" - } - }, - { - "filename": "PyYAML-4.2b4.win-amd64-py2.7.exe", - "url": "https://files.pythonhosted.org/packages/bc/51/36675a109c0cf585c1cb3c89f50f2014f4c228dc69572178c5b01de5aa96/PyYAML-4.2b4.win-amd64-py2.7.exe", - "hashes": { - "md5": "e56fcfe6196a5858fbc4ab69c9c5c21f", - "sha256": "be622cc81696e24d0836ba71f6272a2b5767669b0d79fdcf0295d51ac2e156c8" - } - }, - { - "filename": "PyYAML-4.2b4.win-amd64-py3.4.exe", - "url": "https://files.pythonhosted.org/packages/f2/62/415e37aa4296599a0db50dbdb6d9dd480ad4571008db855cf3c4dfdccea6/PyYAML-4.2b4.win-amd64-py3.4.exe", - "hashes": { - "md5": "0c60ac15877e9f50f72c52eb45cb85c6", - "sha256": "f39411e380e2182ad33be039e8ee5770a5d9efe01a2bfb7ae58d9ba31c4a2a9d" + "md5": "406a166b8ce8df5790f7689ad45d201e", + "sha256": "e6c07f136ba90afc1b049d7577b4f955845d796f359324662758f403929fd481" } } ], diff --git a/tests/repositories/fixtures/pypi.org/json/pyyaml/3.13.0.json b/tests/repositories/fixtures/pypi.org/json/pyyaml/3.13.0.json index bb718fe500f..b923da45330 100644 --- a/tests/repositories/fixtures/pypi.org/json/pyyaml/3.13.0.json +++ b/tests/repositories/fixtures/pypi.org/json/pyyaml/3.13.0.json @@ -17,7 +17,7 @@ "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing :: Markup" ], - "description": "YAML is a data serialization format designed for human readability\nand interaction with scripting languages. PyYAML is a YAML parser\nand emitter for Python.\n\nPyYAML features a complete YAML 1.1 parser, Unicode support, pickle\nsupport, capable extension API, and sensible error messages. PyYAML\nsupports standard YAML tags and provides Python-specific tags that\nallow to represent an arbitrary Python object.\n\nPyYAML is applicable for a broad range of tasks from complex\nconfiguration files to object serialization and persistance.", + "description": "", "description_content_type": "", "docs_url": null, "download_url": "http://pyyaml.org/download/pyyaml/PyYAML-3.13.tar.gz", @@ -52,13 +52,13 @@ { "comment_text": "", "digests": { - "md5": "a83441aa7004e474bed6f6daeb61f27a", - "sha256": "d5eef459e30b09f5a098b9cea68bebfeb268697f78d647bd255a085371ac7f3f" + "md5": "57862339584f6f631cb2cd434c0dce22", + "sha256": "0cac9398d467c1d43b14380faeaa90dfc99223c0cf8d08ddb5168156240e9fc0" }, "downloads": -1, "filename": "PyYAML-3.13-cp27-cp27m-win32.whl", "has_sig": false, - "md5_digest": "a83441aa7004e474bed6f6daeb61f27a", + "md5_digest": "57862339584f6f631cb2cd434c0dce22", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, @@ -72,13 +72,13 @@ { "comment_text": "", "digests": { - "md5": "dd05ba2d6cb042452a3849dea13b94f0", - "sha256": "e01d3203230e1786cd91ccfdc8f8454c8069c91bee3962ad93b87a4b2860f537" + "md5": "595ab135b3b5d73984b6aa3c430804dc", + "sha256": "22604446b01612af63e369c6bed7a2c454eda9bd5ccb7edf9bfbfd39a14ae464" }, "downloads": -1, "filename": "PyYAML-3.13-cp27-cp27m-win_amd64.whl", "has_sig": false, - "md5_digest": "dd05ba2d6cb042452a3849dea13b94f0", + "md5_digest": "595ab135b3b5d73984b6aa3c430804dc", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, @@ -92,13 +92,13 @@ { "comment_text": "", "digests": { - "md5": "49365caa070d53e30deceae118e4fea8", - "sha256": "558dd60b890ba8fd982e05941927a3911dc409a63dcb8b634feaa0cda69330d3" + "md5": "febd1e0a6e54bc16ead1a355a41ef2a0", + "sha256": "8e537c28684698935e2c86a5ed6bc5af736e46712e9a7f8a4c69f3694f4b6bc3" }, "downloads": -1, "filename": "PyYAML-3.13-cp34-cp34m-win32.whl", "has_sig": false, - "md5_digest": "49365caa070d53e30deceae118e4fea8", + "md5_digest": "febd1e0a6e54bc16ead1a355a41ef2a0", "packagetype": "bdist_wheel", "python_version": "cp34", "requires_python": null, @@ -112,13 +112,13 @@ { "comment_text": "", "digests": { - "md5": "0c486a54c19dd18b9e65a559886935c4", - "sha256": "d46d7982b62e0729ad0175a9bc7e10a566fc07b224d2c79fafb5e032727eaa04" + "md5": "ca6e472447f541d5a1bf5ff998e8fc2e", + "sha256": "a1ecddafcc43a383acb99f241ca7da0011082dd7a9236495ba8a87fbad0c40d2" }, "downloads": -1, "filename": "PyYAML-3.13-cp34-cp34m-win_amd64.whl", "has_sig": false, - "md5_digest": "0c486a54c19dd18b9e65a559886935c4", + "md5_digest": "ca6e472447f541d5a1bf5ff998e8fc2e", "packagetype": "bdist_wheel", "python_version": "cp34", "requires_python": null, @@ -132,13 +132,13 @@ { "comment_text": "", "digests": { - "md5": "53ce2b9f6b741fb2f070d12839b5789e", - "sha256": "a7c28b45d9f99102fa092bb213aa12e0aaf9a6a1f5e395d36166639c1f96c3a1" + "md5": "2f45666423475f050b5b5785930e5876", + "sha256": "e0aa0b28e3faf7a8bcb8f4ab3d28e4fb01d687bcfb75e5f6b12d53b82f99b6cc" }, "downloads": -1, "filename": "PyYAML-3.13-cp35-cp35m-win32.whl", "has_sig": false, - "md5_digest": "53ce2b9f6b741fb2f070d12839b5789e", + "md5_digest": "2f45666423475f050b5b5785930e5876", "packagetype": "bdist_wheel", "python_version": "cp35", "requires_python": null, @@ -152,13 +152,13 @@ { "comment_text": "", "digests": { - "md5": "1b70e7ced4c82364bda4ac9094d6e259", - "sha256": "bc558586e6045763782014934bfaf39d48b8ae85a2713117d16c39864085c613" + "md5": "a21cdc697d03b9b446f95e6d6b5ab93e", + "sha256": "b96803e106c5ebbae46018e0523ec7dc970d95b2cf8761d6c0a2c75d8d5c027b" }, "downloads": -1, "filename": "PyYAML-3.13-cp35-cp35m-win_amd64.whl", "has_sig": false, - "md5_digest": "1b70e7ced4c82364bda4ac9094d6e259", + "md5_digest": "a21cdc697d03b9b446f95e6d6b5ab93e", "packagetype": "bdist_wheel", "python_version": "cp35", "requires_python": null, @@ -172,13 +172,13 @@ { "comment_text": "", "digests": { - "md5": "8f62197b853b5b387ff588df05cee7a6", - "sha256": "40c71b8e076d0550b2e6380bada1f1cd1017b882f7e16f09a65be98e017f211a" + "md5": "088e59a995c3387ebe666841bc02ab1b", + "sha256": "9a3dbf2d52067e59d74d161655e6d841596cd736ad17f5fdadd9eb9416faddef" }, "downloads": -1, "filename": "PyYAML-3.13-cp36-cp36m-win32.whl", "has_sig": false, - "md5_digest": "8f62197b853b5b387ff588df05cee7a6", + "md5_digest": "088e59a995c3387ebe666841bc02ab1b", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, @@ -192,13 +192,13 @@ { "comment_text": "", "digests": { - "md5": "ff7280dd032d202b417871d39febadec", - "sha256": "3d7da3009c0f3e783b2c873687652d83b1bbfd5c88e9813fb7e5b03c0dd3108b" + "md5": "a4db4b28a9d04264f93d1aaf0d0ae88d", + "sha256": "cc1531e17d6de77b03971719feb1e8e5ff976bea3d645c3772dbb9fbb91ffde1" }, "downloads": -1, "filename": "PyYAML-3.13-cp36-cp36m-win_amd64.whl", "has_sig": false, - "md5_digest": "ff7280dd032d202b417871d39febadec", + "md5_digest": "a4db4b28a9d04264f93d1aaf0d0ae88d", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, @@ -212,13 +212,13 @@ { "comment_text": "", "digests": { - "md5": "03ac720a2dcb18f2f1a3d026d281d778", - "sha256": "e170a9e6fcfd19021dd29845af83bb79236068bf5fd4df3327c1be18182b2531" + "md5": "60fd8936e8bdf917a750172f33b62d51", + "sha256": "a0184bd61052fa6942d65c294468116eaf00f43669437d46ad5530f7005c7f37" }, "downloads": -1, "filename": "PyYAML-3.13-cp37-cp37m-win32.whl", "has_sig": false, - "md5_digest": "03ac720a2dcb18f2f1a3d026d281d778", + "md5_digest": "60fd8936e8bdf917a750172f33b62d51", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, @@ -232,13 +232,13 @@ { "comment_text": "", "digests": { - "md5": "02ab28701247a80e059daa6efe11e67d", - "sha256": "aa7dd4a6a427aed7df6fb7f08a580d68d9b118d90310374716ae90b710280af1" + "md5": "36d19ecd2632ba0e0a362f2a28d9244a", + "sha256": "84492bd518aeafdf1d2bceae160a60d748f75eb815533d96b8232205161f21f4" }, "downloads": -1, "filename": "PyYAML-3.13-cp37-cp37m-win_amd64.whl", "has_sig": false, - "md5_digest": "02ab28701247a80e059daa6efe11e67d", + "md5_digest": "36d19ecd2632ba0e0a362f2a28d9244a", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, @@ -252,13 +252,13 @@ { "comment_text": "", "digests": { - "md5": "b78b96636d68ac581c0e2f38158c224f", - "sha256": "3ef3092145e9b70e3ddd2c7ad59bdd0252a94dfe3949721633e41344de00a6bf" + "md5": "406a166b8ce8df5790f7689ad45d201e", + "sha256": "e6c07f136ba90afc1b049d7577b4f955845d796f359324662758f403929fd481" }, "downloads": -1, "filename": "PyYAML-3.13.tar.gz", "has_sig": false, - "md5_digest": "b78b96636d68ac581c0e2f38158c224f", + "md5_digest": "406a166b8ce8df5790f7689ad45d201e", "packagetype": "sdist", "python_version": "source", "requires_python": null, diff --git a/tests/repositories/fixtures/pypi.org/json/requests.json b/tests/repositories/fixtures/pypi.org/json/requests.json index da008f1ff71..f8f42777276 100644 --- a/tests/repositories/fixtures/pypi.org/json/requests.json +++ b/tests/repositories/fixtures/pypi.org/json/requests.json @@ -1117,16 +1117,16 @@ "filename": "requests-2.18.4-py2.py3-none-any.whl", "url": "https://files.pythonhosted.org/packages/49/df/50aa1999ab9bde74656c2919d9c0c085fd2b3775fd3eca826012bef76d8c/requests-2.18.4-py2.py3-none-any.whl", "hashes": { - "md5": "eb9be71cc41fd73a51a7c9cd1adde5de", - "sha256": "6a1b267aa90cac58ac3a765d067950e7dbbf75b1da07e895d1f594193a40a38b" + "md5": "f392c0ab49bf677c6240ef2b1890b079", + "sha256": "ce91d39dc2857eeb19fc8bf765df6c14874bcdc724d3ce9c6cd89915618e7023" } }, { "filename": "requests-2.18.4.tar.gz", "url": "https://files.pythonhosted.org/packages/b0/e1/eab4fc3752e3d240468a8c0b284607899d2fbfb236a56b7377a329aa8d09/requests-2.18.4.tar.gz", "hashes": { - "md5": "081412b2ef79bdc48229891af13f4d82", - "sha256": "9c443e7324ba5b85070c4a818ade28bfabedf16ea10206da1132edaa6dda237e" + "md5": "942a6a383dc94da90cf58f5adcf028a4", + "sha256": "ec62f7e0e9d4814656b0172dbd592fea06127c6556ff5651eb5d2c8768671fd4" } }, { diff --git a/tests/repositories/fixtures/pypi.org/json/requests/2.18.4.json b/tests/repositories/fixtures/pypi.org/json/requests/2.18.4.json index 10671406459..411f1dae48a 100644 --- a/tests/repositories/fixtures/pypi.org/json/requests/2.18.4.json +++ b/tests/repositories/fixtures/pypi.org/json/requests/2.18.4.json @@ -54,13 +54,13 @@ { "comment_text": "", "digests": { - "md5": "eb9be71cc41fd73a51a7c9cd1adde5de", - "sha256": "6a1b267aa90cac58ac3a765d067950e7dbbf75b1da07e895d1f594193a40a38b" + "md5": "f392c0ab49bf677c6240ef2b1890b079", + "sha256": "ce91d39dc2857eeb19fc8bf765df6c14874bcdc724d3ce9c6cd89915618e7023" }, "downloads": -1, "filename": "requests-2.18.4-py2.py3-none-any.whl", "has_sig": true, - "md5_digest": "eb9be71cc41fd73a51a7c9cd1adde5de", + "md5_digest": "f392c0ab49bf677c6240ef2b1890b079", "packagetype": "bdist_wheel", "python_version": "py2.py3", "size": 88704, @@ -70,13 +70,13 @@ { "comment_text": "", "digests": { - "md5": "081412b2ef79bdc48229891af13f4d82", - "sha256": "9c443e7324ba5b85070c4a818ade28bfabedf16ea10206da1132edaa6dda237e" + "md5": "942a6a383dc94da90cf58f5adcf028a4", + "sha256": "ec62f7e0e9d4814656b0172dbd592fea06127c6556ff5651eb5d2c8768671fd4" }, "downloads": -1, "filename": "requests-2.18.4.tar.gz", "has_sig": true, - "md5_digest": "081412b2ef79bdc48229891af13f4d82", + "md5_digest": "942a6a383dc94da90cf58f5adcf028a4", "packagetype": "sdist", "python_version": "source", "size": 126224, diff --git a/tests/repositories/fixtures/pypi.org/json/setuptools.json b/tests/repositories/fixtures/pypi.org/json/setuptools.json index 24858bd11b8..16a276a1296 100644 --- a/tests/repositories/fixtures/pypi.org/json/setuptools.json +++ b/tests/repositories/fixtures/pypi.org/json/setuptools.json @@ -5,33 +5,23 @@ "filename": "setuptools-39.2.0-py2.py3-none-any.whl", "url": "https://files.pythonhosted.org/packages/7f/e1/820d941153923aac1d49d7fc37e17b6e73bfbd2904959fffbad77900cf92/setuptools-39.2.0-py2.py3-none-any.whl", "hashes": { - "md5": "8d066d2201311ed30be535b473e32fed", - "sha256": "8fca9275c89964f13da985c3656cb00ba029d7f3916b37990927ffdf264e7926" + "md5": "bac10a56787c677a8850f0a2325892de", + "sha256": "9c2959b23011edc14cd3f18dc21d4bcd9702db8a47e0c02f4796aaccb5571a4b" } }, { "filename": "setuptools-39.2.0.zip", "url": "https://files.pythonhosted.org/packages/1a/04/d6f1159feaccdfc508517dba1929eb93a2854de729fa68da9d5c6b48fa00/setuptools-39.2.0.zip", "hashes": { - "md5": "dd4e3fa83a21bf7bf9c51026dc8a4e59", - "sha256": "f7cddbb5f5c640311eb00eab6e849f7701fa70bf6a183fc8a2c33dd1d1672fb2" + "md5": "520b72f2ed79f0854d2d757a890289f4", + "sha256": "63a8deff51e99dd78fcabf4ce58739851ff9726e8ea2d3848f43f3aa365bb459" } }, - { - "filename": "setuptools-67.6.1-py3-none-any.whl", - "hashes": { - "sha256": "e728ca814a823bf7bf60162daf9db95b93d532948c4c0bea762ce62f60189078" - }, - "requires-python": ">=3.7", - "size": 1089263, - "upload-time": "2023-03-28T13:45:43.525946Z", - "url": "https://files.pythonhosted.org/packages/0b/fc/8781442def77b0aa22f63f266d4dadd486ebc0c5371d6290caf4320da4b7/setuptools-67.6.1-py3-none-any.whl", - "yanked": false - }, { "filename": "setuptools-67.6.1.tar.gz", "hashes": { - "sha256": "257de92a9d50a60b8e22abfcbb771571fde0dbf3ec234463212027a4eeecbe9a" + "md5": "ee2562f783544d1f95022c906dd3cf98", + "sha256": "a737d365c957dd3fced9ddd246118e95dce7a62c3dc49f37e7fdd9e93475d785" }, "requires-python": ">=3.7", "size": 2486256, diff --git a/tests/repositories/fixtures/pypi.org/json/setuptools/39.2.0.json b/tests/repositories/fixtures/pypi.org/json/setuptools/39.2.0.json index d1a633083a0..acf8b7ec42f 100644 --- a/tests/repositories/fixtures/pypi.org/json/setuptools/39.2.0.json +++ b/tests/repositories/fixtures/pypi.org/json/setuptools/39.2.0.json @@ -20,7 +20,7 @@ "Topic :: System :: Systems Administration", "Topic :: Utilities" ], - "description": ".. image:: https://img.shields.io/pypi/v/setuptools.svg\n :target: https://pypi.org/project/setuptools\n\n.. image:: https://readthedocs.org/projects/setuptools/badge/?version=latest\n :target: https://setuptools.readthedocs.io\n\n.. image:: https://img.shields.io/travis/pypa/setuptools/master.svg?label=Linux%20build%20%40%20Travis%20CI\n :target: https://travis-ci.org/pypa/setuptools\n\n.. image:: https://img.shields.io/appveyor/ci/pypa/setuptools/master.svg?label=Windows%20build%20%40%20Appveyor\n :target: https://ci.appveyor.com/project/pypa/setuptools/branch/master\n\n.. image:: https://img.shields.io/codecov/c/github/pypa/setuptools/master.svg\n :target: https://codecov.io/gh/pypa/setuptools\n\n.. image:: https://img.shields.io/pypi/pyversions/setuptools.svg\n\nSee the `Installation Instructions\n`_ in the Python Packaging\nUser's Guide for instructions on installing, upgrading, and uninstalling\nSetuptools.\n\nThe project is `maintained at GitHub `_.\n\nQuestions and comments should be directed to the `distutils-sig\nmailing list `_.\nBug reports and especially tested patches may be\nsubmitted directly to the `bug tracker\n`_.\n\n\nCode of Conduct\n---------------\n\nEveryone interacting in the setuptools project's codebases, issue trackers,\nchat rooms, and mailing lists is expected to follow the\n`PyPA Code of Conduct `_.\n\n\n", + "description": "", "description_content_type": "text/x-rst; charset=UTF-8", "docs_url": null, "download_url": "", @@ -58,13 +58,13 @@ { "comment_text": "", "digests": { - "md5": "8d066d2201311ed30be535b473e32fed", - "sha256": "8fca9275c89964f13da985c3656cb00ba029d7f3916b37990927ffdf264e7926" + "md5": "bac10a56787c677a8850f0a2325892de", + "sha256": "9c2959b23011edc14cd3f18dc21d4bcd9702db8a47e0c02f4796aaccb5571a4b" }, "downloads": -1, "filename": "setuptools-39.2.0-py2.py3-none-any.whl", "has_sig": false, - "md5_digest": "8d066d2201311ed30be535b473e32fed", + "md5_digest": "bac10a56787c677a8850f0a2325892de", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*", @@ -78,13 +78,13 @@ { "comment_text": "", "digests": { - "md5": "dd4e3fa83a21bf7bf9c51026dc8a4e59", - "sha256": "f7cddbb5f5c640311eb00eab6e849f7701fa70bf6a183fc8a2c33dd1d1672fb2" + "md5": "8954553fcbf9f3619242215c18f18038", + "sha256": "ea495c0cf868d748cfa418fa7a1a5fa4f6884184a071a95c3fb661bff591488b" }, "downloads": -1, "filename": "setuptools-39.2.0.zip", "has_sig": false, - "md5_digest": "dd4e3fa83a21bf7bf9c51026dc8a4e59", + "md5_digest": "8954553fcbf9f3619242215c18f18038", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*", diff --git a/tests/repositories/fixtures/pypi.org/json/setuptools/67.6.1.json b/tests/repositories/fixtures/pypi.org/json/setuptools/67.6.1.json index 7a2c4192756..0fa24749ed9 100644 --- a/tests/repositories/fixtures/pypi.org/json/setuptools/67.6.1.json +++ b/tests/repositories/fixtures/pypi.org/json/setuptools/67.6.1.json @@ -14,7 +14,7 @@ "Topic :: System :: Systems Administration", "Topic :: Utilities" ], - "description": ".. image:: https://img.shields.io/pypi/v/setuptools.svg\n :target: https://pypi.org/project/setuptools\n\n.. image:: https://img.shields.io/pypi/pyversions/setuptools.svg\n\n.. image:: https://github.com/pypa/setuptools/workflows/tests/badge.svg\n :target: https://github.com/pypa/setuptools/actions?query=workflow%3A%22tests%22\n :alt: tests\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/psf/black\n :alt: Code style: Black\n\n.. image:: https://img.shields.io/readthedocs/setuptools/latest.svg\n :target: https://setuptools.pypa.io\n\n.. image:: https://img.shields.io/badge/skeleton-2023-informational\n :target: https://blog.jaraco.com/skeleton\n\n.. image:: https://img.shields.io/codecov/c/github/pypa/setuptools/master.svg?logo=codecov&logoColor=white\n :target: https://codecov.io/gh/pypa/setuptools\n\n.. image:: https://tidelift.com/badges/github/pypa/setuptools?style=flat\n :target: https://tidelift.com/subscription/pkg/pypi-setuptools?utm_source=pypi-setuptools&utm_medium=readme\n\n.. image:: https://img.shields.io/discord/803025117553754132\n :target: https://discord.com/channels/803025117553754132/815945031150993468\n :alt: Discord\n\nSee the `Installation Instructions\n`_ in the Python Packaging\nUser's Guide for instructions on installing, upgrading, and uninstalling\nSetuptools.\n\nQuestions and comments should be directed to `GitHub Discussions\n`_.\nBug reports and especially tested patches may be\nsubmitted directly to the `bug tracker\n`_.\n\n\nCode of Conduct\n===============\n\nEveryone interacting in the setuptools project's codebases, issue trackers,\nchat rooms, and fora is expected to follow the\n`PSF Code of Conduct `_.\n\n\nFor Enterprise\n==============\n\nAvailable as part of the Tidelift Subscription.\n\nSetuptools and the maintainers of thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use.\n\n`Learn more `_.\n\n\nSecurity Contact\n================\n\nTo report a security vulnerability, please use the\n`Tidelift security contact `_.\nTidelift will coordinate the fix and disclosure.\n", + "description": "", "description_content_type": "", "docs_url": null, "download_url": "", @@ -96,7 +96,6 @@ { "comment_text": "", "digests": { - "blake2b_256": "0bfc8781442def77b0aa22f63f266d4dadd486ebc0c5371d6290caf4320da4b7", "md5": "3b5b846e000da033d54eeaaf7915126e", "sha256": "e728ca814a823bf7bf60162daf9db95b93d532948c4c0bea762ce62f60189078" }, @@ -117,14 +116,13 @@ { "comment_text": "", "digests": { - "blake2b_256": "cb4622ec35f286a77e6b94adf81b4f0d59f402ed981d4251df0ba7b992299146", - "md5": "a661b7cdf4cf1e914f866506c1022dee", - "sha256": "257de92a9d50a60b8e22abfcbb771571fde0dbf3ec234463212027a4eeecbe9a" + "md5": "ee2562f783544d1f95022c906dd3cf98", + "sha256": "a737d365c957dd3fced9ddd246118e95dce7a62c3dc49f37e7fdd9e93475d785" }, "downloads": -1, "filename": "setuptools-67.6.1.tar.gz", "has_sig": false, - "md5_digest": "a661b7cdf4cf1e914f866506c1022dee", + "md5_digest": "ee2562f783544d1f95022c906dd3cf98", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", diff --git a/tests/repositories/fixtures/pypi.org/json/six.json b/tests/repositories/fixtures/pypi.org/json/six.json index d9a68816144..c31f23a2298 100644 --- a/tests/repositories/fixtures/pypi.org/json/six.json +++ b/tests/repositories/fixtures/pypi.org/json/six.json @@ -5,16 +5,16 @@ "filename": "six-1.11.0-py2.py3-none-any.whl", "url": "https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl", "hashes": { - "md5": "866ab722be6bdfed6830f3179af65468", - "sha256": "832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" + "md5": "35b1057b388e276352d0709138b1e194", + "sha256": "112f5b46e6aa106db3e4e2494a03694c938f41c4c4535edbdfc816c2e0cb50f2" } }, { "filename": "six-1.11.0.tar.gz", "url": "https://files.pythonhosted.org/packages/16/d8/bc6316cf98419719bd59c91742194c111b6f2e85abac88e496adefaf7afe/six-1.11.0.tar.gz", "hashes": { - "md5": "d12789f9baf7e9fb2524c0c64f1773f8", - "sha256": "70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9" + "md5": "25d3568604f921dd23532b88a0ce17e7", + "sha256": "268a4ccb159c1a2d2c79336b02e75058387b0cdbb4cea2f07846a758f48a356d" } } ], diff --git a/tests/repositories/fixtures/pypi.org/json/six/1.11.0.json b/tests/repositories/fixtures/pypi.org/json/six/1.11.0.json index d6cd82526d0..38cb1e49a45 100644 --- a/tests/repositories/fixtures/pypi.org/json/six/1.11.0.json +++ b/tests/repositories/fixtures/pypi.org/json/six/1.11.0.json @@ -39,13 +39,13 @@ { "comment_text": "", "digests": { - "md5": "866ab722be6bdfed6830f3179af65468", - "sha256": "832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" + "md5": "35b1057b388e276352d0709138b1e194", + "sha256": "112f5b46e6aa106db3e4e2494a03694c938f41c4c4535edbdfc816c2e0cb50f2" }, "downloads": -1, "filename": "six-1.11.0-py2.py3-none-any.whl", "has_sig": false, - "md5_digest": "866ab722be6bdfed6830f3179af65468", + "md5_digest": "35b1057b388e276352d0709138b1e194", "packagetype": "bdist_wheel", "python_version": "py2.py3", "size": 10702, @@ -55,13 +55,13 @@ { "comment_text": "", "digests": { - "md5": "d12789f9baf7e9fb2524c0c64f1773f8", - "sha256": "70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9" + "md5": "25d3568604f921dd23532b88a0ce17e7", + "sha256": "268a4ccb159c1a2d2c79336b02e75058387b0cdbb4cea2f07846a758f48a356d" }, "downloads": -1, "filename": "six-1.11.0.tar.gz", "has_sig": false, - "md5_digest": "d12789f9baf7e9fb2524c0c64f1773f8", + "md5_digest": "25d3568604f921dd23532b88a0ce17e7", "packagetype": "sdist", "python_version": "source", "size": 29860, diff --git a/tests/repositories/fixtures/pypi.org/json/sqlalchemy.json b/tests/repositories/fixtures/pypi.org/json/sqlalchemy.json index 0289daea947..ce3166a912e 100644 --- a/tests/repositories/fixtures/pypi.org/json/sqlalchemy.json +++ b/tests/repositories/fixtures/pypi.org/json/sqlalchemy.json @@ -5,8 +5,8 @@ "filename": "SQLAlchemy-1.2.12.tar.gz", "url": "https://files.pythonhosted.org/packages/25/c9/b0552098cee325425a61efdf380c51b5c721e459081c85bbb860f501c091/SQLAlchemy-1.2.12.tar.gz", "hashes": { - "md5": "3baca105a1e49798d6bc99eb2738cb3b", - "sha256": "c5951d9ef1d5404ed04bae5a16b60a0779087378928f997a294d1229c6ca4d3e" + "md5": "4a2617b5254748828d09349fc4eff6bd", + "sha256": "b5a127599b3f27847fba6119de0fcb70832a8041b103701a708b7c7d044faa38" } } ], diff --git a/tests/repositories/fixtures/pypi.org/json/sqlalchemy/1.2.12.json b/tests/repositories/fixtures/pypi.org/json/sqlalchemy/1.2.12.json index a927ce1deb7..359c3e8aa59 100644 --- a/tests/repositories/fixtures/pypi.org/json/sqlalchemy/1.2.12.json +++ b/tests/repositories/fixtures/pypi.org/json/sqlalchemy/1.2.12.json @@ -14,7 +14,7 @@ "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Database :: Front-Ends" ], - "description": "SQLAlchemy\n==========\n\nThe Python SQL Toolkit and Object Relational Mapper\n\nIntroduction\n-------------\n\nSQLAlchemy is the Python SQL toolkit and Object Relational Mapper\nthat gives application developers the full power and\nflexibility of SQL. SQLAlchemy provides a full suite\nof well known enterprise-level persistence patterns,\ndesigned for efficient and high-performing database\naccess, adapted into a simple and Pythonic domain\nlanguage.\n\nMajor SQLAlchemy features include:\n\n* An industrial strength ORM, built \n from the core on the identity map, unit of work,\n and data mapper patterns. These patterns\n allow transparent persistence of objects \n using a declarative configuration system.\n Domain models\n can be constructed and manipulated naturally,\n and changes are synchronized with the\n current transaction automatically.\n* A relationally-oriented query system, exposing\n the full range of SQL's capabilities \n explicitly, including joins, subqueries, \n correlation, and most everything else, \n in terms of the object model.\n Writing queries with the ORM uses the same \n techniques of relational composition you use \n when writing SQL. While you can drop into\n literal SQL at any time, it's virtually never\n needed.\n* A comprehensive and flexible system \n of eager loading for related collections and objects.\n Collections are cached within a session,\n and can be loaded on individual access, all \n at once using joins, or by query per collection\n across the full result set.\n* A Core SQL construction system and DBAPI \n interaction layer. The SQLAlchemy Core is\n separate from the ORM and is a full database\n abstraction layer in its own right, and includes\n an extensible Python-based SQL expression \n language, schema metadata, connection pooling, \n type coercion, and custom types.\n* All primary and foreign key constraints are \n assumed to be composite and natural. Surrogate\n integer primary keys are of course still the \n norm, but SQLAlchemy never assumes or hardcodes\n to this model.\n* Database introspection and generation. Database\n schemas can be \"reflected\" in one step into\n Python structures representing database metadata;\n those same structures can then generate \n CREATE statements right back out - all within\n the Core, independent of the ORM.\n\nSQLAlchemy's philosophy:\n\n* SQL databases behave less and less like object\n collections the more size and performance start to\n matter; object collections behave less and less like\n tables and rows the more abstraction starts to matter.\n SQLAlchemy aims to accommodate both of these\n principles.\n* An ORM doesn't need to hide the \"R\". A relational\n database provides rich, set-based functionality\n that should be fully exposed. SQLAlchemy's\n ORM provides an open-ended set of patterns\n that allow a developer to construct a custom\n mediation layer between a domain model and \n a relational schema, turning the so-called\n \"object relational impedance\" issue into\n a distant memory.\n* The developer, in all cases, makes all decisions\n regarding the design, structure, and naming conventions\n of both the object model as well as the relational\n schema. SQLAlchemy only provides the means\n to automate the execution of these decisions.\n* With SQLAlchemy, there's no such thing as \n \"the ORM generated a bad query\" - you \n retain full control over the structure of \n queries, including how joins are organized,\n how subqueries and correlation is used, what \n columns are requested. Everything SQLAlchemy\n does is ultimately the result of a developer-\n initiated decision.\n* Don't use an ORM if the problem doesn't need one.\n SQLAlchemy consists of a Core and separate ORM\n component. The Core offers a full SQL expression\n language that allows Pythonic construction \n of SQL constructs that render directly to SQL\n strings for a target database, returning\n result sets that are essentially enhanced DBAPI\n cursors.\n* Transactions should be the norm. With SQLAlchemy's\n ORM, nothing goes to permanent storage until\n commit() is called. SQLAlchemy encourages applications\n to create a consistent means of delineating\n the start and end of a series of operations.\n* Never render a literal value in a SQL statement.\n Bound parameters are used to the greatest degree\n possible, allowing query optimizers to cache \n query plans effectively and making SQL injection\n attacks a non-issue.\n\nDocumentation\n-------------\n\nLatest documentation is at:\n\nhttp://www.sqlalchemy.org/docs/\n\nInstallation / Requirements\n---------------------------\n\nFull documentation for installation is at \n`Installation `_.\n\nGetting Help / Development / Bug reporting\n------------------------------------------\n\nPlease refer to the `SQLAlchemy Community Guide `_.\n\nLicense\n-------\n\nSQLAlchemy is distributed under the `MIT license\n`_.", + "description": "", "description_content_type": "", "docs_url": null, "download_url": "", @@ -48,13 +48,13 @@ { "comment_text": "", "digests": { - "md5": "3baca105a1e49798d6bc99eb2738cb3b", - "sha256": "c5951d9ef1d5404ed04bae5a16b60a0779087378928f997a294d1229c6ca4d3e" + "md5": "4a2617b5254748828d09349fc4eff6bd", + "sha256": "b5a127599b3f27847fba6119de0fcb70832a8041b103701a708b7c7d044faa38" }, "downloads": -1, "filename": "SQLAlchemy-1.2.12.tar.gz", "has_sig": true, - "md5_digest": "3baca105a1e49798d6bc99eb2738cb3b", + "md5_digest": "4a2617b5254748828d09349fc4eff6bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, @@ -66,58 +66,5 @@ "yanked_reason": null } ], - "vulnerabilities": [ - { - "aliases": [ - "CVE-2019-7548" - ], - "details": "SQLAlchemy 1.2.17 has SQL Injection when the group_by parameter can be controlled.", - "fixed_in": [ - "1.2.18" - ], - "id": "PYSEC-2019-124", - "link": "https://osv.dev/vulnerability/PYSEC-2019-124", - "source": "osv", - "summary": null - }, - { - "aliases": [ - "CVE-2019-7164" - ], - "details": "SQLAlchemy through 1.2.17 and 1.3.x through 1.3.0b2 allows SQL Injection via the order_by parameter.", - "fixed_in": [ - "1.2.18" - ], - "id": "PYSEC-2019-123", - "link": "https://osv.dev/vulnerability/PYSEC-2019-123", - "source": "osv", - "summary": null - }, - { - "aliases": [ - "CVE-2019-7548" - ], - "details": "SQLAlchemy 1.2.17 has SQL Injection when the group_by parameter can be controlled.", - "fixed_in": [ - "1.3.0" - ], - "id": "GHSA-38fc-9xqv-7f7q", - "link": "https://osv.dev/vulnerability/GHSA-38fc-9xqv-7f7q", - "source": "osv", - "summary": null - }, - { - "aliases": [ - "CVE-2019-7164" - ], - "details": "SQLAlchemy through 1.2.17 and 1.3.x through 1.3.0b2 allows SQL Injection via the order_by parameter.", - "fixed_in": [ - "1.3.0" - ], - "id": "GHSA-887w-45rq-vxgf", - "link": "https://osv.dev/vulnerability/GHSA-887w-45rq-vxgf", - "source": "osv", - "summary": null - } - ] + "vulnerabilities": [] } diff --git a/tests/repositories/fixtures/pypi.org/json/tomlkit.json b/tests/repositories/fixtures/pypi.org/json/tomlkit.json index 80dd31f293c..0eb7e1caed8 100644 --- a/tests/repositories/fixtures/pypi.org/json/tomlkit.json +++ b/tests/repositories/fixtures/pypi.org/json/tomlkit.json @@ -5,8 +5,8 @@ "filename": "tomlkit-0.5.2-py2.py3-none-any.whl", "url": "https://files.pythonhosted.org/packages/9b/ca/8b60a94c01ee655ffb81d11c11396cb6fff89459317aa1fe3e98ee80f055/tomlkit-0.5.2-py2.py3-none-any.whl", "hashes": { - "md5": "7a7ef7c16a0e9b374933c116a7bb2f9f", - "sha256": "82a8fbb8d8c6af72e96ba00b9db3e20ef61be6c79082552c9363f4559702258b" + "md5": "7bcf6cf4a6034339bb6a481f27b9ba62", + "sha256": "a50f685abd033a7b50b13330833c15699885186517b713d9f7e8280ce7976e4c" }, "requires-python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" }, @@ -14,8 +14,8 @@ "filename": "tomlkit-0.5.2.tar.gz", "url": "https://files.pythonhosted.org/packages/f6/8c/c27d292cf7c0f04f0e1b5c75ab95dc328542ccbe9a809a1eada66c897bd2/tomlkit-0.5.2.tar.gz", "hashes": { - "md5": "7abb629acee08fd77bafe858f4706f47", - "sha256": "a43e0195edc9b3c198cd4b5f0f3d427a395d47c4a76ceba7cc875ed030756c39" + "md5": "7c31987ef6fba2cd64715cae27fade64", + "sha256": "4a226ccf11ee5a2e76bfc185747b54ee7718706aeb3aabb981327249dbe2b1d4" }, "requires-python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" }, @@ -23,8 +23,8 @@ "filename": "tomlkit-0.5.3-py2.py3-none-any.whl", "url": "https://files.pythonhosted.org/packages/71/c6/06c014b92cc48270765d6a9418d82239b158d8a9b69e031b0e2c6598740b/tomlkit-0.5.3-py2.py3-none-any.whl", "hashes": { - "md5": "0a6cf417df5d0fc911f89447c9a662a9", - "sha256": "f077456d35303e7908cc233b340f71e0bec96f63429997f38ca9272b7d64029e" + "md5": "b868779f054c64bc6c2ae4ad2cdbf6b3", + "sha256": "d4fe74be9b732d76886da6da2e96f76ae42551e53afce1ea29bc703629b70497" }, "requires-python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" }, @@ -32,8 +32,8 @@ "filename": "tomlkit-0.5.3.tar.gz", "url": "https://files.pythonhosted.org/packages/f7/f7/bbd9213bfe76cb7821c897f9ed74877fd74993b4ca2fe9513eb5a31030f9/tomlkit-0.5.3.tar.gz", "hashes": { - "md5": "a708470b53d689013f2fc9f0a7902adf", - "sha256": "d6506342615d051bc961f70bfcfa3d29b6616cc08a3ddfd4bc24196f16fd4ec2" + "md5": "cdbdc302a184d1f1e38d5e0810e3b212", + "sha256": "e2f785651609492c771d9887ccb2369d891d16595d2d97972e2cbe5e8fb3439f" }, "requires-python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" } diff --git a/tests/repositories/fixtures/pypi.org/json/tomlkit/0.5.2.json b/tests/repositories/fixtures/pypi.org/json/tomlkit/0.5.2.json new file mode 100644 index 00000000000..5cad22da7ee --- /dev/null +++ b/tests/repositories/fixtures/pypi.org/json/tomlkit/0.5.2.json @@ -0,0 +1,96 @@ +{ + "info": { + "author": "Sébastien Eustace", + "author_email": "sebastien@eustace.io", + "bugtrack_url": null, + "classifiers": [ + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7" + ], + "description": "", + "description_content_type": "text/markdown", + "docs_url": null, + "download_url": "", + "downloads": { + "last_day": -1, + "last_month": -1, + "last_week": -1 + }, + "dynamic": null, + "home_page": "https://github.com/sdispater/tomlkit", + "keywords": "", + "license": "MIT", + "maintainer": "Sébastien Eustace", + "maintainer_email": "sebastien@eustace.io", + "name": "tomlkit", + "package_url": "https://pypi.org/project/tomlkit/", + "platform": "", + "project_url": "https://pypi.org/project/tomlkit/", + "project_urls": { + "Homepage": "https://github.com/sdispater/tomlkit", + "Repository": "https://github.com/sdispater/tomlkit" + }, + "provides_extra": null, + "release_url": "https://pypi.org/project/tomlkit/0.5.2/", + "requires_dist": [ + "enum34 (>=1.1,<2.0); python_version >= \"2.7\" and python_version < \"2.8\"", + "functools32 (>=3.2.3,<4.0.0); python_version >= \"2.7\" and python_version < \"2.8\"", + "typing (>=3.6,<4.0); python_version >= \"2.7\" and python_version < \"2.8\" or python_version >= \"3.4\" and python_version < \"3.5\"" + ], + "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", + "summary": "Style preserving TOML library", + "version": "0.5.2", + "yanked": false, + "yanked_reason": null + }, + "last_serial": 22053651, + "urls": [ + { + "comment_text": "", + "digests": { + "md5": "7bcf6cf4a6034339bb6a481f27b9ba62", + "sha256": "a50f685abd033a7b50b13330833c15699885186517b713d9f7e8280ce7976e4c" + }, + "downloads": -1, + "filename": "tomlkit-0.5.2-py2.py3-none-any.whl", + "has_sig": false, + "md5_digest": "7bcf6cf4a6034339bb6a481f27b9ba62", + "packagetype": "bdist_wheel", + "python_version": "py2.py3", + "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", + "size": 116499, + "upload_time": "2018-11-09T17:09:28", + "upload_time_iso_8601": "2018-11-09T17:09:28.212157Z", + "url": "https://files.pythonhosted.org/packages/9b/ca/8b60a94c01ee655ffb81d11c11396cb6fff89459317aa1fe3e98ee80f055/tomlkit-0.5.2-py2.py3-none-any.whl", + "yanked": false, + "yanked_reason": null + }, + { + "comment_text": "", + "digests": { + "md5": "7c31987ef6fba2cd64715cae27fade64", + "sha256": "4a226ccf11ee5a2e76bfc185747b54ee7718706aeb3aabb981327249dbe2b1d4" + }, + "downloads": -1, + "filename": "tomlkit-0.5.2.tar.gz", + "has_sig": false, + "md5_digest": "7c31987ef6fba2cd64715cae27fade64", + "packagetype": "sdist", + "python_version": "source", + "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", + "size": 29813, + "upload_time": "2018-11-09T17:09:29", + "upload_time_iso_8601": "2018-11-09T17:09:29.709061Z", + "url": "https://files.pythonhosted.org/packages/f6/8c/c27d292cf7c0f04f0e1b5c75ab95dc328542ccbe9a809a1eada66c897bd2/tomlkit-0.5.2.tar.gz", + "yanked": false, + "yanked_reason": null + } + ], + "vulnerabilities": [] +} diff --git a/tests/repositories/fixtures/pypi.org/json/tomlkit/0.5.3.json b/tests/repositories/fixtures/pypi.org/json/tomlkit/0.5.3.json index 4c27df88765..1b1cac648e6 100644 --- a/tests/repositories/fixtures/pypi.org/json/tomlkit/0.5.3.json +++ b/tests/repositories/fixtures/pypi.org/json/tomlkit/0.5.3.json @@ -13,7 +13,7 @@ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], - "description": "[github_release]: https://img.shields.io/github/release/sdispater/tomlkit.svg?logo=github&logoColor=white\n[pypi_version]: https://img.shields.io/pypi/v/tomlkit.svg?logo=python&logoColor=white\n[python_versions]: https://img.shields.io/pypi/pyversions/tomlkit.svg?logo=python&logoColor=white\n[github_license]: https://img.shields.io/github/license/sdispater/tomlkit.svg?logo=github&logoColor=white\n[travisci]: https://img.shields.io/travis/com/sdispater/tomlkit/master.svg?logo=travis&logoColor=white&label=Travis%20CI\n[appveyor]: https://img.shields.io/appveyor/ci/sdispater/tomlkit/master.svg?logo=appveyor&logoColor=white&label=AppVeyor\n\n[codecov]: https://img.shields.io/codecov/c/github/sdispater/tomlkit/master.svg?logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNDgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CgogPGc+CiAgPHRpdGxlPmJhY2tncm91bmQ8L3RpdGxlPgogIDxyZWN0IGZpbGw9Im5vbmUiIGlkPSJjYW52YXNfYmFja2dyb3VuZCIgaGVpZ2h0PSI0MDIiIHdpZHRoPSI1ODIiIHk9Ii0xIiB4PSItMSIvPgogPC9nPgogPGc+CiAgPHRpdGxlPkxheWVyIDE8L3RpdGxlPgogIDxwYXRoIGlkPSJzdmdfMSIgZmlsbC1ydWxlPSJldmVub2RkIiBmaWxsPSIjZmZmZmZmIiBkPSJtMjUuMDE0LDBjLTEzLjc4NCwwLjAxIC0yNS4wMDQsMTEuMTQ5IC0yNS4wMTQsMjQuODMybDAsMC4wNjJsNC4yNTQsMi40ODJsMC4wNTgsLTAuMDM5YTEyLjIzOCwxMi4yMzggMCAwIDEgOS4wNzgsLTEuOTI4YTExLjg0NCwxMS44NDQgMCAwIDEgNS45OCwyLjk3NWwwLjczLDAuNjhsMC40MTMsLTAuOTA0YzAuNCwtMC44NzQgMC44NjIsLTEuNjk2IDEuMzc0LC0yLjQ0M2MwLjIwNiwtMC4zIDAuNDMzLC0wLjYwNCAwLjY5MiwtMC45MjlsMC40MjcsLTAuNTM1bC0wLjUyNiwtMC40NGExNy40NSwxNy40NSAwIDAgMCAtOC4xLC0zLjc4MWExNy44NTMsMTcuODUzIDAgMCAwIC04LjM3NSwwLjQ5YzIuMDIzLC04Ljg2OCA5LjgyLC0xNS4wNSAxOS4wMjcsLTE1LjA1N2M1LjE5NSwwIDEwLjA3OCwyLjAwNyAxMy43NTIsNS42NTJjMi42MTksMi41OTggNC40MjIsNS44MzUgNS4yMjQsOS4zNzJhMTcuOTA4LDE3LjkwOCAwIDAgMCAtNS4yMDgsLTAuNzlsLTAuMzE4LC0wLjAwMWExOC4wOTYsMTguMDk2IDAgMCAwIC0yLjA2NywwLjE1M2wtMC4wODcsMC4wMTJjLTAuMzAzLDAuMDQgLTAuNTcsMC4wODEgLTAuODEzLDAuMTI2Yy0wLjExOSwwLjAyIC0wLjIzNywwLjA0NSAtMC4zNTUsMC4wNjhjLTAuMjgsMC4wNTcgLTAuNTU0LDAuMTE5IC0wLjgxNiwwLjE4NWwtMC4yODgsMC4wNzNjLTAuMzM2LDAuMDkgLTAuNjc1LDAuMTkxIC0xLjAwNiwwLjNsLTAuMDYxLDAuMDJjLTAuNzQsMC4yNTEgLTEuNDc4LDAuNTU4IC0yLjE5LDAuOTE0bC0wLjA1NywwLjAyOWMtMC4zMTYsMC4xNTggLTAuNjM2LDAuMzMzIC0wLjk3OCwwLjUzNGwtMC4wNzUsMC4wNDVhMTYuOTcsMTYuOTcgMCAwIDAgLTQuNDE0LDMuNzhsLTAuMTU3LDAuMTkxYy0wLjMxNywwLjM5NCAtMC41NjcsMC43MjcgLTAuNzg3LDEuMDQ4Yy0wLjE4NCwwLjI3IC0wLjM2OSwwLjU2IC0wLjYsMC45NDJsLTAuMTI2LDAuMjE3Yy0wLjE4NCwwLjMxOCAtMC4zNDgsMC42MjIgLTAuNDg3LDAuOWwtMC4wMzMsMC4wNjFjLTAuMzU0LDAuNzExIC0wLjY2MSwxLjQ1NSAtMC45MTcsMi4yMTRsLTAuMDM2LDAuMTExYTE3LjEzLDE3LjEzIDAgMCAwIC0wLjg1NSw1LjY0NGwwLjAwMywwLjIzNGEyMy41NjUsMjMuNTY1IDAgMCAwIDAuMDQzLDAuODIyYzAuMDEsMC4xMyAwLjAyMywwLjI1OSAwLjAzNiwwLjM4OGMwLjAxNSwwLjE1OCAwLjAzNCwwLjMxNiAwLjA1MywwLjQ3MWwwLjAxMSwwLjA4OGwwLjAyOCwwLjIxNGMwLjAzNywwLjI2NCAwLjA4LDAuNTI1IDAuMTMsMC43ODdjMC41MDMsMi42MzcgMS43Niw1LjI3NCAzLjYzNSw3LjYyNWwwLjA4NSwwLjEwNmwwLjA4NywtMC4xMDRjMC43NDgsLTAuODg0IDIuNjAzLC0zLjY4NyAyLjc2LC01LjM2OWwwLjAwMywtMC4wMzFsLTAuMDE1LC0wLjAyOGExMS43MzYsMTEuNzM2IDAgMCAxIC0xLjMzMywtNS40MDdjMCwtNi4yODQgNC45NCwtMTEuNTAyIDExLjI0MywtMTEuODhsMC40MTQsLTAuMDE1YzIuNTYxLC0wLjA1OCA1LjA2NCwwLjY3MyA3LjIzLDIuMTM2bDAuMDU4LDAuMDM5bDQuMTk3LC0yLjQ0bDAuMDU1LC0wLjAzM2wwLC0wLjA2MmMwLjAwNiwtNi42MzIgLTIuNTkyLC0xMi44NjUgLTcuMzE0LC0xNy41NTFjLTQuNzE2LC00LjY3OSAtMTAuOTkxLC03LjI1NSAtMTcuNjcyLC03LjI1NSIvPgogPC9nPgo8L3N2Zz4=&label=Codecov\n\n[![GitHub Release][github_release]](https://github.com/sdispater/tomlkit/releases/)\n[![PyPI Version][pypi_version]](https://pypi.python.org/pypi/tomlkit/)\n[![Python Versions][python_versions]](https://pypi.python.org/pypi/tomlkit/)\n[![License][github_license]](https://github.com/sdispater/tomlkit/blob/master/LICENSE)\n
\n[![Travis CI][travisci]](https://travis-ci.com/sdispater/tomlkit)\n[![AppVeyor][appveyor]](https://ci.appveyor.com/project/sdispater/tomlkit)\n[![Codecov][codecov]](https://codecov.io/gh/sdispater/tomlkit)\n\n# TOML Kit - Style-preserving TOML library for Python\n\nTOML Kit is a **0.5.0-compliant** [TOML](https://github.com/toml-lang/toml) library.\n\nIt includes a parser that preserves all comments, indentations, whitespace and internal element ordering,\nand makes them accessible and editable via an intuitive API.\n\nYou can also create new TOML documents from scratch using the provided helpers.\n\nPart of the implementation as been adapted, improved and fixed from [Molten](https://github.com/LeopoldArkham/Molten).\n\n## Usage\n\n### Parsing\n\nTOML Kit comes with a fast and style-preserving parser to help you access\nthe content of TOML files and strings.\n\n```python\n>>> from tomlkit import dumps\n>>> from tomlkit import parse # you can also use loads\n\n>>> content = \"\"\"[table]\n... foo = \"bar\" # String\n... \"\"\"\n>>> doc = parse(content)\n\n# doc is a TOMLDocument instance that holds all the information\n# about the TOML string.\n# It behaves like a standard dictionary.\n\n>>> assert doc[\"table\"][\"foo\"] == \"bar\"\n\n# The string generated from the document is exactly the same\n# as the original string\n>>> assert dumps(doc) == content\n```\n\n### Modifying\n\nTOML Kit provides an intuitive API to modify TOML documents.\n\n```python\n>>> from tomlkit import dumps\n>>> from tomlkit import parse\n>>> from tomlkit import table\n\n>>> doc = parse(\"\"\"[table]\n... foo = \"bar\" # String\n... \"\"\")\n\n>>> doc[\"table\"][\"baz\"] = 13\n\n>>> dumps(doc)\n\"\"\"[table]\nfoo = \"bar\" # String\nbaz = 13\n\"\"\"\n\n# Add a new table\n>>> tab = table()\n>>> tab.add(\"array\", [1, 2, 3])\n\n>>> doc[\"table2\"] = tab\n\n>>> dumps(doc)\n\"\"\"[table]\nfoo = \"bar\" # String\nbaz = 13\n\n[table2]\narray = [1, 2, 3]\n\"\"\"\n\n# Remove the newly added table\n>>> doc.remove(\"table2\")\n# del doc[\"table2] is also possible\n```\n\n### Writing\n\nYou can also write a new TOML document from scratch.\n\nLet's say we want to create this following document:\n\n```toml\n# This is a TOML document.\n\ntitle = \"TOML Example\"\n\n[owner]\nname = \"Tom Preston-Werner\"\norganization = \"GitHub\"\nbio = \"GitHub Cofounder & CEO\\nLikes tater tots and beer.\"\ndob = 1979-05-27T07:32:00Z # First class dates? Why not?\n\n[database]\nserver = \"192.168.1.1\"\nports = [ 8001, 8001, 8002 ]\nconnection_max = 5000\nenabled = true\n```\n\nIt can be created with the following code:\n\n```python\n>>> from tomlkit import comment\n>>> from tomlkit import document\n>>> from tomlkit import nl\n>>> from tomlkit import table\n\n>>> doc = document()\n>>> doc.add(comment(\"This is a TOML document.\"))\n>>> doc.add(nl())\n>>> doc.add(\"title\", \"TOML Example\")\n# Using doc[\"title\"] = \"TOML Example\" is also possible\n\n>>> owner = table()\n>>> owner.add(\"name\", \"Tom Preston-Werner\")\n>>> owner.add(\"organization\", \"GitHub\")\n>>> owner.add(\"bio\", \"GitHub Cofounder & CEO\\nLikes tater tots and beer.\")\n>>> owner.add(\"dob\", datetime(1979, 5, 27, 7, 32, tzinfo=utc))\n>>> owner[\"dob\"].comment(\"First class dates? Why not?\")\n\n# Adding the table to the document\n>>> doc.add(\"owner\", owner)\n\n>>> database = table()\n>>> database[\"server\"] = \"192.168.1.1\"\n>>> database[\"ports\"] = [8001, 8001, 8002]\n>>> database[\"connection_max\"] = 5000\n>>> database[\"enabled\"] = True\n\n>>> doc[\"database\"] = database\n```\n\n\n## Installation\n\nIf you are using [Poetry](https://poetry.eustace.io),\nadd `tomlkit` to your `pyproject.toml` file by using:\n\n```bash\npoetry add tomlkit\n```\n\nIf not, you can use `pip`:\n\n```bash\npip install tomlkit\n```\n", + "description": "", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", @@ -52,13 +52,13 @@ { "comment_text": "", "digests": { - "md5": "0a6cf417df5d0fc911f89447c9a662a9", - "sha256": "f077456d35303e7908cc233b340f71e0bec96f63429997f38ca9272b7d64029e" + "md5": "b868779f054c64bc6c2ae4ad2cdbf6b3", + "sha256": "d4fe74be9b732d76886da6da2e96f76ae42551e53afce1ea29bc703629b70497" }, "downloads": -1, "filename": "tomlkit-0.5.3-py2.py3-none-any.whl", "has_sig": false, - "md5_digest": "0a6cf417df5d0fc911f89447c9a662a9", + "md5_digest": "b868779f054c64bc6c2ae4ad2cdbf6b3", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", @@ -72,13 +72,13 @@ { "comment_text": "", "digests": { - "md5": "a708470b53d689013f2fc9f0a7902adf", - "sha256": "d6506342615d051bc961f70bfcfa3d29b6616cc08a3ddfd4bc24196f16fd4ec2" + "md5": "cdbdc302a184d1f1e38d5e0810e3b212", + "sha256": "e2f785651609492c771d9887ccb2369d891d16595d2d97972e2cbe5e8fb3439f" }, "downloads": -1, "filename": "tomlkit-0.5.3.tar.gz", "has_sig": false, - "md5_digest": "a708470b53d689013f2fc9f0a7902adf", + "md5_digest": "cdbdc302a184d1f1e38d5e0810e3b212", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", diff --git a/tests/repositories/fixtures/pypi.org/json/trackpy.json b/tests/repositories/fixtures/pypi.org/json/trackpy.json index b961a2ac596..2ad8dd7b900 100644 --- a/tests/repositories/fixtures/pypi.org/json/trackpy.json +++ b/tests/repositories/fixtures/pypi.org/json/trackpy.json @@ -5,16 +5,8 @@ "filename": "trackpy-0.4.1.tar.gz", "url": "https://files.pythonhosted.org/packages/62/31/797febf2ea8ea316c345c1d0f10503c3901f3fca5c3ffdc6e92717efdcad/trackpy-0.4.1.tar.gz", "hashes": { - "md5": "4c92e8b74840f57c6047f56a4a4412c4", - "sha256": "f682f75e99f6c29c65e8531899b957c67d9d5a027b28b44258fa2c4a18e851cd" - } - }, - { - "filename": "trackpy-unknown.tar.gz", - "url": "https://files.pythonhosted.org/packages/35/23/3b6422d3c006251e2ad857f5fe520b193d473154f88d1f27de50798f2c6c/trackpy-unknown.tar.gz", - "hashes": { - "md5": "6a879fe7871bd5c62d41b5a2ed84a5cd", - "sha256": "88fedb53b03451a56422d4ecb393ea6bb043e821b3ee1e6518485b303e3bddf5" + "md5": "0a36455659d70201b8cb329ba9de3c46", + "sha256": "d8512e45935954c8274b547944ff08a2d7e3942a6d53ca2540023034b922aba1" } } ], diff --git a/tests/repositories/fixtures/pypi.org/json/trackpy/0.4.1.json b/tests/repositories/fixtures/pypi.org/json/trackpy/0.4.1.json index 28035cee218..af25256e49e 100644 --- a/tests/repositories/fixtures/pypi.org/json/trackpy/0.4.1.json +++ b/tests/repositories/fixtures/pypi.org/json/trackpy/0.4.1.json @@ -4,7 +4,7 @@ "author_email": "daniel.b.allan@gmail.com", "bugtrack_url": null, "classifiers": [], - "description": "trackpy\n=======\n\n|build status| |Build status| |DOI|\n\nWhat is it?\n-----------\n\n**trackpy** is a Python package for particle tracking in 2D, 3D, and\nhigher dimensions. `**Read the\nwalkthrough** `__\nto skim or study an example project from start to finish.\n\nDocumentation\n-------------\n\n`**Read the documentation** `__\nfor\n\n- an introduction\n- tutorials on the basics, 3D tracking, and much, much more\n- easy `installation\n instructions `__\n- the reference guide\n\nIf you use trackpy for published research, please `cite the\nrelease `__\nboth to credit the contributors, and to direct your readers to the exact\nversion of trackpy they could use to reproduce your results.\n\n.. |build status| image:: https://travis-ci.org/soft-matter/trackpy.png?branch=master\n :target: https://travis-ci.org/soft-matter/trackpy\n.. |Build status| image:: https://ci.appveyor.com/api/projects/status/bc5umcboh3elm8oh?svg=true\n :target: https://ci.appveyor.com/project/caspervdw/trackpy\n.. |DOI| image:: https://zenodo.org/badge/doi/10.5281/zenodo.1213240.svg\n :target: http://dx.doi.org/10.5281/zenodo.1213240", + "description": "", "description_content_type": "", "docs_url": null, "download_url": "", @@ -38,13 +38,13 @@ { "comment_text": "", "digests": { - "md5": "4c92e8b74840f57c6047f56a4a4412c4", - "sha256": "f682f75e99f6c29c65e8531899b957c67d9d5a027b28b44258fa2c4a18e851cd" + "md5": "0a36455659d70201b8cb329ba9de3c46", + "sha256": "d8512e45935954c8274b547944ff08a2d7e3942a6d53ca2540023034b922aba1" }, "downloads": -1, "filename": "trackpy-0.4.1.tar.gz", "has_sig": false, - "md5_digest": "4c92e8b74840f57c6047f56a4a4412c4", + "md5_digest": "0a36455659d70201b8cb329ba9de3c46", "packagetype": "sdist", "python_version": "source", "requires_python": null, diff --git a/tests/repositories/fixtures/pypi.org/json/twisted.json b/tests/repositories/fixtures/pypi.org/json/twisted.json index 18068a6e280..a27bd79922d 100644 --- a/tests/repositories/fixtures/pypi.org/json/twisted.json +++ b/tests/repositories/fixtures/pypi.org/json/twisted.json @@ -5,8 +5,8 @@ "filename": "Twisted-18.9.0.tar.bz2", "url": "https://files.pythonhosted.org/packages/5d/0e/a72d85a55761c2c3ff1cb968143a2fd5f360220779ed90e0fadf4106d4f2/Twisted-18.9.0.tar.bz2", "hashes": { - "md5": "20fe2ec156e6e45b0b0d2ff06d9e828f", - "sha256": "294be2c6bf84ae776df2fc98e7af7d6537e1c5e60a46d33c3ce2a197677da395" + "md5": "35ff4705ea90a76bf972ff3b229546ca", + "sha256": "4335327da58be11dd6e482ec6b85eb055bcc953a9570cd59e7840a2ce9419a8e" } } ], diff --git a/tests/repositories/fixtures/pypi.org/json/twisted/18.9.0.json b/tests/repositories/fixtures/pypi.org/json/twisted/18.9.0.json index 301a4468a09..12f6c39a8d9 100644 --- a/tests/repositories/fixtures/pypi.org/json/twisted/18.9.0.json +++ b/tests/repositories/fixtures/pypi.org/json/twisted/18.9.0.json @@ -11,7 +11,7 @@ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], - "description": "An extensible framework for Python programming, with special focus\non event-based network programming and multiprotocol integration.", + "description": "", "description_content_type": "", "docs_url": null, "download_url": "", @@ -45,13 +45,13 @@ { "comment_text": "", "digests": { - "md5": "20fe2ec156e6e45b0b0d2ff06d9e828f", - "sha256": "294be2c6bf84ae776df2fc98e7af7d6537e1c5e60a46d33c3ce2a197677da395" + "md5": "35ff4705ea90a76bf972ff3b229546ca", + "sha256": "4335327da58be11dd6e482ec6b85eb055bcc953a9570cd59e7840a2ce9419a8e" }, "downloads": -1, "filename": "Twisted-18.9.0.tar.bz2", "has_sig": false, - "md5_digest": "20fe2ec156e6e45b0b0d2ff06d9e828f", + "md5_digest": "35ff4705ea90a76bf972ff3b229546ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, @@ -63,175 +63,5 @@ "yanked_reason": null } ], - "vulnerabilities": [ - { - "aliases": [ - "CVE-2019-12387" - ], - "details": "In Twisted before 19.2.1, twisted.web did not validate or sanitize URIs or HTTP methods, allowing an attacker to inject invalid characters such as CRLF.", - "fixed_in": [ - "19.2.1" - ], - "id": "PYSEC-2019-128", - "link": "https://osv.dev/vulnerability/PYSEC-2019-128", - "source": "osv", - "summary": null - }, - { - "aliases": [ - "CVE-2020-10109" - ], - "details": "In Twisted Web through 19.10.0, there was an HTTP request splitting vulnerability. When presented with a content-length and a chunked encoding header, the content-length took precedence and the remainder of the request body was interpreted as a pipelined request.", - "fixed_in": [ - "20.3.0rc1" - ], - "id": "PYSEC-2020-260", - "link": "https://osv.dev/vulnerability/PYSEC-2020-260", - "source": "osv", - "summary": null - }, - { - "aliases": [ - "CVE-2019-12855" - ], - "details": "In words.protocols.jabber.xmlstream in Twisted through 19.2.1, XMPP support did not verify certificates when used with TLS, allowing an attacker to MITM connections.", - "fixed_in": [ - "19.7.0rc1" - ], - "id": "PYSEC-2019-129", - "link": "https://osv.dev/vulnerability/PYSEC-2019-129", - "source": "osv", - "summary": null - }, - { - "aliases": [ - "CVE-2020-10108" - ], - "details": "In Twisted Web through 19.10.0, there was an HTTP request splitting vulnerability. When presented with two content-length headers, it ignored the first header. When the second content-length value was set to zero, the request body was interpreted as a pipelined request.", - "fixed_in": [ - "20.3.0rc1" - ], - "id": "PYSEC-2020-259", - "link": "https://osv.dev/vulnerability/PYSEC-2020-259", - "source": "osv", - "summary": null - }, - { - "aliases": [ - "CVE-2022-21712", - "GHSA-92x2-jw7w-xvvx" - ], - "details": "twisted is an event-driven networking engine written in Python. In affected versions twisted exposes cookies and authorization headers when following cross-origin redirects. This issue is present in the `twited.web.RedirectAgent` and `twisted.web. BrowserLikeRedirectAgent` functions. Users are advised to upgrade. There are no known workarounds.", - "fixed_in": [ - "22.1.0" - ], - "id": "PYSEC-2022-27", - "link": "https://osv.dev/vulnerability/PYSEC-2022-27", - "source": "osv", - "summary": null - }, - { - "aliases": [ - "CVE-2022-24801", - "GHSA-c2jg-hw38-jrqq" - ], - "details": "Twisted is an event-based framework for internet applications, supporting Python 3.6+. Prior to version 22.4.0rc1, the Twisted Web HTTP 1.1 server, located in the `twisted.web.http` module, parsed several HTTP request constructs more leniently than permitted by RFC 7230. This non-conformant parsing can lead to desync if requests pass through multiple HTTP parsers, potentially resulting in HTTP request smuggling. Users who may be affected use Twisted Web's HTTP 1.1 server and/or proxy and also pass requests through a different HTTP server and/or proxy. The Twisted Web client is not affected. The HTTP 2.0 server uses a different parser, so it is not affected. The issue has been addressed in Twisted 22.4.0rc1. Two workarounds are available: Ensure any vulnerabilities in upstream proxies have been addressed, such as by upgrading them; or filter malformed requests by other means, such as configuration of an upstream proxy.", - "fixed_in": [ - "22.4.0" - ], - "id": "PYSEC-2022-195", - "link": "https://osv.dev/vulnerability/PYSEC-2022-195", - "source": "osv", - "summary": null - }, - { - "aliases": [ - "CVE-2022-24801" - ], - "details": "The Twisted Web HTTP 1.1 server, located in the `twisted.web.http` module, parsed several HTTP request constructs more leniently than permitted by RFC 7230:\n\n1. The Content-Length header value could have a `+` or `-` prefix.\n2. Illegal characters were permitted in chunked extensions, such as the LF (`\\n`) character.\n3. Chunk lengths, which are expressed in hexadecimal format, could have a prefix of `0x`.\n4. HTTP headers were stripped of all leading and trailing ASCII whitespace, rather than only space and HTAB (`\\t`).\n\nThis non-conformant parsing can lead to desync if requests pass through multiple HTTP parsers, potentially resulting in HTTP request smuggling.\n\n### Impact\n\nYou may be affected if:\n\n1. You use Twisted Web's HTTP 1.1 server and/or proxy\n2. You also pass requests through a different HTTP server and/or proxy\n\nThe specifics of the other HTTP parser matter. The original report notes that some versions of Apache Traffic Server and HAProxy have been vulnerable in the past. HTTP request smuggling may be a serious concern if you use a proxy to perform request validation or access control.\n\nThe Twisted Web client is not affected. The HTTP 2.0 server uses a different parser, so it is not affected.\n\n### Patches\n\nThe issue has been addressed in Twisted 22.4.0rc1 and later.\n\n### Workarounds\n\nOther than upgrading Twisted, you could:\n\n* Ensure any vulnerabilities in upstream proxies have been addressed, such as by upgrading them\n* Filter malformed requests by other means, such as configuration of an upstream proxy\n\n### Credits\n\nThis issue was initially reported by [Zhang Zeyu](https://github.com/zeyu2001).", - "fixed_in": [ - "22.4.0rc1" - ], - "id": "GHSA-c2jg-hw38-jrqq", - "link": "https://osv.dev/vulnerability/GHSA-c2jg-hw38-jrqq", - "source": "osv", - "summary": null - }, - { - "aliases": [ - "CVE-2020-10109" - ], - "details": "In Twisted Web through 20.3.0, there was an HTTP request splitting vulnerability. When presented with a content-length and a chunked encoding header, the content-length took precedence and the remainder of the request body was interpreted as a pipelined request.", - "fixed_in": [ - "20.3.0" - ], - "id": "GHSA-p5xh-vx83-mxcj", - "link": "https://osv.dev/vulnerability/GHSA-p5xh-vx83-mxcj", - "source": "osv", - "summary": null - }, - { - "aliases": [], - "details": "### Impact\nTwisted web servers that utilize the optional HTTP/2 support suffer from the following flow-control related vulnerabilities:\n\nPing flood: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-9512\nReset flood: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-9514\nSettings flood: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-9515\n\nA Twisted web server supports HTTP/2 requests if you've installed the [`http2` optional dependency set](https://twistedmatrix.com/documents/19.2.0/installation/howto/optional.html).\n\n### Workarounds\nThere are no workarounds.\n\n### References\nhttps://github.com/Netflix/security-bulletins/blob/master/advisories/third-party/2019-002.md\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [Twisted's Trac](https://twistedmatrix.com/trac/)\n", - "fixed_in": [ - "19.10.0" - ], - "id": "GHSA-32gv-6cf3-wcmq", - "link": "https://osv.dev/vulnerability/GHSA-32gv-6cf3-wcmq", - "source": "osv", - "summary": null - }, - { - "aliases": [ - "CVE-2019-12855" - ], - "details": "In words.protocols.jabber.xmlstream in Twisted through 19.2.1, XMPP support did not verify certificates when used with TLS, allowing an attacker to MITM connections.", - "fixed_in": [ - "19.7.0" - ], - "id": "GHSA-65rm-h285-5cc5", - "link": "https://osv.dev/vulnerability/GHSA-65rm-h285-5cc5", - "source": "osv", - "summary": null - }, - { - "aliases": [ - "CVE-2020-10108" - ], - "details": "In Twisted Web through 20.3.0, there was an HTTP request splitting vulnerability. When presented with two content-length headers, it ignored the first header. When the second content-length value was set to zero, the request body was interpreted as a pipelined request.", - "fixed_in": [ - "20.3.0" - ], - "id": "GHSA-h96w-mmrf-2h6v", - "link": "https://osv.dev/vulnerability/GHSA-h96w-mmrf-2h6v", - "source": "osv", - "summary": null - }, - { - "aliases": [ - "CVE-2019-12387" - ], - "details": "In Twisted before 19.2.1, twisted.web did not validate or sanitize URIs or HTTP methods, allowing an attacker to inject invalid characters such as CRLF.", - "fixed_in": [ - "19.2.1" - ], - "id": "GHSA-6cc5-2vg4-cc7m", - "link": "https://osv.dev/vulnerability/GHSA-6cc5-2vg4-cc7m", - "source": "osv", - "summary": null - }, - { - "aliases": [ - "CVE-2022-21712" - ], - "details": "### Impact\n\nCookie and Authorization headers are leaked when following cross-origin redirects in `twited.web.client.RedirectAgent` and `twisted.web.client.BrowserLikeRedirectAgent`.", - "fixed_in": [ - "22.1" - ], - "id": "GHSA-92x2-jw7w-xvvx", - "link": "https://osv.dev/vulnerability/GHSA-92x2-jw7w-xvvx", - "source": "osv", - "summary": null - } - ] + "vulnerabilities": [] } diff --git a/tests/repositories/fixtures/pypi.org/json/wheel.json b/tests/repositories/fixtures/pypi.org/json/wheel.json index 6a6d6b8df7b..a20b5b944f6 100644 --- a/tests/repositories/fixtures/pypi.org/json/wheel.json +++ b/tests/repositories/fixtures/pypi.org/json/wheel.json @@ -1,20 +1,10 @@ { "files": [ - { - "filename": "wheel-0.40.0-py3-none-any.whl", - "hashes": { - "sha256": "d236b20e7cb522daf2390fa84c55eea81c5c30190f90f29ae2ca1ad8355bf247" - }, - "requires-python": ">=3.7", - "size": 64545, - "upload-time": "2023-03-14T15:10:00.828550Z", - "url": "https://files.pythonhosted.org/packages/61/86/cc8d1ff2ca31a312a25a708c891cf9facbad4eae493b3872638db6785eb5/wheel-0.40.0-py3-none-any.whl", - "yanked": false - }, { "filename": "wheel-0.40.0.tar.gz", "hashes": { - "sha256": "cd1196f3faee2b31968d626e1731c94f99cbdb67cf5a46e4f5656cbee7738873" + "md5": "5f175a8d693f74878964d4fd29729ab7", + "sha256": "5cb7e75751aa82e1b7db3fd52f5a9d59e7b06905630bed135793295931528740" }, "requires-python": ">=3.7", "size": 96226, diff --git a/tests/repositories/fixtures/pypi.org/json/wheel/0.40.0.json b/tests/repositories/fixtures/pypi.org/json/wheel/0.40.0.json index 6043ad6cd68..b2f0693ae62 100644 --- a/tests/repositories/fixtures/pypi.org/json/wheel/0.40.0.json +++ b/tests/repositories/fixtures/pypi.org/json/wheel/0.40.0.json @@ -16,7 +16,7 @@ "Programming Language :: Python :: 3.9", "Topic :: System :: Archiving :: Packaging" ], - "description": "wheel\n=====\n\nThis library is the reference implementation of the Python wheel packaging\nstandard, as defined in `PEP 427`_.\n\nIt has two different roles:\n\n#. A setuptools_ extension for building wheels that provides the\n ``bdist_wheel`` setuptools command\n#. A command line tool for working with wheel files\n\nIt should be noted that wheel is **not** intended to be used as a library, and\nas such there is no stable, public API.\n\n.. _PEP 427: https://www.python.org/dev/peps/pep-0427/\n.. _setuptools: https://pypi.org/project/setuptools/\n\nDocumentation\n-------------\n\nThe documentation_ can be found on Read The Docs.\n\n.. _documentation: https://wheel.readthedocs.io/\n\nCode of Conduct\n---------------\n\nEveryone interacting in the wheel project's codebases, issue trackers, chat\nrooms, and mailing lists is expected to follow the `PSF Code of Conduct`_.\n\n.. _PSF Code of Conduct: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md\n\n", + "description": "", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", @@ -54,7 +54,6 @@ { "comment_text": "", "digests": { - "blake2b_256": "6186cc8d1ff2ca31a312a25a708c891cf9facbad4eae493b3872638db6785eb5", "md5": "517d39f133bd7b1ff17caf09784b7543", "sha256": "d236b20e7cb522daf2390fa84c55eea81c5c30190f90f29ae2ca1ad8355bf247" }, @@ -75,14 +74,13 @@ { "comment_text": "", "digests": { - "blake2b_256": "fcef0335f7217dd1e8096a9e8383e1d472aa14717878ffe07c4772e68b6e8735", - "md5": "ec5004c46d1905da98bb5bc1a10ddd21", - "sha256": "cd1196f3faee2b31968d626e1731c94f99cbdb67cf5a46e4f5656cbee7738873" + "md5": "5f175a8d693f74878964d4fd29729ab7", + "sha256": "5cb7e75751aa82e1b7db3fd52f5a9d59e7b06905630bed135793295931528740" }, "downloads": -1, "filename": "wheel-0.40.0.tar.gz", "has_sig": false, - "md5_digest": "ec5004c46d1905da98bb5bc1a10ddd21", + "md5_digest": "5f175a8d693f74878964d4fd29729ab7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", diff --git a/tests/repositories/fixtures/pypi.org/json/zipp.json b/tests/repositories/fixtures/pypi.org/json/zipp.json index 085679a0c6e..5f6831b424a 100644 --- a/tests/repositories/fixtures/pypi.org/json/zipp.json +++ b/tests/repositories/fixtures/pypi.org/json/zipp.json @@ -3,8 +3,8 @@ "files": [ { "hashes": { - "md5": "0ec47fbf522751f6c5fa904cb33f1f59", - "sha256": "957cfda87797e389580cb8b9e3870841ca991e2125350677b2ca83a0e99390a3" + "md5": "52aecc0484efd07d62575d152f6a98f6", + "sha256": "82da6dcae3676123d6f493a876259614e7e6e970b14c59b1830a2c901ed91306" }, "filename": "zipp-3.5.0-py3-none-any.whl", "requires_python": ">=3.6", @@ -12,8 +12,8 @@ }, { "hashes": { - "md5": "617efbf3edb707c57008ec00f408972f", - "sha256": "f5812b1e007e48cff63449a5e9f4e7ebea716b4111f9c4f9a645f91d579bf0c4" + "md5": "16bf2a24fae340052e8565c264d21092", + "sha256": "239d50954a15aa4b283023f18dc451ba811fb4d263f4dd6855642e4d1c80cc9f" }, "filename": "zipp-3.5.0.tar.gz", "requires_python": ">=3.6", diff --git a/tests/repositories/fixtures/pypi.org/json/zipp/3.5.0.json b/tests/repositories/fixtures/pypi.org/json/zipp/3.5.0.json index 356bd2b3483..e9a0b6eaf86 100644 --- a/tests/repositories/fixtures/pypi.org/json/zipp/3.5.0.json +++ b/tests/repositories/fixtures/pypi.org/json/zipp/3.5.0.json @@ -101,13 +101,13 @@ { "comment_text": "", "digests": { - "md5": "0ec47fbf522751f6c5fa904cb33f1f59", - "sha256": "957cfda87797e389580cb8b9e3870841ca991e2125350677b2ca83a0e99390a3" + "md5": "52aecc0484efd07d62575d152f6a98f6", + "sha256": "82da6dcae3676123d6f493a876259614e7e6e970b14c59b1830a2c901ed91306" }, "downloads": -1, "filename": "zipp-3.5.0-py3-none-any.whl", "has_sig": false, - "md5_digest": "0ec47fbf522751f6c5fa904cb33f1f59", + "md5_digest": "52aecc0484efd07d62575d152f6a98f6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", @@ -121,13 +121,13 @@ { "comment_text": "", "digests": { - "md5": "617efbf3edb707c57008ec00f408972f", - "sha256": "f5812b1e007e48cff63449a5e9f4e7ebea716b4111f9c4f9a645f91d579bf0c4" + "md5": "16bf2a24fae340052e8565c264d21092", + "sha256": "239d50954a15aa4b283023f18dc451ba811fb4d263f4dd6855642e4d1c80cc9f" }, "downloads": -1, "filename": "zipp-3.5.0.tar.gz", "has_sig": false, - "md5_digest": "617efbf3edb707c57008ec00f408972f", + "md5_digest": "16bf2a24fae340052e8565c264d21092", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", diff --git a/tests/repositories/fixtures/pypi.org/stubbed/SQLAlchemy-1.2.12.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/SQLAlchemy-1.2.12.tar.gz new file mode 100644 index 00000000000..8be6fc3bfe5 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/SQLAlchemy-1.2.12.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/Twisted-18.9.0.tar.bz2 b/tests/repositories/fixtures/pypi.org/stubbed/Twisted-18.9.0.tar.bz2 new file mode 100644 index 00000000000..adde976d05c Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/Twisted-18.9.0.tar.bz2 differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/attrs-17.4.0-py2.py3-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/attrs-17.4.0-py2.py3-none-any.whl new file mode 100644 index 00000000000..52264858d3c Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/attrs-17.4.0-py2.py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/attrs-17.4.0.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/attrs-17.4.0.tar.gz new file mode 100644 index 00000000000..e1d95e621ec Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/attrs-17.4.0.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/black-19.10b0-py36-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/black-19.10b0-py36-none-any.whl new file mode 100644 index 00000000000..85f1a5aaf9d Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/black-19.10b0-py36-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/black-19.10b0.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/black-19.10b0.tar.gz new file mode 100644 index 00000000000..6ae340af946 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/black-19.10b0.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/black-21.11b0-py3-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/black-21.11b0-py3-none-any.whl new file mode 100644 index 00000000000..2d889839128 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/black-21.11b0-py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/black-21.11b0.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/black-21.11b0.tar.gz new file mode 100644 index 00000000000..be05022675b Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/black-21.11b0.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/cleo-1.0.0a5-py3-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/cleo-1.0.0a5-py3-none-any.whl new file mode 100644 index 00000000000..89a45de35c4 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/cleo-1.0.0a5-py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/cleo-1.0.0a5.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/cleo-1.0.0a5.tar.gz new file mode 100644 index 00000000000..19279f2da23 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/cleo-1.0.0a5.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/clikit-0.2.4-py2.py3-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/clikit-0.2.4-py2.py3-none-any.whl new file mode 100644 index 00000000000..2389affd8ab Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/clikit-0.2.4-py2.py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/clikit-0.2.4.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/clikit-0.2.4.tar.gz new file mode 100644 index 00000000000..3cec1de9a56 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/clikit-0.2.4.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/colorama-0.3.9-py2.py3-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/colorama-0.3.9-py2.py3-none-any.whl new file mode 100644 index 00000000000..45aa098254c Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/colorama-0.3.9-py2.py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/colorama-0.3.9.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/colorama-0.3.9.tar.gz new file mode 100644 index 00000000000..f603c913cda Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/colorama-0.3.9.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/discord.py-2.0.0-py3-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/discord.py-2.0.0-py3-none-any.whl new file mode 100644 index 00000000000..1c993274b82 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/discord.py-2.0.0-py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/discord.py-2.0.0.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/discord.py-2.0.0.tar.gz new file mode 100644 index 00000000000..3e731f12bde Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/discord.py-2.0.0.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/futures-3.2.0-py2-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/futures-3.2.0-py2-none-any.whl new file mode 100644 index 00000000000..5593aeee3e6 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/futures-3.2.0-py2-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/futures-3.2.0.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/futures-3.2.0.tar.gz new file mode 100644 index 00000000000..5a633464101 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/futures-3.2.0.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/ipython-5.7.0-py2-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/ipython-5.7.0-py2-none-any.whl new file mode 100644 index 00000000000..314e5d11a68 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/ipython-5.7.0-py2-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/ipython-5.7.0-py3-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/ipython-5.7.0-py3-none-any.whl new file mode 100644 index 00000000000..f27a1788a29 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/ipython-5.7.0-py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/ipython-5.7.0.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/ipython-5.7.0.tar.gz new file mode 100644 index 00000000000..1ccefce3b21 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/ipython-5.7.0.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/ipython-7.5.0-py3-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/ipython-7.5.0-py3-none-any.whl new file mode 100644 index 00000000000..00e0e598166 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/ipython-7.5.0-py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/ipython-7.5.0.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/ipython-7.5.0.tar.gz new file mode 100644 index 00000000000..0eedc7be1ab Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/ipython-7.5.0.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/isort-4.3.4-py2-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/isort-4.3.4-py2-none-any.whl new file mode 100644 index 00000000000..4a4f24909f5 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/isort-4.3.4-py2-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/isort-4.3.4-py3-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/isort-4.3.4-py3-none-any.whl new file mode 100644 index 00000000000..35c983216ac Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/isort-4.3.4-py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/isort-4.3.4.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/isort-4.3.4.tar.gz new file mode 100644 index 00000000000..2943d5c5e3c Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/isort-4.3.4.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/dists/jupyter-1.0.0-py2.py3-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/jupyter-1.0.0-py2.py3-none-any.whl similarity index 72% rename from tests/repositories/fixtures/pypi.org/dists/jupyter-1.0.0-py2.py3-none-any.whl rename to tests/repositories/fixtures/pypi.org/stubbed/jupyter-1.0.0-py2.py3-none-any.whl index 2e5d42dff2a..4a78abe277e 100644 Binary files a/tests/repositories/fixtures/pypi.org/dists/jupyter-1.0.0-py2.py3-none-any.whl and b/tests/repositories/fixtures/pypi.org/stubbed/jupyter-1.0.0-py2.py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/jupyter-1.0.0.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/jupyter-1.0.0.tar.gz new file mode 100644 index 00000000000..3693aa87881 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/jupyter-1.0.0.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/jupyter-1.0.0.zip b/tests/repositories/fixtures/pypi.org/stubbed/jupyter-1.0.0.zip new file mode 100644 index 00000000000..61446e74d26 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/jupyter-1.0.0.zip differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/more-itertools-4.1.0.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/more-itertools-4.1.0.tar.gz new file mode 100644 index 00000000000..4211fece410 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/more-itertools-4.1.0.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/more_itertools-4.1.0-py2-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/more_itertools-4.1.0-py2-none-any.whl new file mode 100644 index 00000000000..436a62bfde7 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/more_itertools-4.1.0-py2-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/more_itertools-4.1.0-py3-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/more_itertools-4.1.0-py3-none-any.whl new file mode 100644 index 00000000000..07c288e372a Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/more_itertools-4.1.0-py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/pastel-0.1.0-py3-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/pastel-0.1.0-py3-none-any.whl new file mode 100644 index 00000000000..3cbecb7150e Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/pastel-0.1.0-py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/pastel-0.1.0.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/pastel-0.1.0.tar.gz new file mode 100644 index 00000000000..b16f684f38b Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/pastel-0.1.0.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/pluggy-0.6.0-py2-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/pluggy-0.6.0-py2-none-any.whl new file mode 100644 index 00000000000..7dd96ebd5ce Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/pluggy-0.6.0-py2-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/pluggy-0.6.0-py3-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/pluggy-0.6.0-py3-none-any.whl new file mode 100644 index 00000000000..68b635e679d Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/pluggy-0.6.0-py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/pluggy-0.6.0.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/pluggy-0.6.0.tar.gz new file mode 100644 index 00000000000..af3515c89b8 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/pluggy-0.6.0.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/poetry_core-1.5.0.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/poetry_core-1.5.0.tar.gz new file mode 100644 index 00000000000..6496da91ee6 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/poetry_core-1.5.0.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/py-1.5.3-py2.py3-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/py-1.5.3-py2.py3-none-any.whl new file mode 100644 index 00000000000..1231a39708e Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/py-1.5.3-py2.py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/py-1.5.3.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/py-1.5.3.tar.gz new file mode 100644 index 00000000000..a0267c79fa1 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/py-1.5.3.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/pytest-3.5.0-py2.py3-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/pytest-3.5.0-py2.py3-none-any.whl new file mode 100644 index 00000000000..2b43c100100 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/pytest-3.5.0-py2.py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/pytest-3.5.0.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/pytest-3.5.0.tar.gz new file mode 100644 index 00000000000..014a94a69a8 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/pytest-3.5.0.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/pytest-3.5.1-py2.py3-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/pytest-3.5.1-py2.py3-none-any.whl new file mode 100644 index 00000000000..4e2a1b6e1bd Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/pytest-3.5.1-py2.py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/pytest-3.5.1.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/pytest-3.5.1.tar.gz new file mode 100644 index 00000000000..129f6c2ff79 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/pytest-3.5.1.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/python-language-server-0.21.2.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/python-language-server-0.21.2.tar.gz new file mode 100644 index 00000000000..8602d2ea3ee Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/python-language-server-0.21.2.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/requests-2.18.4-py2.py3-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/requests-2.18.4-py2.py3-none-any.whl new file mode 100644 index 00000000000..3b504ecacdb Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/requests-2.18.4-py2.py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/requests-2.18.4.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/requests-2.18.4.tar.gz new file mode 100644 index 00000000000..6e0c9c9e2b9 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/requests-2.18.4.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/setuptools-67.6.1.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/setuptools-67.6.1.tar.gz new file mode 100644 index 00000000000..ed2bd06b59a Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/setuptools-67.6.1.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/six-1.11.0-py2.py3-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/six-1.11.0-py2.py3-none-any.whl new file mode 100644 index 00000000000..204a31d0a46 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/six-1.11.0-py2.py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/six-1.11.0.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/six-1.11.0.tar.gz new file mode 100644 index 00000000000..fdf539a7e17 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/six-1.11.0.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/tomlkit-0.5.2-py2.py3-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/tomlkit-0.5.2-py2.py3-none-any.whl new file mode 100644 index 00000000000..5fc6a4e6165 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/tomlkit-0.5.2-py2.py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/tomlkit-0.5.2.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/tomlkit-0.5.2.tar.gz new file mode 100644 index 00000000000..5270af1260e Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/tomlkit-0.5.2.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/tomlkit-0.5.3-py2.py3-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/tomlkit-0.5.3-py2.py3-none-any.whl new file mode 100644 index 00000000000..0069680397f Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/tomlkit-0.5.3-py2.py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/tomlkit-0.5.3.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/tomlkit-0.5.3.tar.gz new file mode 100644 index 00000000000..6e6f1add360 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/tomlkit-0.5.3.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/wheel-0.40.0.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/wheel-0.40.0.tar.gz new file mode 100644 index 00000000000..e3703eb7230 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/wheel-0.40.0.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/zipp-3.5.0-py3-none-any.whl b/tests/repositories/fixtures/pypi.org/stubbed/zipp-3.5.0-py3-none-any.whl new file mode 100644 index 00000000000..6f2d54ded33 Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/zipp-3.5.0-py3-none-any.whl differ diff --git a/tests/repositories/fixtures/pypi.org/stubbed/zipp-3.5.0.tar.gz b/tests/repositories/fixtures/pypi.org/stubbed/zipp-3.5.0.tar.gz new file mode 100644 index 00000000000..c50f986039d Binary files /dev/null and b/tests/repositories/fixtures/pypi.org/stubbed/zipp-3.5.0.tar.gz differ diff --git a/tests/repositories/fixtures/pypi.py b/tests/repositories/fixtures/pypi.py new file mode 100644 index 00000000000..cf96a5ff714 --- /dev/null +++ b/tests/repositories/fixtures/pypi.py @@ -0,0 +1,129 @@ +from __future__ import annotations + +import re + +from typing import TYPE_CHECKING +from typing import Any +from urllib.parse import urlparse + +import pytest + +from poetry.repositories.pypi_repository import PyPiRepository +from tests.helpers import FIXTURE_PATH_DISTRIBUTIONS +from tests.helpers import FIXTURE_PATH_REPOSITORIES +from tests.helpers import FIXTURE_PATH_REPOSITORIES_PYPI + + +if TYPE_CHECKING: + from pathlib import Path + + import httpretty + + from httpretty.core import HTTPrettyRequest + + from tests.types import HTTPrettyRequestCallback + from tests.types import HTTPrettyResponse + from tests.types import PackageDistributionLookup + + +pytest_plugins = [ + "tests.repositories.fixtures.legacy", + "tests.repositories.fixtures.python_hosted", +] + + +@pytest.fixture +def package_distribution_locations() -> list[Path]: + return [ + FIXTURE_PATH_REPOSITORIES_PYPI / "dists", + FIXTURE_PATH_REPOSITORIES_PYPI / "stubbed", + FIXTURE_PATH_DISTRIBUTIONS, + ] + + +@pytest.fixture +def package_metadata_path() -> Path | None: + return FIXTURE_PATH_REPOSITORIES / "metadata" + + +@pytest.fixture +def package_distribution_lookup( + package_distribution_locations: list[Path], package_metadata_path: Path | None +) -> PackageDistributionLookup: + def lookup(name: str) -> Path | None: + for location in package_distribution_locations: + fixture = location / name + if fixture.exists(): + return fixture + return None + + return lookup + + +@pytest.fixture(autouse=True) +def pypi_repository( + http: type[httpretty], + legacy_repository_html_callback: HTTPrettyRequestCallback, + mock_files_python_hosted: None, +) -> PyPiRepository: + def default_callback( + request: HTTPrettyRequest, uri: str, headers: dict[str, Any] + ) -> HTTPrettyResponse: + return 404, headers, b"Not Found" + + def search_callback( + request: HTTPrettyRequest, uri: str, headers: dict[str, Any] + ) -> HTTPrettyResponse: + search_html = FIXTURE_PATH_REPOSITORIES_PYPI.joinpath("search", "search.html") + return 200, headers, search_html.read_bytes() + + def simple_callback( + request: HTTPrettyRequest, uri: str, headers: dict[str, Any] + ) -> HTTPrettyResponse: + if request.headers["Accept"] == "application/vnd.pypi.simple.v1+json": + return json_callback(request, uri, headers) + return legacy_repository_html_callback(request, uri, headers) + + def json_callback( + request: HTTPrettyRequest, uri: str, headers: dict[str, Any] + ) -> HTTPrettyResponse: + path = urlparse(uri).path + parts = path.rstrip("/").split("/")[2:] + name = parts[0] + version = parts[1] if len(parts) == 3 else None + json_fixtures = FIXTURE_PATH_REPOSITORIES_PYPI / "json" + if not version: + fixture = json_fixtures / f"{name}.json" + else: + fixture = json_fixtures / name / (version + ".json") + + if not fixture.exists(): + return default_callback(request, uri, headers) + + return 200, headers, fixture.read_bytes() + + http.register_uri( + http.GET, + re.compile(r"https://pypi.org/search(\?(.*))?$"), + body=search_callback, + ) + + http.register_uri( + http.GET, + re.compile(r"https://pypi.org/pypi/(.*)?/json$"), + body=json_callback, + ) + + http.register_uri( + http.GET, + re.compile(r"https://pypi.org/pypi/(.*)?(?!/json)$"), + body=default_callback, + ) + + http.register_uri( + http.GET, + re.compile(r"https://pypi.org/simple/?(.*)?$"), + body=simple_callback, + ) + + return PyPiRepository(disable_cache=True, fallback=False) diff --git a/tests/repositories/fixtures/python_hosted.py b/tests/repositories/fixtures/python_hosted.py new file mode 100644 index 00000000000..ebc4a7261f2 --- /dev/null +++ b/tests/repositories/fixtures/python_hosted.py @@ -0,0 +1,66 @@ +from __future__ import annotations + +import re + +from pathlib import Path +from typing import TYPE_CHECKING +from typing import Any +from typing import Iterator +from urllib.parse import urlparse + +import pytest + + +if TYPE_CHECKING: + from collections.abc import Iterator + + import httpretty + + from httpretty.core import HTTPrettyRequest + + from tests.types import PythonHostedFileMocker + + +@pytest.fixture +def mock_files_python_hosted_factory(http: type[httpretty]) -> PythonHostedFileMocker: + def factory( + distribution_locations: list[Path], metadata: Path | None = None + ) -> None: + def file_callback( + request: HTTPrettyRequest, uri: str, headers: dict[str, Any] + ) -> list[int | dict[str, Any] | bytes | str]: + name = Path(urlparse(uri).path).name + + if metadata and name.endswith(".metadata"): + fixture = metadata / name + + if fixture.exists(): + return [200, headers, fixture.read_text()] + else: + for location in distribution_locations: + fixture = location / name + if fixture.exists(): + return [200, headers, fixture.read_bytes()] + + return [404, headers, b"Not Found"] + + http.register_uri( + http.GET, + re.compile("^https://files.pythonhosted.org/.*$"), + body=file_callback, + ) + + return factory + + +@pytest.fixture +def mock_files_python_hosted( + mock_files_python_hosted_factory: PythonHostedFileMocker, + package_distribution_locations: list[Path], + package_metadata_path: Path | None, +) -> Iterator[None]: + mock_files_python_hosted_factory( + distribution_locations=package_distribution_locations, + metadata=package_metadata_path, + ) + yield None diff --git a/tests/repositories/test_legacy_repository.py b/tests/repositories/test_legacy_repository.py index 52ba32be960..0d9f304f7c1 100644 --- a/tests/repositories/test_legacy_repository.py +++ b/tests/repositories/test_legacy_repository.py @@ -2,9 +2,7 @@ import base64 import re -import shutil -from pathlib import Path from typing import TYPE_CHECKING import pytest @@ -19,18 +17,16 @@ from poetry.repositories.exceptions import PackageNotFound from poetry.repositories.exceptions import RepositoryError from poetry.repositories.legacy_repository import LegacyRepository -from poetry.repositories.link_sources.html import SimpleRepositoryPage if TYPE_CHECKING: import httpretty from _pytest.monkeypatch import MonkeyPatch - from packaging.utils import NormalizedName from pytest_mock import MockerFixture from poetry.config.config import Config - from tests.types import RequestsSessionGet + from tests.types import DistributionHashGetter @pytest.fixture(autouse=True) @@ -38,39 +34,10 @@ def _use_simple_keyring(with_simple_keyring: None) -> None: pass -class MockRepository(LegacyRepository): - FIXTURES = Path(__file__).parent / "fixtures" / "legacy" - - def __init__(self) -> None: - super().__init__("legacy", url="http://legacy.foo.bar", disable_cache=True) - self._lazy_wheel = False - - def _get_page(self, name: NormalizedName) -> SimpleRepositoryPage: - fixture = self.FIXTURES / (name + ".html") - if not fixture.exists(): - raise PackageNotFound(f"Package [{name}] not found.") - - with fixture.open(encoding="utf-8") as f: - return SimpleRepositoryPage(self._url + f"/{name}/", f.read()) - - def _download( - self, url: str, dest: Path, *, raise_accepts_ranges: bool = False - ) -> None: - filename = Link(url).filename - filepath = self.FIXTURES.parent / "pypi.org" / "dists" / filename - - shutil.copyfile(str(filepath), dest) - - -def test_packages_property_returns_empty_list() -> None: - repo = MockRepository() - repo._packages = [repo.package("jupyter", Version.parse("1.0.0"))] - - assert repo.packages == [] - - -def test_page_relative_links_path_are_correct() -> None: - repo = MockRepository() +def test_page_relative_links_path_are_correct( + legacy_repository: LegacyRepository, +) -> None: + repo = legacy_repository page = repo.get_page("relative") assert page is not None @@ -80,8 +47,10 @@ def test_page_relative_links_path_are_correct() -> None: assert link.path.startswith("/relative/poetry") -def test_page_absolute_links_path_are_correct() -> None: - repo = MockRepository() +def test_page_absolute_links_path_are_correct( + legacy_repository: LegacyRepository, +) -> None: + repo = legacy_repository page = repo.get_page("absolute") assert page is not None @@ -91,8 +60,8 @@ def test_page_absolute_links_path_are_correct() -> None: assert link.path.startswith("/packages/") -def test_page_clean_link() -> None: - repo = MockRepository() +def test_page_clean_link(legacy_repository: LegacyRepository) -> None: + repo = legacy_repository page = repo.get_page("relative") assert page is not None @@ -101,8 +70,8 @@ def test_page_clean_link() -> None: assert cleaned == "https://legacy.foo.bar/test%20/the%22/cleaning%00" -def test_page_invalid_version_link() -> None: - repo = MockRepository() +def test_page_invalid_version_link(legacy_repository: LegacyRepository) -> None: + repo = legacy_repository page = repo.get_page("invalid-version") assert page is not None @@ -120,12 +89,11 @@ def test_page_invalid_version_link() -> None: assert packages[0].version.to_string() == "0.1.0" -def test_page_filters_out_invalid_package_names() -> None: - class SpecialMockRepository(MockRepository): - def _get_page(self, name: NormalizedName) -> SimpleRepositoryPage: - return super()._get_page(canonicalize_name(f"{name}-with-extra-packages")) - - repo = SpecialMockRepository() +def test_page_filters_out_invalid_package_names( + legacy_repository_with_extra_packages: LegacyRepository, + dist_hash_getter: DistributionHashGetter, +) -> None: + repo = legacy_repository_with_extra_packages packages = repo.find_packages(Factory.create_dependency("pytest", "*")) assert len(packages) == 1 assert packages[0].name == "pytest" @@ -134,18 +102,18 @@ def _get_page(self, name: NormalizedName) -> SimpleRepositoryPage: package = repo.package("pytest", Version.parse("3.5.0")) assert package.files == [ { - "file": "pytest-3.5.0-py2.py3-none-any.whl", - "hash": "sha256:6266f87ab64692112e5477eba395cfedda53b1933ccd29478e671e73b420c19c", - }, - { - "file": "pytest-3.5.0.tar.gz", - "hash": "sha256:fae491d1874f199537fd5872b5e1f0e74a009b979df9d53d1553fd03da1703e1", - }, + "file": filename, + "hash": (f"sha256:{dist_hash_getter(filename).sha256}"), + } + for filename in [ + f"{package.name}-{package.version}-py2.py3-none-any.whl", + f"{package.name}-{package.version}.tar.gz", + ] ] -def test_sdist_format_support() -> None: - repo = MockRepository() +def test_sdist_format_support(legacy_repository: LegacyRepository) -> None: + repo = legacy_repository page = repo.get_page("relative") assert page is not None bz2_links = list(filter(lambda link: link.ext == ".tar.bz2", page.links)) @@ -153,8 +121,8 @@ def test_sdist_format_support() -> None: assert bz2_links[0].filename == "poetry-0.1.1.tar.bz2" -def test_missing_version() -> None: - repo = MockRepository() +def test_missing_version(legacy_repository: LegacyRepository) -> None: + repo = legacy_repository with pytest.raises(PackageNotFound): repo._get_release_info( @@ -162,8 +130,10 @@ def test_missing_version() -> None: ) -def test_get_package_information_fallback_read_setup() -> None: - repo = MockRepository() +def test_get_package_information_fallback_read_setup( + legacy_repository: LegacyRepository, +) -> None: + repo = legacy_repository package = repo.package("jupyter", Version.parse("1.0.0")) @@ -179,13 +149,12 @@ def test_get_package_information_fallback_read_setup() -> None: def test_get_package_information_pep_658( - mocker: MockerFixture, get_metadata_mock: RequestsSessionGet + mocker: MockerFixture, legacy_repository: LegacyRepository ) -> None: - repo = MockRepository() + repo = legacy_repository isort_package = repo.package("isort", Version.parse("4.3.4")) - mocker.patch.object(repo.session, "get", get_metadata_mock) spy = mocker.spy(repo, "_get_info_from_metadata") try: @@ -212,8 +181,10 @@ def test_get_package_information_pep_658( ) -def test_get_package_information_skips_dependencies_with_invalid_constraints() -> None: - repo = MockRepository() +def test_get_package_information_skips_dependencies_with_invalid_constraints( + legacy_repository: LegacyRepository, +) -> None: + repo = legacy_repository package = repo.package("python-language-server", Version.parse("0.21.2")) @@ -248,8 +219,8 @@ def test_get_package_information_skips_dependencies_with_invalid_constraints() - ] -def test_package_not_canonicalized() -> None: - repo = MockRepository() +def test_package_not_canonicalized(legacy_repository: LegacyRepository) -> None: + repo = legacy_repository package = repo.package("discord.py", Version.parse("2.0.0")) @@ -257,8 +228,8 @@ def test_package_not_canonicalized() -> None: assert package.pretty_name == "discord.py" -def test_find_packages_no_prereleases() -> None: - repo = MockRepository() +def test_find_packages_no_prereleases(legacy_repository: LegacyRepository) -> None: + repo = legacy_repository packages = repo.find_packages(Factory.create_dependency("pyyaml", "*")) @@ -272,8 +243,10 @@ def test_find_packages_no_prereleases() -> None: @pytest.mark.parametrize( ["constraint", "count"], [("*", 1), (">=1", 1), ("<=18", 0), (">=19.0.0a0", 1)] ) -def test_find_packages_only_prereleases(constraint: str, count: int) -> None: - repo = MockRepository() +def test_find_packages_only_prereleases( + constraint: str, count: int, legacy_repository: LegacyRepository +) -> None: + repo = legacy_repository packages = repo.find_packages(Factory.create_dependency("black", constraint)) assert len(packages) == count @@ -296,15 +269,19 @@ def test_find_packages_only_prereleases(constraint: str, count: int) -> None: ("==21.11b0", ["21.11b0"]), ], ) -def test_find_packages_yanked(constraint: str, expected: list[str]) -> None: - repo = MockRepository() +def test_find_packages_yanked( + constraint: str, expected: list[str], legacy_repository: LegacyRepository +) -> None: + repo = legacy_repository packages = repo.find_packages(Factory.create_dependency("black", constraint)) assert [str(p.version) for p in packages] == expected -def test_get_package_information_chooses_correct_distribution() -> None: - repo = MockRepository() +def test_get_package_information_chooses_correct_distribution( + legacy_repository: LegacyRepository, +) -> None: + repo = legacy_repository package = repo.package("isort", Version.parse("4.3.4")) @@ -316,8 +293,10 @@ def test_get_package_information_chooses_correct_distribution() -> None: assert futures_dep.python_versions == "~2.7" -def test_get_package_information_includes_python_requires() -> None: - repo = MockRepository() +def test_get_package_information_includes_python_requires( + legacy_repository: LegacyRepository, +) -> None: + repo = legacy_repository package = repo.package("futures", Version.parse("3.2.0")) @@ -326,10 +305,10 @@ def test_get_package_information_includes_python_requires() -> None: assert package.python_versions == ">=2.6, <3" -def test_get_package_information_sets_appropriate_python_versions_if_wheels_only() -> ( - None -): - repo = MockRepository() +def test_get_package_information_sets_appropriate_python_versions_if_wheels_only( + legacy_repository: LegacyRepository, +) -> None: + repo = legacy_repository package = repo.package("futures", Version.parse("3.2.0")) @@ -338,8 +317,10 @@ def test_get_package_information_sets_appropriate_python_versions_if_wheels_only assert package.python_versions == ">=2.6, <3" -def test_get_package_from_both_py2_and_py3_specific_wheels() -> None: - repo = MockRepository() +def test_get_package_from_both_py2_and_py3_specific_wheels( + legacy_repository: LegacyRepository, +) -> None: + repo = legacy_repository package = repo.package("ipython", Version.parse("5.7.0")) @@ -376,8 +357,10 @@ def test_get_package_from_both_py2_and_py3_specific_wheels() -> None: assert str(required[5].marker) == 'sys_platform != "win32"' -def test_get_package_from_both_py2_and_py3_specific_wheels_python_constraint() -> None: - repo = MockRepository() +def test_get_package_from_both_py2_and_py3_specific_wheels_python_constraint( + legacy_repository: LegacyRepository, +) -> None: + repo = legacy_repository package = repo.package("poetry-test-py2-py3-metadata-merge", Version.parse("0.1.0")) @@ -386,8 +369,10 @@ def test_get_package_from_both_py2_and_py3_specific_wheels_python_constraint() - assert package.python_versions == ">=2.7,<2.8 || >=3.7,<4.0" -def test_get_package_with_dist_and_universal_py3_wheel() -> None: - repo = MockRepository() +def test_get_package_with_dist_and_universal_py3_wheel( + legacy_repository: LegacyRepository, +) -> None: + repo = legacy_repository package = repo.package("ipython", Version.parse("7.5.0")) @@ -414,60 +399,69 @@ def test_get_package_with_dist_and_universal_py3_wheel() -> None: assert sorted(required, key=lambda dep: dep.name) == expected -def test_get_package_retrieves_non_sha256_hashes() -> None: - repo = MockRepository() +def test_get_package_retrieves_non_sha256_hashes( + legacy_repository: LegacyRepository, dist_hash_getter: DistributionHashGetter +) -> None: + repo = legacy_repository package = repo.package("ipython", Version.parse("7.5.0")) expected = [ { - "file": "ipython-7.5.0-py3-none-any.whl", - "hash": "sha256:78aea20b7991823f6a32d55f4e963a61590820e43f666ad95ad07c7f0c704efa", - }, - { - "file": "ipython-7.5.0.tar.gz", - "hash": "sha256:e840810029224b56cd0d9e7719dc3b39cf84d577f8ac686547c8ba7a06eeab26", - }, + "file": filename, + "hash": (f"sha256:{dist_hash_getter(filename).sha256}"), + } + for filename in [ + f"{package.name}-{package.version}-py3-none-any.whl", + f"{package.name}-{package.version}.tar.gz", + ] ] assert package.files == expected -def test_get_package_retrieves_non_sha256_hashes_mismatching_known_hash() -> None: - repo = MockRepository() +def test_get_package_retrieves_non_sha256_hashes_mismatching_known_hash( + legacy_repository: LegacyRepository, dist_hash_getter: DistributionHashGetter +) -> None: + repo = legacy_repository package = repo.package("ipython", Version.parse("5.7.0")) expected = [ { "file": "ipython-5.7.0-py2-none-any.whl", - "hash": "md5:a10a802ef98da741cd6f4f6289d47ba7", + # in the links provided by the legacy repository, this file only has a md5 hash, + # the sha256 is generated on the fly + "hash": f"sha256:{dist_hash_getter('ipython-5.7.0-py2-none-any.whl').sha256}", }, { "file": "ipython-5.7.0-py3-none-any.whl", - "hash": "sha256:fc0464e68f9c65cd8c453474b4175432cc29ecb6c83775baedf6dbfcee9275ab", + "hash": f"sha256:{dist_hash_getter('ipython-5.7.0-py3-none-any.whl').sha256}", }, { "file": "ipython-5.7.0.tar.gz", - "hash": "sha256:8db43a7fb7619037c98626613ff08d03dda9d5d12c84814a4504c78c0da8323c", + "hash": f"sha256:{dist_hash_getter('ipython-5.7.0.tar.gz').sha256}", }, ] assert package.files == expected -def test_get_package_retrieves_packages_with_no_hashes() -> None: - repo = MockRepository() +def test_get_package_retrieves_packages_with_no_hashes( + legacy_repository: LegacyRepository, dist_hash_getter: DistributionHashGetter +) -> None: + repo = legacy_repository package = repo.package("jupyter", Version.parse("1.0.0")) assert [ { - "file": "jupyter-1.0.0.tar.gz", - "hash": ( - "sha256:d9dc4b3318f310e34c82951ea5d6683f67bed7def4b259fafbfe4f1beb1d8e5f" - ), + "file": filename, + "hash": (f"sha256:{dist_hash_getter(filename).sha256}"), } + for filename in [ + f"{package.name}-{package.version}.tar.gz", + ] ] == package.files @@ -479,9 +473,13 @@ def test_get_package_retrieves_packages_with_no_hashes() -> None: ], ) def test_package_yanked( - package_name: str, version: str, yanked: bool, yanked_reason: str + package_name: str, + version: str, + yanked: bool, + yanked_reason: str, + legacy_repository: LegacyRepository, ) -> None: - repo = MockRepository() + repo = legacy_repository package = repo.package(package_name, Version.parse(version)) @@ -491,16 +489,15 @@ def test_package_yanked( assert package.yanked_reason == yanked_reason -def test_package_partial_yank() -> None: - class SpecialMockRepository(MockRepository): - def _get_page(self, name: NormalizedName) -> SimpleRepositoryPage: - return super()._get_page(canonicalize_name(f"{name}-partial-yank")) - - repo = MockRepository() +def test_package_partial_yank( + legacy_repository: LegacyRepository, + legacy_repository_partial_yank: LegacyRepository, +) -> None: + repo = legacy_repository package = repo.package("futures", Version.parse("3.2.0")) assert len(package.files) == 2 - repo = SpecialMockRepository() + repo = legacy_repository_partial_yank package = repo.package("futures", Version.parse("3.2.0")) assert len(package.files) == 1 assert package.files[0]["file"].endswith(".tar.gz") @@ -514,9 +511,13 @@ def _get_page(self, name: NormalizedName) -> SimpleRepositoryPage: ], ) def test_find_links_for_package_yanked( - package_name: str, version: str, yanked: bool, yanked_reason: str + package_name: str, + version: str, + yanked: bool, + yanked_reason: str, + legacy_repository: LegacyRepository, ) -> None: - repo = MockRepository() + repo = legacy_repository package = repo.package(package_name, Version.parse(version)) links = repo.find_links_for_package(package) @@ -527,10 +528,12 @@ def test_find_links_for_package_yanked( assert link.yanked_reason == yanked_reason -def test_cached_or_downloaded_file_supports_trailing_slash() -> None: - repo = MockRepository() +def test_cached_or_downloaded_file_supports_trailing_slash( + legacy_repository: LegacyRepository, +) -> None: + repo = legacy_repository with repo._cached_or_downloaded_file( - Link("https://foo.bar/pytest-3.5.0-py2.py3-none-any.whl/") + Link("https://files.pythonhosted.org/pytest-3.5.0-py2.py3-none-any.whl/") ) as filepath: assert filepath.name == "pytest-3.5.0-py2.py3-none-any.whl" @@ -563,7 +566,9 @@ def test_get_40x_and_returns_none( repo.get_page("foo") -def test_get_5xx_raises(http: type[httpretty.httpretty]) -> None: +def test_get_5xx_raises( + http: type[httpretty.httpretty], disable_http_status_force_list: None +) -> None: repo = MockHttpRepository({"/foo/": 500}, http) with pytest.raises(RepositoryError): diff --git a/tests/repositories/test_pypi_repository.py b/tests/repositories/test_pypi_repository.py index c53bb3cf555..27ffa793ea4 100644 --- a/tests/repositories/test_pypi_repository.py +++ b/tests/repositories/test_pypi_repository.py @@ -1,12 +1,7 @@ from __future__ import annotations -import json -import shutil - from io import BytesIO -from pathlib import Path from typing import TYPE_CHECKING -from typing import Any import pytest @@ -17,16 +12,13 @@ from requests.models import Response from poetry.factory import Factory -from poetry.repositories.exceptions import PackageNotFound -from poetry.repositories.link_sources.json import SimpleJsonPage from poetry.repositories.pypi_repository import PyPiRepository if TYPE_CHECKING: - from packaging.utils import NormalizedName from pytest_mock import MockerFixture - from tests.types import RequestsSessionGet + from tests.types import DistributionHashGetter @pytest.fixture(autouse=True) @@ -34,67 +26,24 @@ def _use_simple_keyring(with_simple_keyring: None) -> None: pass -class MockRepository(PyPiRepository): - JSON_FIXTURES = Path(__file__).parent / "fixtures" / "pypi.org" / "json" - DIST_FIXTURES = Path(__file__).parent / "fixtures" / "pypi.org" / "dists" - - def __init__(self, fallback: bool = False) -> None: - super().__init__(url="http://foo.bar", disable_cache=True, fallback=fallback) - self._lazy_wheel = False - - def get_json_page(self, name: NormalizedName) -> SimpleJsonPage: - fixture = self.JSON_FIXTURES / (name + ".json") - - if not fixture.exists(): - raise PackageNotFound(f"Package [{name}] not found.") - - return SimpleJsonPage("", json.loads(fixture.read_text())) - - def _get( - self, url: str, headers: dict[str, str] | None = None - ) -> dict[str, Any] | None: - parts = url.split("/")[1:] - name = parts[0] - version = parts[1] if len(parts) == 3 else None - - if not version: - fixture = self.JSON_FIXTURES / (name + ".json") - else: - fixture = self.JSON_FIXTURES / name / (version + ".json") - - if not fixture.exists(): - return None - - with fixture.open(encoding="utf-8") as f: - data: dict[str, Any] = json.load(f) - return data - - def _download( - self, url: str, dest: Path, *, raise_accepts_ranges: bool = False - ) -> None: - filename = url.split("/")[-1] - - fixture = self.DIST_FIXTURES / filename - - shutil.copyfile(str(fixture), dest) - - -def test_find_packages() -> None: - repo = MockRepository() +def test_find_packages(pypi_repository: PyPiRepository) -> None: + repo = pypi_repository packages = repo.find_packages(Factory.create_dependency("requests", "^2.18")) assert len(packages) == 5 -def test_find_packages_with_prereleases() -> None: - repo = MockRepository() +def test_find_packages_with_prereleases(pypi_repository: PyPiRepository) -> None: + repo = pypi_repository packages = repo.find_packages(Factory.create_dependency("toga", ">=0.3.0.dev2")) assert len(packages) == 7 -def test_find_packages_does_not_select_prereleases_if_not_allowed() -> None: - repo = MockRepository() +def test_find_packages_does_not_select_prereleases_if_not_allowed( + pypi_repository: PyPiRepository, +) -> None: + repo = pypi_repository packages = repo.find_packages(Factory.create_dependency("pyyaml", "*")) assert len(packages) == 1 @@ -103,8 +52,10 @@ def test_find_packages_does_not_select_prereleases_if_not_allowed() -> None: @pytest.mark.parametrize( ["constraint", "count"], [("*", 1), (">=1", 1), ("<=18", 0), (">=19.0.0a0", 1)] ) -def test_find_packages_only_prereleases(constraint: str, count: int) -> None: - repo = MockRepository() +def test_find_packages_only_prereleases( + constraint: str, count: int, pypi_repository: PyPiRepository +) -> None: + repo = pypi_repository packages = repo.find_packages(Factory.create_dependency("black", constraint)) assert len(packages) == count @@ -121,15 +72,19 @@ def test_find_packages_only_prereleases(constraint: str, count: int) -> None: ("==21.11b0", ["21.11b0"]), ], ) -def test_find_packages_yanked(constraint: str, expected: list[str]) -> None: - repo = MockRepository() +def test_find_packages_yanked( + constraint: str, expected: list[str], pypi_repository: PyPiRepository +) -> None: + repo = pypi_repository packages = repo.find_packages(Factory.create_dependency("black", constraint)) assert [str(p.version) for p in packages] == expected -def test_package() -> None: - repo = MockRepository() +def test_package( + pypi_repository: PyPiRepository, dist_hash_getter: DistributionHashGetter +) -> None: + repo = pypi_repository package = repo.package("requests", Version.parse("2.18.4")) @@ -141,13 +96,13 @@ def test_package() -> None: assert package.files == [ { - "file": "requests-2.18.4-py2.py3-none-any.whl", - "hash": "sha256:6a1b267aa90cac58ac3a765d067950e7dbbf75b1da07e895d1f594193a40a38b", - }, - { - "file": "requests-2.18.4.tar.gz", - "hash": "sha256:9c443e7324ba5b85070c4a818ade28bfabedf16ea10206da1132edaa6dda237e", - }, + "file": filename, + "hash": (f"sha256:{dist_hash_getter(filename).sha256}"), + } + for filename in [ + f"{package.name}-{package.version}-py2.py3-none-any.whl", + f"{package.name}-{package.version}.tar.gz", + ] ] win_inet = package.extras[canonicalize_name("socks")][0] @@ -175,9 +130,13 @@ def test_package() -> None: ], ) def test_package_yanked( - package_name: str, version: str, yanked: bool, yanked_reason: str + package_name: str, + version: str, + yanked: bool, + yanked_reason: str, + pypi_repository: PyPiRepository, ) -> None: - repo = MockRepository() + repo = pypi_repository package = repo.package(package_name, Version.parse(version)) @@ -187,8 +146,8 @@ def test_package_yanked( assert package.yanked_reason == yanked_reason -def test_package_not_canonicalized() -> None: - repo = MockRepository() +def test_package_not_canonicalized(pypi_repository: PyPiRepository) -> None: + repo = pypi_repository package = repo.package("discord.py", Version.parse("2.0.0")) @@ -204,9 +163,13 @@ def test_package_not_canonicalized() -> None: ], ) def test_find_links_for_package_yanked( - package_name: str, version: str, yanked: bool, yanked_reason: str + package_name: str, + version: str, + yanked: bool, + yanked_reason: str, + pypi_repository: PyPiRepository, ) -> None: - repo = MockRepository() + repo = pypi_repository package = repo.package(package_name, Version.parse(version)) links = repo.find_links_for_package(package) @@ -217,8 +180,9 @@ def test_find_links_for_package_yanked( assert link.yanked_reason == yanked_reason -def test_fallback_on_downloading_packages() -> None: - repo = MockRepository(fallback=True) +def test_fallback_on_downloading_packages(pypi_repository: PyPiRepository) -> None: + repo = pypi_repository + repo._fallback = True package = repo.package("jupyter", Version.parse("1.0.0")) @@ -236,8 +200,11 @@ def test_fallback_on_downloading_packages() -> None: ] -def test_fallback_inspects_sdist_first_if_no_matching_wheels_can_be_found() -> None: - repo = MockRepository(fallback=True) +def test_fallback_inspects_sdist_first_if_no_matching_wheels_can_be_found( + pypi_repository: PyPiRepository, +) -> None: + repo = pypi_repository + repo._fallback = True package = repo.package("isort", Version.parse("4.3.4")) @@ -250,11 +217,11 @@ def test_fallback_inspects_sdist_first_if_no_matching_wheels_can_be_found() -> N def test_fallback_pep_658_metadata( - mocker: MockerFixture, get_metadata_mock: RequestsSessionGet + mocker: MockerFixture, pypi_repository: PyPiRepository ) -> None: - repo = MockRepository(fallback=True) + repo = pypi_repository + repo._fallback = True - mocker.patch.object(repo.session, "get", get_metadata_mock) spy = mocker.spy(repo, "_get_info_from_metadata") try: @@ -273,8 +240,11 @@ def test_fallback_pep_658_metadata( assert dep.python_versions == "~2.7" -def test_fallback_can_read_setup_to_get_dependencies() -> None: - repo = MockRepository(fallback=True) +def test_fallback_can_read_setup_to_get_dependencies( + pypi_repository: PyPiRepository, +) -> None: + repo = pypi_repository + repo._fallback = True package = repo.package("sqlalchemy", Version.parse("1.2.12")) @@ -295,8 +265,11 @@ def test_fallback_can_read_setup_to_get_dependencies() -> None: } -def test_pypi_repository_supports_reading_bz2_files() -> None: - repo = MockRepository(fallback=True) +def test_pypi_repository_supports_reading_bz2_files( + pypi_repository: PyPiRepository, +) -> None: + repo = pypi_repository + repo._fallback = True package = repo.package("twisted", Version.parse("18.9.0")) @@ -336,8 +309,8 @@ def test_pypi_repository_supports_reading_bz2_files() -> None: ) -def test_invalid_versions_ignored() -> None: - repo = MockRepository() +def test_invalid_versions_ignored(pypi_repository: PyPiRepository) -> None: + repo = pypi_repository # the json metadata for this package contains one malformed version # and a correct one. @@ -345,6 +318,7 @@ def test_invalid_versions_ignored() -> None: assert len(packages) == 1 +@pytest.mark.usefixtures("pypi_repository") def test_get_should_invalid_cache_on_too_many_redirects_error( mocker: MockerFixture, ) -> None: @@ -364,15 +338,17 @@ def test_get_should_invalid_cache_on_too_many_redirects_error( assert delete_cache.called -def test_urls() -> None: - repository = PyPiRepository() +def test_urls(pypi_repository: PyPiRepository) -> None: + repository = pypi_repository assert repository.url == "https://pypi.org/simple/" assert repository.authenticated_url == "https://pypi.org/simple/" -def test_find_links_for_package_of_supported_types() -> None: - repo = MockRepository() +def test_find_links_for_package_of_supported_types( + pypi_repository: PyPiRepository, +) -> None: + repo = pypi_repository package = repo.find_packages(Factory.create_dependency("hbmqtt", "0.9.6")) assert len(package) == 1 @@ -384,8 +360,10 @@ def test_find_links_for_package_of_supported_types() -> None: assert links[0].show_url == "hbmqtt-0.9.6.tar.gz" -def test_get_release_info_includes_only_supported_types() -> None: - repo = MockRepository() +def test_get_release_info_includes_only_supported_types( + pypi_repository: PyPiRepository, +) -> None: + repo = pypi_repository release_info = repo._get_release_info( name=canonicalize_name("hbmqtt"), version=Version.parse("0.9.6") diff --git a/tests/repositories/test_repository_pool.py b/tests/repositories/test_repository_pool.py index 2a62f360815..87d5782170e 100644 --- a/tests/repositories/test_repository_pool.py +++ b/tests/repositories/test_repository_pool.py @@ -351,10 +351,17 @@ def test_search_no_legacy_repositories() -> None: assert pool.search("nothing") == [] -def test_search_legacy_repositories_are_skipped() -> None: - package = get_package("foo", "1.0.0") - repo1 = Repository("repo1", [package]) - repo2 = LegacyRepository("repo2", "https://fake.repo/") +def test_search_legacy_repositories_are_not_skipped( + legacy_repository: LegacyRepository, +) -> None: + foo_package = get_package("foo", "1.0.0") + demo_package = get_package("demo", "0.1.0") + + repo1 = Repository("repo1", [foo_package]) + repo2 = legacy_repository pool = RepositoryPool([repo1, repo2]) - assert pool.search("foo") == [package] + assert pool.search("foo") == [foo_package] + + assert repo1.search("demo") == [] + assert repo2.search("demo") == pool.search("demo") == [demo_package] diff --git a/tests/types.py b/tests/types.py index e58bad84dc8..29558ea6626 100644 --- a/tests/types.py +++ b/tests/types.py @@ -12,18 +12,19 @@ from typing import Dict from typing import Tuple - import requests - from cleo.io.io import IO from cleo.testers.command_tester import CommandTester from httpretty.core import HTTPrettyRequest + from packaging.utils import NormalizedName from poetry.config.config import Config from poetry.config.source import Source from poetry.installation import Installer from poetry.installation.executor import Executor from poetry.poetry import Poetry + from poetry.repositories.legacy_repository import LegacyRepository from poetry.utils.env import Env + from tests.repositories.fixtures.distribution_hashes import DistributionHash HTTPrettyResponse = Tuple[int, Dict[str, Any], bytes] # status code, headers, body HTTPrettyRequestCallback = Callable[ @@ -78,8 +79,31 @@ class HTMLPageGetter(Protocol): def __call__(self, content: str, base_url: str | None = None) -> str: ... -class RequestsSessionGet(Protocol): - def __call__(self, url: str, **__: Any) -> requests.Response: ... +class NormalizedNameTransformer(Protocol): + def __call__(self, name: str) -> NormalizedName: ... + + +class SpecializedLegacyRepositoryMocker(Protocol): + def __call__( + self, + transformer_or_suffix: NormalizedNameTransformer | str, + repository_name: str = "special", + repository_url: str = "https://legacy.foo.bar", + ) -> LegacyRepository: ... + + +class PythonHostedFileMocker(Protocol): + def __call__( + self, distribution_locations: list[Path], metadata: Path | None = None + ) -> None: ... + + +class PackageDistributionLookup(Protocol): + def __call__(self, name: str) -> Path | None: ... + + +class DistributionHashGetter(Protocol): + def __call__(self, name: str) -> DistributionHash: ... class SetProjectContext(Protocol):