Skip to content

Commit

Permalink
chore: replace pip with uv
Browse files Browse the repository at this point in the history
  • Loading branch information
jfcherng committed Feb 16, 2024
1 parent 23c7523 commit a28d6d9
Show file tree
Hide file tree
Showing 8 changed files with 224 additions and 22 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,30 @@ 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 v
. .venv/bin/activate
uv pip install -r requirements.txt
make build
job_deploy:
# deploy only on the "stable" branch
if: ${{ github.ref == 'refs/heads/stable' }}
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 v
. .venv/bin/activate
uv pip install -r requirements.txt
make deploy
6 changes: 3 additions & 3 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 7 additions & 4 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
6 changes: 6 additions & 0 deletions docs/requirements.in
Original file line number Diff line number Diff line change
@@ -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
94 changes: 90 additions & 4 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mypy
ruff>=0.2
101 changes: 99 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a28d6d9

Please sign in to comment.