From f10bfc8ccdebefad02681928b72dada342dd1795 Mon Sep 17 00:00:00 2001 From: Jack Cherng Date: Fri, 16 Feb 2024 21:03:03 +0800 Subject: [PATCH] chore: replace pip with uv Signed-off-by: Jack Cherng --- .github/workflows/python.yml | 7 +++---- Makefile | 10 +++++++++- requirements.in | 2 ++ requirements.txt | 13 ++++++++----- 4 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 requirements.in diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 4887beb..c1ff53e 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -37,15 +37,14 @@ jobs: 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 system-install ci-check diff --git a/Makefile b/Makefile index 28bc3e5..33dd827 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,17 @@ .PHONY: all all: +.PHONY: system-install +system-install: + uv pip install --system -r requirements.txt + .PHONY: install install: - python -m pip install -U pip -r requirements.txt + uv pip install -r requirements.txt + +.PHONY: pip-compile +pip-compile: + uv pip compile --upgrade requirements.in -o requirements.txt .PHONY: ci-check ci-check: diff --git a/requirements.in b/requirements.in new file mode 100644 index 0000000..870367d --- /dev/null +++ b/requirements.in @@ -0,0 +1,2 @@ +mypy +ruff>=0.2 diff --git a/requirements.txt b/requirements.txt index 8a2e12d..b596901 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,8 @@ -# This is an implicit value, here for clarity ---index https://pypi.python.org/simple/ - -mypy -ruff>=0.2 +# This file was autogenerated by uv via the following command: +# uv pip compile requirements.in -o requirements.txt +mypy==1.8.0 +mypy-extensions==1.0.0 + # via mypy +ruff==0.3.0 +typing-extensions==4.10.0 + # via mypy