Skip to content

Commit

Permalink
Upgrade to the latest Ruff version (#10433)
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh authored Jan 9, 2025
1 parent 15ec830 commit 359ef28
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
24 changes: 12 additions & 12 deletions scripts/benchmark/src/benchmark/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,9 @@ def resolve_incremental(
self.setup(requirements_file, cwd=cwd)

poetry_lock = os.path.join(cwd, "poetry.lock")
assert not os.path.exists(
poetry_lock
), f"Lockfile already exists at: {poetry_lock}"
assert not os.path.exists(poetry_lock), (
f"Lockfile already exists at: {poetry_lock}"
)

# Run a resolution, to ensure that the lockfile exists.
# TODO(charlie): Make this a `setup`.
Expand Down Expand Up @@ -499,9 +499,9 @@ def resolve_noop(self, requirements_file: str, *, cwd: str) -> Command | None:
self.setup(requirements_file, cwd=cwd)

poetry_lock = os.path.join(cwd, "poetry.lock")
assert not os.path.exists(
poetry_lock
), f"Lockfile already exists at: {poetry_lock}"
assert not os.path.exists(poetry_lock), (
f"Lockfile already exists at: {poetry_lock}"
)

# Run a resolution, to ensure that the lockfile exists.
# TODO(charlie): Make this a `setup`.
Expand Down Expand Up @@ -536,9 +536,9 @@ def install_cold(self, requirements_file: str, *, cwd: str) -> Command | None:
self.setup(requirements_file, cwd=cwd)

poetry_lock = os.path.join(cwd, "poetry.lock")
assert not os.path.exists(
poetry_lock
), f"Lockfile already exists at: {poetry_lock}"
assert not os.path.exists(poetry_lock), (
f"Lockfile already exists at: {poetry_lock}"
)

# Run a resolution, to ensure that the lockfile exists.
# TODO(charlie): Make this a `setup`.
Expand Down Expand Up @@ -581,9 +581,9 @@ def install_warm(self, requirements_file: str, *, cwd: str) -> Command | None:
self.setup(requirements_file, cwd=cwd)

poetry_lock = os.path.join(cwd, "poetry.lock")
assert not os.path.exists(
poetry_lock
), f"Lockfile already exists at: {poetry_lock}"
assert not os.path.exists(poetry_lock), (
f"Lockfile already exists at: {poetry_lock}"
)

# Run a resolution, to ensure that the lockfile exists.
subprocess.check_call(
Expand Down
2 changes: 1 addition & 1 deletion scripts/popular_packages/pypi_10k_most_dependents.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
" if i not in responses:\n",
" # https://libraries.io/api#project-search\n",
" sort = \"dependents_count\"\n",
" url = f\"https://libraries.io/api/search?platforms=Pypi&per_page=100&page={i+1}&sort{sort}&api_key={api_key}\"\n",
" url = f\"https://libraries.io/api/search?platforms=Pypi&per_page=100&page={i + 1}&sort{sort}&api_key={api_key}\"\n",
" responses[i] = httpx.get(url, timeout=30.0).json()"
]
},
Expand Down
8 changes: 4 additions & 4 deletions scripts/publish/test_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ def publish_project(target: str, uv: Path, client: httpx.Client):
):
raise RuntimeError(
f"PyPI re-upload of the same files failed: "
f"{output.count("Uploading")} != {len(expected_filenames)}, "
f"{output.count("already exists")} != 0\n"
f"{output.count('Uploading')} != {len(expected_filenames)}, "
f"{output.count('already exists')} != 0\n"
f"---\n{output}\n---"
)

Expand Down Expand Up @@ -407,8 +407,8 @@ def publish_project(target: str, uv: Path, client: httpx.Client):
):
raise RuntimeError(
f"Re-upload with check URL failed: "
f"{output.count("Uploading")} != 0, "
f"{output.count("already exists")} != {len(expected_filenames)}\n"
f"{output.count('Uploading')} != 0, "
f"{output.count('already exists')} != {len(expected_filenames)}\n"
f"---\n{output}\n---"
)

Expand Down
6 changes: 3 additions & 3 deletions scripts/scenarios/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ def update_common_mod_rs(packse_version: str):
url_matcher = re.compile(
re.escape(before_version) + '[^"]+' + re.escape(after_version)
)
assert (
len(url_matcher.findall(test_common)) == 1
), f"PACKSE_VERSION not found in {TESTS_COMMON_MOD_RS}"
assert len(url_matcher.findall(test_common)) == 1, (
f"PACKSE_VERSION not found in {TESTS_COMMON_MOD_RS}"
)
test_common = url_matcher.sub(build_vendor_links_url, test_common)
TESTS_COMMON_MOD_RS.write_text(test_common)

Expand Down

0 comments on commit 359ef28

Please sign in to comment.