From fc6ef5d0dd21a2a98a7fc6956e4f16166cb6562a Mon Sep 17 00:00:00 2001 From: charliermarsh Date: Thu, 12 Dec 2024 15:22:54 +0000 Subject: [PATCH 1/5] Mirror: 0.8.3 --- README.md | 12 ++++++------ pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4cc8893..0d96ecc 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # ruff-pre-commit [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) -[![image](https://img.shields.io/pypi/v/ruff/0.8.2.svg)](https://pypi.python.org/pypi/ruff) -[![image](https://img.shields.io/pypi/l/ruff/0.8.2.svg)](https://pypi.python.org/pypi/ruff) -[![image](https://img.shields.io/pypi/pyversions/ruff/0.8.2.svg)](https://pypi.python.org/pypi/ruff) +[![image](https://img.shields.io/pypi/v/ruff/0.8.3.svg)](https://pypi.python.org/pypi/ruff) +[![image](https://img.shields.io/pypi/l/ruff/0.8.3.svg)](https://pypi.python.org/pypi/ruff) +[![image](https://img.shields.io/pypi/pyversions/ruff/0.8.3.svg)](https://pypi.python.org/pypi/ruff) [![Actions status](https://github.com/astral-sh/ruff-pre-commit/workflows/main/badge.svg)](https://github.com/astral-sh/ruff-pre-commit/actions) A [pre-commit](https://pre-commit.com/) hook for [Ruff](https://github.com/astral-sh/ruff). @@ -20,7 +20,7 @@ To run Ruff's [linter](https://docs.astral.sh/ruff/linter) and [formatter](https repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.8.2 + rev: v0.8.3 hooks: # Run the linter. - id: ruff @@ -34,7 +34,7 @@ To enable lint fixes, add the `--fix` argument to the lint hook: repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.8.2 + rev: v0.8.3 hooks: # Run the linter. - id: ruff @@ -49,7 +49,7 @@ To avoid running on Jupyter Notebooks, remove `jupyter` from the list of allowed repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.8.2 + rev: v0.8.3 hooks: # Run the linter. - id: ruff diff --git a/pyproject.toml b/pyproject.toml index 7206a4d..5a4ebe7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "ruff-pre-commit" version = "0.0.0" dependencies = [ - "ruff==0.8.2", + "ruff==0.8.3", ] [project.optional-dependencies] From f0b5944bef86f50d875305821a0ab0d8c601e465 Mon Sep 17 00:00:00 2001 From: charliermarsh Date: Thu, 19 Dec 2024 13:41:32 +0000 Subject: [PATCH 2/5] Mirror: 0.8.4 --- README.md | 12 ++++++------ pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0d96ecc..43151fa 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # ruff-pre-commit [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) -[![image](https://img.shields.io/pypi/v/ruff/0.8.3.svg)](https://pypi.python.org/pypi/ruff) -[![image](https://img.shields.io/pypi/l/ruff/0.8.3.svg)](https://pypi.python.org/pypi/ruff) -[![image](https://img.shields.io/pypi/pyversions/ruff/0.8.3.svg)](https://pypi.python.org/pypi/ruff) +[![image](https://img.shields.io/pypi/v/ruff/0.8.4.svg)](https://pypi.python.org/pypi/ruff) +[![image](https://img.shields.io/pypi/l/ruff/0.8.4.svg)](https://pypi.python.org/pypi/ruff) +[![image](https://img.shields.io/pypi/pyversions/ruff/0.8.4.svg)](https://pypi.python.org/pypi/ruff) [![Actions status](https://github.com/astral-sh/ruff-pre-commit/workflows/main/badge.svg)](https://github.com/astral-sh/ruff-pre-commit/actions) A [pre-commit](https://pre-commit.com/) hook for [Ruff](https://github.com/astral-sh/ruff). @@ -20,7 +20,7 @@ To run Ruff's [linter](https://docs.astral.sh/ruff/linter) and [formatter](https repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.8.3 + rev: v0.8.4 hooks: # Run the linter. - id: ruff @@ -34,7 +34,7 @@ To enable lint fixes, add the `--fix` argument to the lint hook: repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.8.3 + rev: v0.8.4 hooks: # Run the linter. - id: ruff @@ -49,7 +49,7 @@ To avoid running on Jupyter Notebooks, remove `jupyter` from the list of allowed repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.8.3 + rev: v0.8.4 hooks: # Run the linter. - id: ruff diff --git a/pyproject.toml b/pyproject.toml index 5a4ebe7..6a43f1c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "ruff-pre-commit" version = "0.0.0" dependencies = [ - "ruff==0.8.3", + "ruff==0.8.4", ] [project.optional-dependencies] From 6299d2ca232741e7e33e7fd8a5a10059bd743da7 Mon Sep 17 00:00:00 2001 From: Calum Young <32770960+calumy@users.noreply.github.com> Date: Mon, 30 Dec 2024 15:48:39 +0000 Subject: [PATCH 3/5] Update mirror.py to a uv script (#110) ## Summary From my reading of the [UV docs](https://docs.astral.sh/uv/guides/scripts/), `mirror.py` would be a good example of a standalone script. This PR updates `mirror.py` and the `main.yml` workflow to be a UV script and makes use of UV in the update process. ## Test Plan - Update the uv version (currently 0.8.4) to an older version e.g. 0.8.3 in both `pyproject.toml` and `README.md` - Run `uv run --no-project mirror.py` to check the update process still works as expected --- .github/workflows/main.yml | 12 +++--------- mirror.py | 9 +++++++++ pyproject.toml | 6 ------ requirements-dev.txt | 11 ----------- 4 files changed, 12 insertions(+), 26 deletions(-) delete mode 100644 requirements-dev.txt diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cfc9a44..5925bd8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,21 +16,15 @@ jobs: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.11" - - - name: download uv - run: curl -LsSf https://astral.sh/uv/install.sh | sh - - - run: uv pip install --system -r requirements-dev.txt + - name: Install uv + uses: astral-sh/setup-uv@v5 - name: set git config run: | git config user.name "$GITHUB_ACTOR" git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - - run: python mirror.py + - run: uv run --no-project mirror.py - name: check for unpushed commits id: check_unpushed diff --git a/mirror.py b/mirror.py index 7a8bbe8..a1df4cd 100644 --- a/mirror.py +++ b/mirror.py @@ -1,3 +1,12 @@ +# /// script +# requires-python = ">=3.12" +# dependencies = [ +# "packaging==23.1", +# "urllib3==2.0.5", +# ] +# /// +"""Update ruff-pre-commit to the latest version of ruff.""" + import re import subprocess import tomllib diff --git a/pyproject.toml b/pyproject.toml index 6a43f1c..7dfb90f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,9 +4,3 @@ version = "0.0.0" dependencies = [ "ruff==0.8.4", ] - -[project.optional-dependencies] -dev = [ - "packaging~=23.1", - "urllib3>=2.0.5,<3.0.0", -] diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index c98d526..0000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,11 +0,0 @@ -# This file was autogenerated by uv via the following command: -# uv pip compile --extra=dev --generate-hashes -o requirements-dev.txt --no-emit-package=ruff pyproject.toml -packaging==23.1 \ - --hash=sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61 \ - --hash=sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f -urllib3==2.0.5 \ - --hash=sha256:13abf37382ea2ce6fb744d4dad67838eec857c9f4f57009891805e0b5e123594 \ - --hash=sha256:ef16afa8ba34a1f989db38e1dbbe0c302e4289a47856990d0682e374563ce35e - -# The following packages were excluded from the output: -# ruff From 751b8b57ba617d78eec57b4ec91753568a8a496c Mon Sep 17 00:00:00 2001 From: charliermarsh Date: Thu, 2 Jan 2025 12:09:30 +0000 Subject: [PATCH 4/5] Mirror: 0.8.5 --- README.md | 12 ++++++------ pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 43151fa..9a7ebe0 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # ruff-pre-commit [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) -[![image](https://img.shields.io/pypi/v/ruff/0.8.4.svg)](https://pypi.python.org/pypi/ruff) -[![image](https://img.shields.io/pypi/l/ruff/0.8.4.svg)](https://pypi.python.org/pypi/ruff) -[![image](https://img.shields.io/pypi/pyversions/ruff/0.8.4.svg)](https://pypi.python.org/pypi/ruff) +[![image](https://img.shields.io/pypi/v/ruff/0.8.5.svg)](https://pypi.python.org/pypi/ruff) +[![image](https://img.shields.io/pypi/l/ruff/0.8.5.svg)](https://pypi.python.org/pypi/ruff) +[![image](https://img.shields.io/pypi/pyversions/ruff/0.8.5.svg)](https://pypi.python.org/pypi/ruff) [![Actions status](https://github.com/astral-sh/ruff-pre-commit/workflows/main/badge.svg)](https://github.com/astral-sh/ruff-pre-commit/actions) A [pre-commit](https://pre-commit.com/) hook for [Ruff](https://github.com/astral-sh/ruff). @@ -20,7 +20,7 @@ To run Ruff's [linter](https://docs.astral.sh/ruff/linter) and [formatter](https repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.8.4 + rev: v0.8.5 hooks: # Run the linter. - id: ruff @@ -34,7 +34,7 @@ To enable lint fixes, add the `--fix` argument to the lint hook: repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.8.4 + rev: v0.8.5 hooks: # Run the linter. - id: ruff @@ -49,7 +49,7 @@ To avoid running on Jupyter Notebooks, remove `jupyter` from the list of allowed repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.8.4 + rev: v0.8.5 hooks: # Run the linter. - id: ruff diff --git a/pyproject.toml b/pyproject.toml index 7dfb90f..2162bb8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,5 +2,5 @@ name = "ruff-pre-commit" version = "0.0.0" dependencies = [ - "ruff==0.8.4", + "ruff==0.8.5", ] From 89c421dff2e1026ba12cdb9ebd731f4a83aa8021 Mon Sep 17 00:00:00 2001 From: charliermarsh Date: Sat, 4 Jan 2025 12:28:02 +0000 Subject: [PATCH 5/5] Mirror: 0.8.6 --- README.md | 12 ++++++------ pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9a7ebe0..702798e 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # ruff-pre-commit [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) -[![image](https://img.shields.io/pypi/v/ruff/0.8.5.svg)](https://pypi.python.org/pypi/ruff) -[![image](https://img.shields.io/pypi/l/ruff/0.8.5.svg)](https://pypi.python.org/pypi/ruff) -[![image](https://img.shields.io/pypi/pyversions/ruff/0.8.5.svg)](https://pypi.python.org/pypi/ruff) +[![image](https://img.shields.io/pypi/v/ruff/0.8.6.svg)](https://pypi.python.org/pypi/ruff) +[![image](https://img.shields.io/pypi/l/ruff/0.8.6.svg)](https://pypi.python.org/pypi/ruff) +[![image](https://img.shields.io/pypi/pyversions/ruff/0.8.6.svg)](https://pypi.python.org/pypi/ruff) [![Actions status](https://github.com/astral-sh/ruff-pre-commit/workflows/main/badge.svg)](https://github.com/astral-sh/ruff-pre-commit/actions) A [pre-commit](https://pre-commit.com/) hook for [Ruff](https://github.com/astral-sh/ruff). @@ -20,7 +20,7 @@ To run Ruff's [linter](https://docs.astral.sh/ruff/linter) and [formatter](https repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.8.5 + rev: v0.8.6 hooks: # Run the linter. - id: ruff @@ -34,7 +34,7 @@ To enable lint fixes, add the `--fix` argument to the lint hook: repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.8.5 + rev: v0.8.6 hooks: # Run the linter. - id: ruff @@ -49,7 +49,7 @@ To avoid running on Jupyter Notebooks, remove `jupyter` from the list of allowed repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.8.5 + rev: v0.8.6 hooks: # Run the linter. - id: ruff diff --git a/pyproject.toml b/pyproject.toml index 2162bb8..ead38f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,5 +2,5 @@ name = "ruff-pre-commit" version = "0.0.0" dependencies = [ - "ruff==0.8.5", + "ruff==0.8.6", ]