mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
Fix Ruff linting (#14111)
Some checks are pending
CI / build binary | macos x86_64 (push) Blocked by required conditions
CI / build binary | windows x86_64 (push) Blocked by required conditions
CI / build binary | windows aarch64 (push) Blocked by required conditions
CI / cargo build (msrv) (push) Blocked by required conditions
CI / integration test | free-threaded python on github actions (push) Blocked by required conditions
CI / integration test | determine publish changes (push) Blocked by required conditions
CI / integration test | uv publish (push) Blocked by required conditions
CI / integration test | uv_build (push) Blocked by required conditions
CI / check cache | ubuntu (push) Blocked by required conditions
CI / check cache | macos aarch64 (push) Blocked by required conditions
CI / check system | python on debian (push) Blocked by required conditions
CI / check system | python on fedora (push) Blocked by required conditions
CI / check system | python on ubuntu (push) Blocked by required conditions
CI / check system | python on rocky linux 8 (push) Blocked by required conditions
CI / check system | python on rocky linux 9 (push) Blocked by required conditions
CI / check system | graalpy on ubuntu (push) Blocked by required conditions
CI / check system | pypy on ubuntu (push) Blocked by required conditions
CI / check system | pyston (push) Blocked by required conditions
CI / check system | python on macos aarch64 (push) Blocked by required conditions
CI / Determine changes (push) Waiting to run
CI / lint (push) Waiting to run
CI / cargo clippy | ubuntu (push) Blocked by required conditions
CI / cargo clippy | windows (push) Blocked by required conditions
CI / cargo dev generate-all (push) Blocked by required conditions
CI / cargo shear (push) Waiting to run
CI / cargo test | ubuntu (push) Blocked by required conditions
CI / cargo test | macos (push) Blocked by required conditions
CI / cargo test | windows (push) Blocked by required conditions
CI / check windows trampoline | aarch64 (push) Blocked by required conditions
CI / check windows trampoline | i686 (push) Blocked by required conditions
CI / check windows trampoline | x86_64 (push) Blocked by required conditions
CI / test windows trampoline | i686 (push) Blocked by required conditions
CI / test windows trampoline | x86_64 (push) Blocked by required conditions
CI / typos (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / build binary | linux libc (push) Blocked by required conditions
CI / build binary | linux musl (push) Blocked by required conditions
CI / build binary | macos aarch64 (push) Blocked by required conditions
CI / build binary | freebsd (push) Blocked by required conditions
CI / ecosystem test | pydantic/pydantic-core (push) Blocked by required conditions
CI / ecosystem test | prefecthq/prefect (push) Blocked by required conditions
CI / ecosystem test | pallets/flask (push) Blocked by required conditions
CI / smoke test | linux (push) Blocked by required conditions
CI / check system | alpine (push) Blocked by required conditions
CI / smoke test | macos (push) Blocked by required conditions
CI / smoke test | windows x86_64 (push) Blocked by required conditions
CI / smoke test | windows aarch64 (push) Blocked by required conditions
CI / integration test | conda on ubuntu (push) Blocked by required conditions
CI / integration test | deadsnakes python3.9 on ubuntu (push) Blocked by required conditions
CI / integration test | free-threaded on windows (push) Blocked by required conditions
CI / integration test | pypy on ubuntu (push) Blocked by required conditions
CI / integration test | pypy on windows (push) Blocked by required conditions
CI / integration test | graalpy on ubuntu (push) Blocked by required conditions
CI / integration test | graalpy on windows (push) Blocked by required conditions
CI / integration test | pyodide on ubuntu (push) Blocked by required conditions
CI / integration test | github actions (push) Blocked by required conditions
CI / check system | python on macos x86-64 (push) Blocked by required conditions
CI / check system | homebrew python on macos aarch64 (push) Blocked by required conditions
CI / check system | python3.10 on windows x86-64 (push) Blocked by required conditions
CI / check system | python3.10 on windows x86 (push) Blocked by required conditions
CI / check system | python3.13 on windows x86-64 (push) Blocked by required conditions
CI / check system | x86-64 python3.13 on windows aarch64 (push) Blocked by required conditions
CI / check system | windows registry (push) Blocked by required conditions
CI / check system | python3.12 via chocolatey (push) Blocked by required conditions
CI / check system | python3.9 via pyenv (push) Blocked by required conditions
CI / check system | python3.13 (push) Blocked by required conditions
CI / check system | conda3.11 on macos aarch64 (push) Blocked by required conditions
CI / check system | conda3.8 on macos aarch64 (push) Blocked by required conditions
CI / check system | conda3.11 on linux x86-64 (push) Blocked by required conditions
CI / check system | conda3.8 on linux x86-64 (push) Blocked by required conditions
CI / check system | conda3.11 on windows x86-64 (push) Blocked by required conditions
CI / check system | conda3.8 on windows x86-64 (push) Blocked by required conditions
CI / check system | amazonlinux (push) Blocked by required conditions
CI / check system | embedded python3.10 on windows x86-64 (push) Blocked by required conditions
CI / benchmarks | walltime aarch64 linux (push) Blocked by required conditions
CI / benchmarks | instrumented (push) Blocked by required conditions
Some checks are pending
CI / build binary | macos x86_64 (push) Blocked by required conditions
CI / build binary | windows x86_64 (push) Blocked by required conditions
CI / build binary | windows aarch64 (push) Blocked by required conditions
CI / cargo build (msrv) (push) Blocked by required conditions
CI / integration test | free-threaded python on github actions (push) Blocked by required conditions
CI / integration test | determine publish changes (push) Blocked by required conditions
CI / integration test | uv publish (push) Blocked by required conditions
CI / integration test | uv_build (push) Blocked by required conditions
CI / check cache | ubuntu (push) Blocked by required conditions
CI / check cache | macos aarch64 (push) Blocked by required conditions
CI / check system | python on debian (push) Blocked by required conditions
CI / check system | python on fedora (push) Blocked by required conditions
CI / check system | python on ubuntu (push) Blocked by required conditions
CI / check system | python on rocky linux 8 (push) Blocked by required conditions
CI / check system | python on rocky linux 9 (push) Blocked by required conditions
CI / check system | graalpy on ubuntu (push) Blocked by required conditions
CI / check system | pypy on ubuntu (push) Blocked by required conditions
CI / check system | pyston (push) Blocked by required conditions
CI / check system | python on macos aarch64 (push) Blocked by required conditions
CI / Determine changes (push) Waiting to run
CI / lint (push) Waiting to run
CI / cargo clippy | ubuntu (push) Blocked by required conditions
CI / cargo clippy | windows (push) Blocked by required conditions
CI / cargo dev generate-all (push) Blocked by required conditions
CI / cargo shear (push) Waiting to run
CI / cargo test | ubuntu (push) Blocked by required conditions
CI / cargo test | macos (push) Blocked by required conditions
CI / cargo test | windows (push) Blocked by required conditions
CI / check windows trampoline | aarch64 (push) Blocked by required conditions
CI / check windows trampoline | i686 (push) Blocked by required conditions
CI / check windows trampoline | x86_64 (push) Blocked by required conditions
CI / test windows trampoline | i686 (push) Blocked by required conditions
CI / test windows trampoline | x86_64 (push) Blocked by required conditions
CI / typos (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / build binary | linux libc (push) Blocked by required conditions
CI / build binary | linux musl (push) Blocked by required conditions
CI / build binary | macos aarch64 (push) Blocked by required conditions
CI / build binary | freebsd (push) Blocked by required conditions
CI / ecosystem test | pydantic/pydantic-core (push) Blocked by required conditions
CI / ecosystem test | prefecthq/prefect (push) Blocked by required conditions
CI / ecosystem test | pallets/flask (push) Blocked by required conditions
CI / smoke test | linux (push) Blocked by required conditions
CI / check system | alpine (push) Blocked by required conditions
CI / smoke test | macos (push) Blocked by required conditions
CI / smoke test | windows x86_64 (push) Blocked by required conditions
CI / smoke test | windows aarch64 (push) Blocked by required conditions
CI / integration test | conda on ubuntu (push) Blocked by required conditions
CI / integration test | deadsnakes python3.9 on ubuntu (push) Blocked by required conditions
CI / integration test | free-threaded on windows (push) Blocked by required conditions
CI / integration test | pypy on ubuntu (push) Blocked by required conditions
CI / integration test | pypy on windows (push) Blocked by required conditions
CI / integration test | graalpy on ubuntu (push) Blocked by required conditions
CI / integration test | graalpy on windows (push) Blocked by required conditions
CI / integration test | pyodide on ubuntu (push) Blocked by required conditions
CI / integration test | github actions (push) Blocked by required conditions
CI / check system | python on macos x86-64 (push) Blocked by required conditions
CI / check system | homebrew python on macos aarch64 (push) Blocked by required conditions
CI / check system | python3.10 on windows x86-64 (push) Blocked by required conditions
CI / check system | python3.10 on windows x86 (push) Blocked by required conditions
CI / check system | python3.13 on windows x86-64 (push) Blocked by required conditions
CI / check system | x86-64 python3.13 on windows aarch64 (push) Blocked by required conditions
CI / check system | windows registry (push) Blocked by required conditions
CI / check system | python3.12 via chocolatey (push) Blocked by required conditions
CI / check system | python3.9 via pyenv (push) Blocked by required conditions
CI / check system | python3.13 (push) Blocked by required conditions
CI / check system | conda3.11 on macos aarch64 (push) Blocked by required conditions
CI / check system | conda3.8 on macos aarch64 (push) Blocked by required conditions
CI / check system | conda3.11 on linux x86-64 (push) Blocked by required conditions
CI / check system | conda3.8 on linux x86-64 (push) Blocked by required conditions
CI / check system | conda3.11 on windows x86-64 (push) Blocked by required conditions
CI / check system | conda3.8 on windows x86-64 (push) Blocked by required conditions
CI / check system | amazonlinux (push) Blocked by required conditions
CI / check system | embedded python3.10 on windows x86-64 (push) Blocked by required conditions
CI / benchmarks | walltime aarch64 linux (push) Blocked by required conditions
CI / benchmarks | instrumented (push) Blocked by required conditions
This commit is contained in:
parent
10e1d17cfc
commit
c25c800367
9 changed files with 20 additions and 16 deletions
2
crates/uv-build/ruff.toml
Normal file
2
crates/uv-build/ruff.toml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# It is important retain compatibility with old versions in the build backend
|
||||||
|
target-version = "py37"
|
|
@ -630,7 +630,9 @@ class GraalPyFinder(Finder):
|
||||||
for download in batch:
|
for download in batch:
|
||||||
url = download.url + ".sha256"
|
url = download.url + ".sha256"
|
||||||
checksum_requests.append(self.client.get(url))
|
checksum_requests.append(self.client.get(url))
|
||||||
for download, resp in zip(batch, await asyncio.gather(*checksum_requests)):
|
for download, resp in zip(
|
||||||
|
batch, await asyncio.gather(*checksum_requests), strict=False
|
||||||
|
):
|
||||||
try:
|
try:
|
||||||
resp.raise_for_status()
|
resp.raise_for_status()
|
||||||
except httpx.HTTPStatusError as e:
|
except httpx.HTTPStatusError as e:
|
||||||
|
|
|
@ -39,10 +39,9 @@ if hasattr(sys, "implementation"):
|
||||||
# GraalPy reports the CPython version as sys.implementation.version,
|
# GraalPy reports the CPython version as sys.implementation.version,
|
||||||
# so we need to discover the GraalPy version from the cache_tag
|
# so we need to discover the GraalPy version from the cache_tag
|
||||||
import re
|
import re
|
||||||
|
|
||||||
implementation_version = re.sub(
|
implementation_version = re.sub(
|
||||||
r"graalpy(\d)(\d+)-\d+",
|
r"graalpy(\d)(\d+)-\d+", r"\1.\2", sys.implementation.cache_tag
|
||||||
r"\1.\2",
|
|
||||||
sys.implementation.cache_tag
|
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
implementation_version = format_full_version(sys.implementation.version)
|
implementation_version = format_full_version(sys.implementation.version)
|
||||||
|
@ -583,7 +582,6 @@ def main() -> None:
|
||||||
elif os_and_arch["os"]["name"] == "musllinux":
|
elif os_and_arch["os"]["name"] == "musllinux":
|
||||||
manylinux_compatible = True
|
manylinux_compatible = True
|
||||||
|
|
||||||
|
|
||||||
# By default, pip uses sysconfig on Python 3.10+.
|
# By default, pip uses sysconfig on Python 3.10+.
|
||||||
# But Python distributors can override this decision by setting:
|
# But Python distributors can override this decision by setting:
|
||||||
# sysconfig._PIP_USE_SYSCONFIG = True / False
|
# sysconfig._PIP_USE_SYSCONFIG = True / False
|
||||||
|
@ -608,7 +606,7 @@ def main() -> None:
|
||||||
except (ImportError, AttributeError):
|
except (ImportError, AttributeError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
import distutils.dist
|
import distutils.dist # noqa: F401
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# We require distutils, but it's not installed; this is fairly
|
# We require distutils, but it's not installed; this is fairly
|
||||||
# common in, e.g., deadsnakes where distutils is packaged
|
# common in, e.g., deadsnakes where distutils is packaged
|
||||||
|
@ -641,7 +639,10 @@ def main() -> None:
|
||||||
# Prior to the introduction of `sysconfig` patching, python-build-standalone installations would always use
|
# Prior to the introduction of `sysconfig` patching, python-build-standalone installations would always use
|
||||||
# "/install" as the prefix. With `sysconfig` patching, we rewrite the prefix to match the actual installation
|
# "/install" as the prefix. With `sysconfig` patching, we rewrite the prefix to match the actual installation
|
||||||
# location. So in newer versions, we also write a dedicated flag to indicate standalone builds.
|
# location. So in newer versions, we also write a dedicated flag to indicate standalone builds.
|
||||||
"standalone": sysconfig.get_config_var("prefix") == "/install" or bool(sysconfig.get_config_var("PYTHON_BUILD_STANDALONE")),
|
"standalone": (
|
||||||
|
sysconfig.get_config_var("prefix") == "/install"
|
||||||
|
or bool(sysconfig.get_config_var("PYTHON_BUILD_STANDALONE"))
|
||||||
|
),
|
||||||
"scheme": get_scheme(use_sysconfig_scheme),
|
"scheme": get_scheme(use_sysconfig_scheme),
|
||||||
"virtualenv": get_virtualenv(),
|
"virtualenv": get_virtualenv(),
|
||||||
"platform": os_and_arch,
|
"platform": os_and_arch,
|
||||||
|
|
|
@ -69,8 +69,7 @@ class ELFFile:
|
||||||
}[(self.capacity, self.encoding)]
|
}[(self.capacity, self.encoding)]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise ELFInvalid(
|
raise ELFInvalid(
|
||||||
f"unrecognized capacity ({self.capacity}) or "
|
f"unrecognized capacity ({self.capacity}) or encoding ({self.encoding})"
|
||||||
f"encoding ({self.encoding})"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -161,8 +161,7 @@ def _parse_glibc_version(version_str: str) -> _GLibCVersion:
|
||||||
m = re.match(r"(?P<major>[0-9]+)\.(?P<minor>[0-9]+)", version_str)
|
m = re.match(r"(?P<major>[0-9]+)\.(?P<minor>[0-9]+)", version_str)
|
||||||
if not m:
|
if not m:
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
f"Expected glibc version with 2 components major.minor,"
|
f"Expected glibc version with 2 components major.minor, got: {version_str}",
|
||||||
f" got: {version_str}",
|
|
||||||
RuntimeWarning,
|
RuntimeWarning,
|
||||||
)
|
)
|
||||||
return _GLibCVersion(-1, -1)
|
return _GLibCVersion(-1, -1)
|
||||||
|
|
2
crates/uv-python/python/ruff.toml
Normal file
2
crates/uv-python/python/ruff.toml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# It is important retain compatibility when querying interpreters
|
||||||
|
target-version = "py37"
|
|
@ -1,10 +1,10 @@
|
||||||
target-version = "py37"
|
target-version = "py312"
|
||||||
exclude = [
|
exclude = [
|
||||||
"crates/uv-virtualenv/src/activator/activate_this.py",
|
"crates/uv-virtualenv/src/activator/activate_this.py",
|
||||||
"crates/uv-virtualenv/src/_virtualenv.py",
|
"crates/uv-virtualenv/src/_virtualenv.py",
|
||||||
"crates/uv-python/python",
|
|
||||||
"ecosystem",
|
"ecosystem",
|
||||||
"scripts/workspaces",
|
"scripts/workspaces",
|
||||||
|
"scripts/packages",
|
||||||
]
|
]
|
||||||
|
|
||||||
[lint]
|
[lint]
|
||||||
|
|
|
@ -9,11 +9,10 @@ from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import re
|
import re
|
||||||
|
import tomllib
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import tomllib
|
|
||||||
|
|
||||||
# To be kept in sync with: `docs/index.md`
|
# To be kept in sync with: `docs/index.md`
|
||||||
URL = "https://github.com/astral-sh/uv/assets/1309177/{}"
|
URL = "https://github.com/astral-sh/uv/assets/1309177/{}"
|
||||||
URL_LIGHT = URL.format("629e59c0-9c6e-4013-9ad4-adb2bcf5080d")
|
URL_LIGHT = URL.format("629e59c0-9c6e-4013-9ad4-adb2bcf5080d")
|
||||||
|
|
|
@ -5,5 +5,5 @@ def fly():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == "__main__":
|
||||||
print("Caw")
|
print("Caw")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue