From 1d0c9b1ae0c658b7d0ed1a0ab9a9175b8291511b Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sun, 7 Mar 2021 20:58:17 -0800 Subject: [PATCH] Prefer dict literals over dict constructor More idiomatic and (very very slightly) faster. --- piptools/repositories/pypi.py | 18 +++++++++--------- tests/test_minimal_upgrade.py | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/piptools/repositories/pypi.py b/piptools/repositories/pypi.py index 3ade3248d..78d36b27b 100644 --- a/piptools/repositories/pypi.py +++ b/piptools/repositories/pypi.py @@ -157,15 +157,15 @@ def resolve_reqs(self, download_dir, ireq, wheel_cache): with get_requirement_tracker() as req_tracker, TempDirectory( kind="resolver" ) as temp_dir, indent_log(): - preparer_kwargs = dict( - temp_build_dir=temp_dir, - options=self.options, - req_tracker=req_tracker, - session=self.session, - finder=self.finder, - use_user_site=False, - download_dir=download_dir, - ) + preparer_kwargs = { + "temp_build_dir": temp_dir, + "options": self.options, + "req_tracker": req_tracker, + "session": self.session, + "finder": self.finder, + "use_user_site": False, + "download_dir": download_dir, + } preparer = self.command.make_requirement_preparer(**preparer_kwargs) reqset = RequirementSet() diff --git a/tests/test_minimal_upgrade.py b/tests/test_minimal_upgrade.py index eb461ce93..d7337f597 100644 --- a/tests/test_minimal_upgrade.py +++ b/tests/test_minimal_upgrade.py @@ -34,7 +34,7 @@ ) def test_no_upgrades(base_resolver, repository, from_line, input, pins, expected): input = [from_line(line) for line in input] - existing_pins = dict() + existing_pins = {} for line in pins: ireq = from_line(line) existing_pins[key_from_ireq(ireq)] = ireq