Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.PHONY: test
test:
ick --isolated-repo test-rules

.PHONY: lint
lint:

16 changes: 16 additions & 0 deletions deps/appdirs_eol/appdirs_eol.py
Original file line number Diff line number Diff line change
@@ -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()
7 changes: 7 additions & 0 deletions deps/appdirs_eol/tests/a/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from setuptools import setup

setup(
name="foo",
requires = ["Appdirs > 1"],
)

1 change: 1 addition & 0 deletions deps/appdirs_eol/tests/b/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please stop using appdirs
8 changes: 7 additions & 1 deletion deps/ick.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
[[rule]]
name = "bump"
language = "python"
impl = "python"
inputs = ["requirements.txt"]
deps = ["bumpreqs"]

[[rule]]
name = "appdirs_eol"
impl = "python"
scope = "project"
deps = ["metadata-please"]
2 changes: 1 addition & 1 deletion gha/ick.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[[rule]]
name = "upgrade"
language = "python"
impl = "python"
deps = ["codemod-yaml"]
inputs = [".github/workflows/*.yml"]
3 changes: 3 additions & 0 deletions ick.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[[ruleset]]
path = "."
prefix = ""
Loading