diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61754e5b8..309231b30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,11 +23,22 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: "Install Rust toolchain" + + - name: "Install Rustfmt" run: rustup component add rustfmt + - name: "rustfmt" run: cargo fmt --all --check + - name: "Prettier" + run: npx prettier --check "**/*.{yaml,yml}" + + - name: "Ruff format" + run: pipx run ruff format --diff . + + - name: "Ruff check" + run: pipx run ruff check . + cargo-clippy: name: "cargo clippy" strategy: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a6714a287..eb2a6bc92 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,4 +36,4 @@ repos: hooks: - id: ruff-format - id: ruff - args: [--fix, --exit-non-zero-on-fix] \ No newline at end of file + args: [--fix, --exit-non-zero-on-fix] diff --git a/crates/pep440-rs/test/test_python.py b/crates/pep440-rs/test/test_python.py index 0b031cdb5..ed43bc8d2 100644 --- a/crates/pep440-rs/test/test_python.py +++ b/crates/pep440-rs/test/test_python.py @@ -1,6 +1,7 @@ """ This is implementation has some very rudimentary python bindings """ + from pep440_rs import Version, VersionSpecifier, Operator, VersionSpecifiers diff --git a/python/uv/__main__.py b/python/uv/__main__.py index 5337ed63c..1524c19fe 100644 --- a/python/uv/__main__.py +++ b/python/uv/__main__.py @@ -22,6 +22,7 @@ def _detect_virtualenv() -> str: return "" + def _run() -> None: uv = os.fsdecode(find_uv_bin()) @@ -39,6 +40,5 @@ def _run() -> None: os.execvpe(uv, [uv, *sys.argv[1:]], env=env) - if __name__ == "__main__": _run() diff --git a/scripts/bench/__main__.py b/scripts/bench/__main__.py index 87b244cff..a08c1ff31 100644 --- a/scripts/bench/__main__.py +++ b/scripts/bench/__main__.py @@ -25,6 +25,7 @@ each build, as in: --uv-path ./target/release/baseline \ requirements.in """ + import abc import argparse import enum @@ -271,11 +272,9 @@ class PipCompile(Suite): ], ) - def install_cold(self, requirements_file: str, *, cwd: str) -> Command | None: - ... + def install_cold(self, requirements_file: str, *, cwd: str) -> Command | None: ... - def install_warm(self, requirements_file: str, *, cwd: str) -> Command | None: - ... + def install_warm(self, requirements_file: str, *, cwd: str) -> Command | None: ... class PipSync(Suite): @@ -283,16 +282,13 @@ class PipSync(Suite): self.name = path or "pip-sync" self.path = path or "pip-sync" - def resolve_cold(self, requirements_file: str, *, cwd: str) -> Command | None: - ... + def resolve_cold(self, requirements_file: str, *, cwd: str) -> Command | None: ... - def resolve_warm(self, requirements_file: str, *, cwd: str) -> Command | None: - ... + def resolve_warm(self, requirements_file: str, *, cwd: str) -> Command | None: ... def resolve_incremental( self, requirements_file: str, *, cwd: str - ) -> Command | None: - ... + ) -> Command | None: ... def install_cold(self, requirements_file: str, *, cwd: str) -> Command | None: cache_dir = os.path.join(cwd, ".cache") diff --git a/scripts/bootstrap/fetch-version-metadata.py b/scripts/bootstrap/fetch-version-metadata.py index e946fee07..d3d5e4b25 100755 --- a/scripts/bootstrap/fetch-version-metadata.py +++ b/scripts/bootstrap/fetch-version-metadata.py @@ -17,6 +17,7 @@ Acknowledgements: Derived from https://github.com/mitsuhiko/rye/tree/f9822267a7f00332d15be8551f89a212e7bc9017 Originally authored by Armin Ronacher under the MIT license """ + import argparse import hashlib import json diff --git a/scripts/scenarios/generate.py b/scripts/scenarios/generate.py index 529552d2d..8574a5fc5 100755 --- a/scripts/scenarios/generate.py +++ b/scripts/scenarios/generate.py @@ -144,9 +144,9 @@ def main(scenarios: list[Path], snapshot_update: bool = True): "local-used-without-sdist", ): expected["satisfiable"] = False - expected[ - "explanation" - ] = "We do not have correct behavior for local version identifiers yet" + expected["explanation"] = ( + "We do not have correct behavior for local version identifiers yet" + ) # Split scenarios into `install` and `compile` cases install_scenarios = [] @@ -167,13 +167,13 @@ def main(scenarios: list[Path], snapshot_update: bool = True): ref = "HEAD" if packse_version == "0.0.0" else packse_version # Add generated metadata - data[ - "generated_from" - ] = f"https://github.com/zanieb/packse/tree/{ref}/scenarios" + data["generated_from"] = ( + f"https://github.com/zanieb/packse/tree/{ref}/scenarios" + ) data["generated_with"] = "./scripts/scenarios/sync.sh" - data[ - "vendor_links" - ] = f"https://raw.githubusercontent.com/zanieb/packse/{ref}/vendor/links.html" + data["vendor_links"] = ( + f"https://raw.githubusercontent.com/zanieb/packse/{ref}/vendor/links.html" + ) data["index_url"] = f"https://astral-sh.github.io/packse/{ref}/simple-html/"