Skip to content

Commit

Permalink
Merge pull request #1763 from jponge/build/use-uv-python-docs
Browse files Browse the repository at this point in the history
build(docs): switch the Python toolchain to uv
  • Loading branch information
jponge authored Dec 11, 2024
2 parents 7a5a805 + ec941a0 commit fa30c10
Show file tree
Hide file tree
Showing 8 changed files with 574 additions and 699 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,23 @@ jobs:
cache: maven
- name: Compatibility Check
run: ./mvnw --no-transfer-progress -s .build/maven-ci-settings.xml -pl '!bom' -B install revapi:check@check-compatibility -DskipTests -fae

documentation:
runs-on: ubuntu-latest
name: Documentation build check
steps:
- uses: actions/checkout@v4
name: Checkout code
- name: Install uv
uses: astral-sh/setup-uv@v4
- uses: actions/setup-python@v5
name: Set up Python
with:
python-version-file: "documentation/pyproject.toml"
- name: Other tools setup
run: sudo snap install yq
- name: Render docs
run: |
cd documentation
uv sync --all-extras --dev
uv run mkdocs build
15 changes: 8 additions & 7 deletions .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,22 @@ jobs:
name: Checkout code
with:
fetch-depth: 0 # fetch all commits and branches for mike to work properly
- name: Install uv
uses: astral-sh/setup-uv@v4
- uses: actions/setup-python@v5
name: Set up Python
with:
python-version: 3.x
- name: Tools setup
python-version-file: "documentation/pyproject.toml"
- name: Other tools setup
run: |
git config --global user.name "SmallRye CI"
git config --global user.email "smallrye@googlegroups.com"
sudo snap install yq
cd documentation
pip install mkdocs-material
pip install mike
- name: Render docs and publish
run: |
export PROJECT_VERSION=$(cat .github/project.yml | yq eval '.release.current-version' -)
cd documentation
mike deploy --push --update-aliases $PROJECT_VERSION latest
mike set-default --push latest
uv sync --all-extras --dev
uv run mkdocs build
uv run mike deploy --push --update-aliases $PROJECT_VERSION latest
uv run mike set-default --push latest
1 change: 1 addition & 0 deletions documentation/.python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
15 changes: 0 additions & 15 deletions documentation/Pipfile

This file was deleted.

665 changes: 0 additions & 665 deletions documentation/Pipfile.lock

This file was deleted.

20 changes: 8 additions & 12 deletions documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,26 @@ This module contains the documentation and website.

## Requirements

You need Python (e.g. using `pyenv`), then:
Install the [uv](https://docs.astral.sh/uv/) tool, then get a working virtual environment:

```shell
pip install pipenv
pipenv install
uv python install
uv venv
source .venv/bin/activate
uv sync --all-extras --dev
```

## MkDocs development mode

From this directory (`documentation/`):

```shell
pipenv run mkdocs serve
```

or

```shell
pipenv shell
mkdocs serve
uv run mkdocs serve
```

## Upgrade the dependencies

```shell
pipenv update
uv sync --upgrade
uv lock
```
12 changes: 12 additions & 0 deletions documentation/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[project]
name = "mutiny-docs"
version = "999"
description = "Mutiny Documentation powered by MkDocs"
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
"mkdocs-material>=9.5.48",
"mkdocs>=1.6.1",
"mkdocs-macros-plugin>=1.3.7",
"mike>=2.1.3",
]
525 changes: 525 additions & 0 deletions documentation/uv.lock

Large diffs are not rendered by default.

0 comments on commit fa30c10

Please sign in to comment.