Skip to content

Commit

Permalink
ci: 🐍 migrate from Poetry to uv for Python setup and dependency insta…
Browse files Browse the repository at this point in the history
…llation in doc workflows

Signed-off-by: Onuralp SEZER <[email protected]>
  • Loading branch information
onuralpszr committed Jan 8, 2025
1 parent 730bbd2 commit fc40438
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,13 @@ jobs:
with:
fetch-depth: 0

- name: 🐍 Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
- name: 🐍 Install uv and set Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}

- name: 📜 Setup Poetry
uses: abatilo/actions-poetry@3765cf608f2d4a72178a9fc5b918668e542b89b1 # v4.0.0

- name: 📦 Install dependencies
run: |
poetry install --with=docs
run: uv pip install -r pyproject.toml --extra docs

- name: ⚙️ Configure git for github-actions
run: |
Expand All @@ -53,10 +49,10 @@ jobs:
- name: 🚀 Deploy Development Docs
if: (github.event_name == 'push' && github.ref == 'refs/heads/develop') || github.event_name == 'workflow_dispatch'
run: |
MKDOCS_GIT_COMMITTERS_APIKEY=${{ secrets.GITHUB_TOKEN }} poetry run mike deploy --push develop
MKDOCS_GIT_COMMITTERS_APIKEY=${{ secrets.GITHUB_TOKEN }} uv run mike deploy --push develop
- name: 🚀 Deploy Release Docs
if: github.event_name == 'release' && github.event.action == 'published'
run: |
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
MKDOCS_GIT_COMMITTERS_APIKEY=${{ secrets.GITHUB_TOKEN }} poetry run mike deploy --push --update-aliases $latest_tag latest
MKDOCS_GIT_COMMITTERS_APIKEY=${{ secrets.GITHUB_TOKEN }} uv run mike deploy --push --update-aliases $latest_tag latest
13 changes: 4 additions & 9 deletions .github/workflows/test-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,13 @@ jobs:
with:
fetch-depth: 0

- name: 🐍 Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
- name: 🐍 Install uv and set Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}

- name: 📜 Setup Poetry
uses: abatilo/actions-poetry@3765cf608f2d4a72178a9fc5b918668e542b89b1 # v4.0.0

- name: 🏗️ Install dependencies
run: |
poetry install --with=docs
run: uv pip install -r pyproject.toml --extra docs

- name: 🧪 Test Docs Build
run: |
poetry run mkdocs build --verbose
run: uv run mkdocs build --verbose
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,4 @@ supervision = ["py.typed"]

[build-system]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"
build-backend = "setuptools.build_meta"

0 comments on commit fc40438

Please sign in to comment.