Skip to content
Open
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ Follow the steps below to build and view the site locally.
## Requirements

* [Node.js] >= 16 to be able to [view the output](#viewing-the-output)
* python3 >= 3.10
* python3-venv
* [Task]
* [uv]

## Building

Expand Down Expand Up @@ -44,3 +43,4 @@ task docs:serve
[docs.yscope.com]: https://docs.yscope.com
[Node.js]: https://nodejs.org/en/download/current
[Task]: https://taskfile.dev/
[uv]: https://docs.astral.sh/uv/
17 changes: 17 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[project]
name = "yscope-docs"
version = "0.1.0"
description = "YScope documentation site"
authors = [{ name = "YScope Inc.", email = "dev@yscope.com" }]
readme = "README.md"
requires-python = ">=3.14"
dependencies = [
"myst-parser>=2.0.0",
"pydata-sphinx-theme>=0.15.2",
"pydantic>=2.6.4",
"sphinx>=7.2.6",
"sphinx-design>=0.5.0",
]

[tool.uv]
package = false
8 changes: 0 additions & 8 deletions requirements.txt

This file was deleted.

1 change: 1 addition & 0 deletions taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set: ["u", "pipefail"]
shopt: ["globstar"]

includes:
deps: "taskfiles/deps/main.yaml"
docs: "taskfiles/docs.yaml"

vars:
Expand Down
31 changes: 31 additions & 0 deletions taskfiles/deps/lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: "3"

tasks:
check-uv:
cmds:
- for: &uv-projects
- "{{.ROOT_DIR}}"
task: "uv-lock"
vars:
PROJECT_DIR: "{{.ITEM}}"
UV_LOCK_FLAGS: "--check"

update-uv:
cmds:
- for: *uv-projects
task: "uv-lock"
vars:
PROJECT_DIR: "{{.ITEM}}"
UV_LOCK_FLAGS: ""
Comment thread
junhaoliao marked this conversation as resolved.

# Runs `uv lock` in the UV project directory with the specified flags.
#
# @param {string} PROJECT_DIR
# @param {string} UV_LOCK_FLAGS The flags to pass to the `uv lock` command.
uv-lock:
internal: true
requires:
vars: ["PROJECT_DIR", "UV_LOCK_FLAGS"]
dir: "{{.PROJECT_DIR}}"
cmd: |-
uv lock {{.UV_LOCK_FLAGS}}
4 changes: 4 additions & 0 deletions taskfiles/deps/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: "3"

includes:
lock: "./lock.yaml"
33 changes: 21 additions & 12 deletions taskfiles/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,16 @@ tasks:
cmd: "rm -rf '{{.G_PUBLISHABLE_OUTPUT_DIR}}'"

download-projects:
env:
UV_PROJECT_ENVIRONMENT: "{{.G_VENV_DIR}}"
deps: ["venv"]
cmds:
- |-
. "{{.G_VENV_DIR}}/bin/activate"
python3 scripts/download-projects.py --build-dir "{{.G_PROJECTS_DOCS_DIR}}"
- >-
uv run
--directory "{{.ROOT_DIR}}"
--locked
scripts/download-projects.py
--build-dir "{{.G_PROJECTS_DOCS_DIR}}"

release-tar:
deps: ["build"]
Expand All @@ -60,6 +65,8 @@ tasks:

build-dev-docs:
internal: true
env:
UV_PROJECT_ENVIRONMENT: "{{.G_VENV_DIR}}"
vars:
CHECKSUM_FILE: "{{.G_BUILD_DIR}}/{{.TASK | replace \":\" \"#\"}}.md5"
OUTPUT_DIR: "{{.G_DEV_DOCS_OUTPUT_DIR}}"
Expand All @@ -77,8 +84,10 @@ tasks:
INCLUDE_PATTERNS: ["{{.OUTPUT_DIR}}"]
- "venv"
cmds:
- |-
. "{{.G_VENV_DIR}}/bin/activate"
- >-
uv run
--directory "{{.ROOT_DIR}}"
--locked
sphinx-build -a -E -c '{{.SOURCE_DIR}}' -b html '{{.SOURCE_DIR}}' "{{.OUTPUT_DIR}}"

# This command must be last
Expand Down Expand Up @@ -191,12 +200,14 @@ tasks:

venv:
internal: true
env:
UV_PROJECT_ENVIRONMENT: "{{.OUTPUT_DIR}}"
vars:
CHECKSUM_FILE: "{{.G_VENV_CHECKSUM_FILE}}"
OUTPUT_DIR: "{{.G_VENV_DIR}}"
REQUIREMENTS_FILE: "{{.ROOT_DIR}}/requirements.txt"
sources:
- "{{.REQUIREMENTS_FILE}}"
- "{{.ROOT_DIR}}/pyproject.toml"
- "{{.ROOT_DIR}}/uv.lock"
- "{{.TASKFILE}}"
generates: ["{{.CHECKSUM_FILE}}"]
run: "once"
Expand All @@ -207,11 +218,9 @@ tasks:
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}"
INCLUDE_PATTERNS: ["{{.OUTPUT_DIR}}"]
cmds:
- task: "utils:misc:create-venv"
vars:
LABEL: "docs"
OUTPUT_DIR: "{{.OUTPUT_DIR}}"
REQUIREMENTS_FILE: "{{.REQUIREMENTS_FILE}}"
- |-
rm -rf "{{.OUTPUT_DIR}}"
uv sync --locked

# This command must be last
- task: "utils:checksum:compute"
Expand Down
538 changes: 538 additions & 0 deletions uv.lock

Large diffs are not rendered by default.