Upgrade to the latest Ruff version (#10433)

This commit is contained in:
Charlie Marsh 2025-01-09 10:47:25 -05:00 committed by GitHub
parent 15ec830bea
commit 359ef288f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 20 additions and 20 deletions

View file

@ -443,9 +443,9 @@ class Poetry(Suite):
self.setup(requirements_file, cwd=cwd) self.setup(requirements_file, cwd=cwd)
poetry_lock = os.path.join(cwd, "poetry.lock") poetry_lock = os.path.join(cwd, "poetry.lock")
assert not os.path.exists( assert not os.path.exists(poetry_lock), (
poetry_lock f"Lockfile already exists at: {poetry_lock}"
), f"Lockfile already exists at: {poetry_lock}" )
# Run a resolution, to ensure that the lockfile exists. # Run a resolution, to ensure that the lockfile exists.
# TODO(charlie): Make this a `setup`. # TODO(charlie): Make this a `setup`.
@ -499,9 +499,9 @@ class Poetry(Suite):
self.setup(requirements_file, cwd=cwd) self.setup(requirements_file, cwd=cwd)
poetry_lock = os.path.join(cwd, "poetry.lock") poetry_lock = os.path.join(cwd, "poetry.lock")
assert not os.path.exists( assert not os.path.exists(poetry_lock), (
poetry_lock f"Lockfile already exists at: {poetry_lock}"
), f"Lockfile already exists at: {poetry_lock}" )
# Run a resolution, to ensure that the lockfile exists. # Run a resolution, to ensure that the lockfile exists.
# TODO(charlie): Make this a `setup`. # TODO(charlie): Make this a `setup`.
@ -536,9 +536,9 @@ class Poetry(Suite):
self.setup(requirements_file, cwd=cwd) self.setup(requirements_file, cwd=cwd)
poetry_lock = os.path.join(cwd, "poetry.lock") poetry_lock = os.path.join(cwd, "poetry.lock")
assert not os.path.exists( assert not os.path.exists(poetry_lock), (
poetry_lock f"Lockfile already exists at: {poetry_lock}"
), f"Lockfile already exists at: {poetry_lock}" )
# Run a resolution, to ensure that the lockfile exists. # Run a resolution, to ensure that the lockfile exists.
# TODO(charlie): Make this a `setup`. # TODO(charlie): Make this a `setup`.
@ -581,9 +581,9 @@ class Poetry(Suite):
self.setup(requirements_file, cwd=cwd) self.setup(requirements_file, cwd=cwd)
poetry_lock = os.path.join(cwd, "poetry.lock") poetry_lock = os.path.join(cwd, "poetry.lock")
assert not os.path.exists( assert not os.path.exists(poetry_lock), (
poetry_lock f"Lockfile already exists at: {poetry_lock}"
), f"Lockfile already exists at: {poetry_lock}" )
# Run a resolution, to ensure that the lockfile exists. # Run a resolution, to ensure that the lockfile exists.
subprocess.check_call( subprocess.check_call(

View file

@ -37,7 +37,7 @@
" if i not in responses:\n", " if i not in responses:\n",
" # https://libraries.io/api#project-search\n", " # https://libraries.io/api#project-search\n",
" sort = \"dependents_count\"\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()" " responses[i] = httpx.get(url, timeout=30.0).json()"
] ]
}, },

View file

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

View file

@ -269,9 +269,9 @@ def update_common_mod_rs(packse_version: str):
url_matcher = re.compile( url_matcher = re.compile(
re.escape(before_version) + '[^"]+' + re.escape(after_version) re.escape(before_version) + '[^"]+' + re.escape(after_version)
) )
assert ( assert len(url_matcher.findall(test_common)) == 1, (
len(url_matcher.findall(test_common)) == 1 f"PACKSE_VERSION not found in {TESTS_COMMON_MOD_RS}"
), f"PACKSE_VERSION not found in {TESTS_COMMON_MOD_RS}" )
test_common = url_matcher.sub(build_vendor_links_url, test_common) test_common = url_matcher.sub(build_vendor_links_url, test_common)
TESTS_COMMON_MOD_RS.write_text(test_common) TESTS_COMMON_MOD_RS.write_text(test_common)