Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 28 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: docs
on:
pull_request: ~
pull_request:
push:
branches:
- main
Expand All @@ -14,8 +14,30 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

jobs:
documentation:
name: Build docs on ${{ matrix.os }}

with-pip:
name: pip on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: ["ubuntu-latest", "macos-latest"]

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.14'
- name: Build docs
run: |
cd docs && make check
- name: Check Vale
run: |
cd test && make test

with-uv:
name: uv on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
Expand All @@ -27,7 +49,9 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
python-version: '3.14'
- name: Set up uv
uses: astral-sh/setup-uv@v7
- name: Build docs
run: |
cd docs && make check
Expand Down
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Changes

Unreleased
==========
- Started using the ``uv`` package manager if it's installed

2.1.7 - 2025/12/23
==================
Expand Down
14 changes: 11 additions & 3 deletions common-build/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ ENV_DIR = $(LOCAL_DIR)/.venv
ACTIVATE = $(ENV_DIR)/bin/activate
PYTHON = python3
PIP = $(PYTHON) -m pip
UV = uv
SEED_VIRTUALENV = $(PYTHON) -m venv
SPHINXBUILD = $(ENV_DIR)/bin/sphinx-build
SPHINXAUTOBUILD = $(ENV_DIR)/bin/sphinx-autobuild
AUTOBUILD_OPTS = --watch $(TOP_DIR) --re-ignore '^(?!.+\.(?:rst|md|mmd|html|css|js|py|conf)$$)' --open-browser --delay 0
Expand Down Expand Up @@ -88,6 +90,12 @@ VALE_OUT_DIR = $(TELEMETRY_DIR)/vale
GIT_LOG = $(BIN_DIR)/git-log
GIT_LOG_OUT_DIR = $(TELEMETRY_DIR)/git-log

# Figure out if `uv` can be used
ifneq (, $(shell which $(UV)))
PIP := $(UV) pip
SEED_VIRTUALENV := uv venv --seed
endif

# Figure out the OS
ifeq ($(findstring ;,$(PATH)),;)
# Windows, but not POSIX environment
Expand Down Expand Up @@ -138,18 +146,18 @@ $(ACTIVATE):
printf '\033[31mERROR: Python>=3.7 is required.\033[00m\n'; \
exit 1; \
fi
@ $(PYTHON) -m venv $(ENV_DIR)
@ $(SEED_VIRTUALENV) $(ENV_DIR)
@ . $(ACTIVATE) && \
$(PIP) install --upgrade pip

# Install dependencies needed by these three tools
$(RST2HTML) $(SPHINXBUILD) $(SPHINXAUTOBUILD): $(ACTIVATE)
@ printf '\033[1mInstalling Python dependencies...\033[00m\n'
@ . $(ACTIVATE) && \
$(PIP) install -r $(SRC_DIR)/requirements.txt
$(PIP) install --upgrade --requirement $(SRC_DIR)/requirements.txt
@ # Change to `TOP_DIR` to mimic how Read the Docs does it
@ . $(ACTIVATE) && cd $(TOP_DIR) && \
$(PIP) install -r $(DOCS_DIR)/requirements.txt
$(PIP) install --upgrade --requirement $(DOCS_DIR)/requirements.txt

# Configured and run in a sub-make by the $(VALE) target
install-vale:
Expand Down