Skip to content

Commit

Permalink
chore: replace pip with uv
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
  • Loading branch information
jfcherng committed Apr 12, 2024
1 parent 74644b7 commit 362dd9d
Show file tree
Hide file tree
Showing 5 changed files with 325 additions and 300 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,46 @@ name: Python
on:
push:
branches:
- "**"
- '**'
paths:
- ".github/workflows/python.yml"
- "**.py"
- "**.pyi"
- "Makefile"
- '.github/workflows/python.yml'
- '**.py'
- '**.pyi'
- 'Makefile'
pull_request:
branches:
- "**"
- '**'
paths:
- ".github/workflows/python.yml"
- "**.py"
- "**.pyi"
- "Makefile"
- '.github/workflows/python.yml'
- '**.py'
- '**.pyi'
- 'Makefile'

jobs:
job_lint:
name: Linting (Python ${{ matrix.python-version }})
name: ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8"]
os: ['ubuntu-latest']
python-version: ['3.8']

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install -U uv
- name: Do linting
run: |
make ci-check
make UV_INSTALL_FLAGS="--system" \
install ci-check
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
UV_INSTALL_FLAGS :=

.PHONY: all
all:

.PHONY: install
install:
python -m pip install -U pip -r requirements.txt
uv pip install $(UV_INSTALL_FLAGS) -r requirements.txt

.PHONY: pip-compile
pip-compile:
uv pip compile --upgrade requirements.in -o requirements.txt

.PHONY: ci-check
ci-check:
@echo "========== check: mypy =========="
mypy -p plugin
@echo "========== check: ruff (lint) =========="
ruff check --diff .
@echo "========== check: ruff (format) =========="
ruff format --diff .

.PHONY: ci-fix
ci-fix:
@echo "========== fix: ruff (lint) =========="
ruff check --fix .
@echo "========== fix: ruff (format) =========="
ruff format .
Loading

0 comments on commit 362dd9d

Please sign in to comment.