From 38cf6a2e15510e34342c7ed4893870cedb1db19b 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/docs.yml | 14 ++--- .github/workflows/python.yml | 6 +-- Makefile | 8 ++- docs/Makefile | 11 ++-- docs/requirements.in | 6 +++ docs/requirements.txt | 94 ++++++++++++++++++++++++++++++-- requirements.in | 2 + requirements.txt | 101 ++++++++++++++++++++++++++++++++++- 8 files changed, 220 insertions(+), 22 deletions(-) create mode 100644 docs/requirements.in create mode 100644 requirements.in diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1ee986c9..719439c6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,13 +12,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: 3.x - - run: python -m pip install -U pip wheel + - run: python -m pip install -U uv - run: | cd docs/ - pip install -r requirements.txt + uv pip install -r requirements.txt make build job_deploy: # deploy only on the "stable" branch @@ -26,12 +26,12 @@ jobs: name: Deploy runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: 3.x - - run: python -m pip install -U pip wheel + - run: python -m pip install -U uv - run: | cd docs/ - pip install -r requirements.txt + uv pip install -r requirements.txt make deploy diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 4887bebd..dd0ae5c6 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -37,14 +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 --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/Makefile b/docs/Makefile index f109b69e..b836e6a0 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,10 +1,13 @@ .phony: all all: build -.phony: install -install: - python -m pip install --upgrade pip - python -m pip install --upgrade -r requirements.txt +.PHONY: install +install: compile-req + uv pip install -r requirements.txt + +.PHONY: compile-req +compile-req: + uv pip compile requirements.in -o requirements.txt .phony: serve serve: diff --git a/docs/requirements.in b/docs/requirements.in new file mode 100644 index 00000000..bb60b136 --- /dev/null +++ b/docs/requirements.in @@ -0,0 +1,6 @@ +mkdocs-material==9.5.9 + +# 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/docs/requirements.txt b/docs/requirements.txt index 47167b03..047d8048 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,7 +1,93 @@ -# main -mkdocs-material==9.5.9 - -# plugins +# 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 +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 +six==1.16.0 + # via python-dateutil +smmap==5.0.1 + # via gitdb +urllib3==2.2.0 + # via requests +watchdog==4.0.0 + # via mkdocs diff --git a/requirements.in b/requirements.in new file mode 100644 index 00000000..870367da --- /dev/null +++ b/requirements.in @@ -0,0 +1,2 @@ +mypy +ruff>=0.2 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