From 262a13738b749d04838b43ae0481cdf756d4938d Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Thu, 6 Mar 2025 09:09:04 +0100 Subject: [PATCH] Apply suggestions from code review Add typing where missing. Remove extra underscore from method. Reference: https://github.com/pypa/bandersnatch/issues/1897 Philippe Ombredanne Co-authored-by: Cooper Lees --- src/bandersnatch/master.py | 2 +- src/bandersnatch/tests/test_master.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bandersnatch/master.py b/src/bandersnatch/master.py index 47c79958a..053b379c3 100644 --- a/src/bandersnatch/master.py +++ b/src/bandersnatch/master.py @@ -157,7 +157,7 @@ async def fetch_simple_index(self) -> Any: simple_index = await response.json() return simple_index - async def all_packages(self) -> Any: + async def all_packages(self) -> dict[str, int]: """Return a mapping of all project names as {name: last_serial}""" simple_index = await self.fetch_simple_index() if not simple_index: diff --git a/src/bandersnatch/tests/test_master.py b/src/bandersnatch/tests/test_master.py index 6709536c5..c4ab3b876 100644 --- a/src/bandersnatch/tests/test_master.py +++ b/src/bandersnatch/tests/test_master.py @@ -78,7 +78,7 @@ async def test_master_url_fetch(master: Master) -> None: @pytest.mark.asyncio -async def test__simple_index_user_agent(master: Master) -> None: +async def test_simple_index_user_agent(master: Master) -> None: headers = master._custom_headers assert f"bandersnatch {bandersnatch.__version__}" in headers["User-Agent"]