From 27088123492b6f7925797a1e74be0665a0b1469b Mon Sep 17 00:00:00 2001 From: Tim Hatch Date: Thu, 12 Jun 2025 09:07:52 -0700 Subject: [PATCH 1/4] It's impl now --- deps/ick.toml | 2 +- gha/ick.toml | 2 +- ick.toml | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 ick.toml diff --git a/deps/ick.toml b/deps/ick.toml index 8b9b13d..1e70830 100644 --- a/deps/ick.toml +++ b/deps/ick.toml @@ -1,5 +1,5 @@ [[rule]] name = "bump" -language = "python" +impl = "python" inputs = ["requirements.txt"] deps = ["bumpreqs"] diff --git a/gha/ick.toml b/gha/ick.toml index 69fb19f..7f667f2 100644 --- a/gha/ick.toml +++ b/gha/ick.toml @@ -1,5 +1,5 @@ [[rule]] name = "upgrade" -language = "python" +impl = "python" deps = ["codemod-yaml"] inputs = [".github/workflows/*.yml"] diff --git a/ick.toml b/ick.toml new file mode 100644 index 0000000..6456a54 --- /dev/null +++ b/ick.toml @@ -0,0 +1,3 @@ +[[ruleset]] +path = "." +prefix = "" From 9f01208955970a7bebda1667d5ad0404d4203a67 Mon Sep 17 00:00:00 2001 From: Tim Hatch Date: Thu, 12 Jun 2025 09:21:55 -0700 Subject: [PATCH 2/4] Enable Actions --- .github/workflows/build.yml | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..bba96b5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,42 @@ +name: Build +on: + push: + branches: + - master + - main + - tmp-* + tags: + - v* + pull_request: + +env: + UV_SYSTEM_PYTHON: 1 + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + python-version: ["3.11", "3.12", "3.13"] + os: [macOS-latest, ubuntu-latest] + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set Up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - uses: astral-sh/setup-uv@v3 + - name: Install + run: | + uv pip install ick + - name: Test + run: | + git config --global user.name "Unit Test" + git config --global user.email "example@example.com" + make test + - name: Lint + run: | + make lint From c655d91d1cba6993b5c308be55c247a1caeaaad1 Mon Sep 17 00:00:00 2001 From: Tim Hatch Date: Thu, 12 Jun 2025 09:23:23 -0700 Subject: [PATCH 3/4] Forgot Makefile --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8779bfa --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +.PHONY: test +test: + ick --isolated-repo test-rules + +.PHONY: lint +lint: + From b628aed6374088fdbf0a7ed3bfe63da099e36a73 Mon Sep 17 00:00:00 2001 From: Tim Hatch Date: Thu, 12 Jun 2025 09:35:02 -0700 Subject: [PATCH 4/4] Validate that we're not using a certain dep --- deps/appdirs_eol/appdirs_eol.py | 16 ++++++++++++++++ deps/appdirs_eol/tests/a/setup.py | 7 +++++++ deps/appdirs_eol/tests/b/output.txt | 1 + deps/ick.toml | 6 ++++++ 4 files changed, 30 insertions(+) create mode 100644 deps/appdirs_eol/appdirs_eol.py create mode 100644 deps/appdirs_eol/tests/a/setup.py create mode 100644 deps/appdirs_eol/tests/b/output.txt diff --git a/deps/appdirs_eol/appdirs_eol.py b/deps/appdirs_eol/appdirs_eol.py new file mode 100644 index 0000000..4001e8c --- /dev/null +++ b/deps/appdirs_eol/appdirs_eol.py @@ -0,0 +1,16 @@ +import sys +from pathlib import Path + +import metadata_please +from packaging.requirements import Requirement + +def main(): + basic_metadata = metadata_please.basic_metadata_from_source_checkout(Path.cwd()) + for req in basic_metadata.reqs: + r = Requirement(req) + if r.name == "appdirs": + print("Appdirs should be replaced with platformdirs") + sys.exit(99) + +if __name__ == "__main__": + main() diff --git a/deps/appdirs_eol/tests/a/setup.py b/deps/appdirs_eol/tests/a/setup.py new file mode 100644 index 0000000..3c7df71 --- /dev/null +++ b/deps/appdirs_eol/tests/a/setup.py @@ -0,0 +1,7 @@ +from setuptools import setup + +setup( + name="foo", + requires = ["Appdirs > 1"], +) + diff --git a/deps/appdirs_eol/tests/b/output.txt b/deps/appdirs_eol/tests/b/output.txt new file mode 100644 index 0000000..f4d3ca7 --- /dev/null +++ b/deps/appdirs_eol/tests/b/output.txt @@ -0,0 +1 @@ +Please stop using appdirs diff --git a/deps/ick.toml b/deps/ick.toml index 1e70830..27a652d 100644 --- a/deps/ick.toml +++ b/deps/ick.toml @@ -3,3 +3,9 @@ name = "bump" impl = "python" inputs = ["requirements.txt"] deps = ["bumpreqs"] + +[[rule]] +name = "appdirs_eol" +impl = "python" +scope = "project" +deps = ["metadata-please"]