From 5f812f2ecd4830afef24a1c5d263838d2af5eaf3 Mon Sep 17 00:00:00 2001 From: Jack Cherng Date: Fri, 16 Feb 2024 21:28:25 +0800 Subject: [PATCH] chore: replace pip with uv https://github.com/astral-sh/uv Signed-off-by: Jack Cherng --- .github/workflows/python.yml | 4 +- Makefile | 8 +- docs/requirements.txt => requirements.in | 14 +++- requirements.txt | 101 ++++++++++++++++++++++- 4 files changed, 119 insertions(+), 8 deletions(-) rename docs/requirements.txt => requirements.in (58%) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 4887bebd..4a97fc76 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -43,8 +43,8 @@ jobs: - 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 --upgrade uv + if [ -f requirements.txt ]; then uv pip install -r requirements.txt; fi - name: Do linting run: | diff --git a/Makefile b/Makefile index 28bc3e59..b5e022bf 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,12 @@ all: .PHONY: install -install: - python -m pip install -U pip -r requirements.txt +install: compile-req + uv pip install -r requirements.txt + +.PHONY: compile-req +compile-req: + uv pip compile requirements.in -o requirements.txt .PHONY: ci-check ci-check: diff --git a/docs/requirements.txt b/requirements.in similarity index 58% rename from docs/requirements.txt rename to requirements.in index 47167b03..ebf187c2 100644 --- a/docs/requirements.txt +++ b/requirements.in @@ -1,7 +1,17 @@ -# main +# ---- # +# main # +# ---- # + +mypy +ruff>=0.2 + +# ---- # +# docs # +# ---- # + mkdocs-material==9.5.9 -# plugins +# mkdocs plugins mkdocs-exclude==1.0.2 mkdocs-git-revision-date-localized-plugin==1.2.4 mkdocs-minify-plugin==0.8.0 diff --git a/requirements.txt b/requirements.txt index 870367da..d159d720 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,99 @@ -mypy -ruff>=0.2 +# This file was autogenerated by uv v0.1.2 via the following command: +# uv pip compile requirements.in -o requirements.txt +babel==2.14.0 + # via + # mkdocs-git-revision-date-localized-plugin + # mkdocs-material +certifi==2024.2.2 + # via requests +charset-normalizer==3.3.2 + # via requests +click==8.1.7 + # via mkdocs +colorama==0.4.6 + # via + # click + # mkdocs + # mkdocs-material +csscompressor==0.9.5 + # via mkdocs-minify-plugin +ghp-import==2.1.0 + # via mkdocs +gitdb==4.0.11 + # via gitpython +gitpython==3.1.42 + # via mkdocs-git-revision-date-localized-plugin +htmlmin2==0.1.13 + # via mkdocs-minify-plugin +idna==3.6 + # via requests +jinja2==3.1.3 + # via + # mkdocs + # mkdocs-material +jsmin==3.0.1 + # via mkdocs-minify-plugin +markdown==3.5.2 + # via + # mkdocs + # mkdocs-material + # pymdown-extensions +markupsafe==2.1.5 + # via + # jinja2 + # mkdocs +mergedeep==1.3.4 + # via mkdocs +mkdocs==1.5.3 + # via + # mkdocs-exclude + # mkdocs-git-revision-date-localized-plugin + # mkdocs-material + # mkdocs-minify-plugin +mkdocs-exclude==1.0.2 +mkdocs-git-revision-date-localized-plugin==1.2.4 +mkdocs-material==9.5.9 +mkdocs-material-extensions==1.3.1 + # via mkdocs-material +mkdocs-minify-plugin==0.8.0 +mypy==1.8.0 +mypy-extensions==1.0.0 + # via mypy +packaging==23.2 + # via mkdocs +paginate==0.5.6 + # via mkdocs-material +pathspec==0.12.1 + # via mkdocs +platformdirs==4.2.0 + # via mkdocs +pygments==2.17.2 + # via mkdocs-material +pymdown-extensions==10.7 + # via mkdocs-material +python-dateutil==2.8.2 + # via ghp-import +pytz==2024.1 + # via mkdocs-git-revision-date-localized-plugin +pyyaml==6.0.1 + # via + # mkdocs + # pymdown-extensions + # pyyaml-env-tag +pyyaml-env-tag==0.1 + # via mkdocs +regex==2023.12.25 + # via mkdocs-material +requests==2.31.0 + # via mkdocs-material +ruff==0.2.1 +six==1.16.0 + # via python-dateutil +smmap==5.0.1 + # via gitdb +typing-extensions==4.9.0 + # via mypy +urllib3==2.2.0 + # via requests +watchdog==4.0.0 + # via mkdocs