Skip to content

Commit

Permalink
[docs] use -W for sphinx mdx build (#27949)
Browse files Browse the repository at this point in the history
## Summary & Motivation

Resolves issue where some users reported the following error message occurs when `LC_ALL` is not set.
```
locale_dir docs/sphinx/locales/en/LC_MESSAGES does not exist
```

## How I Tested These Changes

`yarn build-api-docs`

## Changelog

NOCHANGELOG
  • Loading branch information
cmpadden authored Feb 20, 2025
1 parent 5b31001 commit 3475388
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"lint-and-vale": "yarn run lint && yarn run vale",
"generate-code-imports": "node scripts/generate-code-imports.js",
"rebuild-kinds-tags": "python scripts/rebuild-kinds-tags.py",
"sync-api-docs": "/bin/sh scripts/build-api-docs.sh",
"build-api-docs": "/bin/sh scripts/build-api-docs.sh"
"sync-api-docs": "./scripts/build-api-docs.sh",
"build-api-docs": "./scripts/build-api-docs.sh"
},
"dependencies": {
"@docusaurus/core": "^3.7.0",
Expand Down
29 changes: 17 additions & 12 deletions docs/scripts/build-api-docs.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,29 @@

set -e

# Vercel-specific commands and configurations
if ! [[ "$OSTYPE" =~ "darwin"* ]]; then
echo "Detected non-Darwin host. Running Vercel-specific commands and configurations"

# Required to resolve `locale.Error: unsupported locale setting`
export LC_ALL=C.UTF-8

if ! command -v uv &> /dev/null; then
curl -LsSf https://astral.sh/uv/install.sh | sh

# shellcheck source=/dev/null
source "$HOME/.local/bin/env"
uv_install() {
if command -v uv &>/dev/null; then
echo "uv is already installed in this environment..."
else
curl -LsSf https://astral.sh/uv/install.sh | sh
source "$HOME/.local/bin/env"
fi
}

uv_activate_venv() {
uv python install 3.11
uv venv
source .venv/bin/activate
uv pip install tox
}

# https://vercel.com/docs/projects/environment-variables/system-environment-variables#VERCEL
if [ "$VERCEL" = "1" ]; then
echo "Detected Vercel environment. Running Vercel-specific commands and configurations."
# Required to resolve `locale.Error: unsupported locale setting`
export LC_ALL=C.UTF-8
uv_install
uv_activate_venv
fi

echo "Running sphinx-mdx and copying files to \`docs/api/python-api\`"
Expand Down
2 changes: 1 addition & 1 deletion docs/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ deps =

commands =
make --directory=sphinx clean
make --directory=sphinx mdx
make --directory=sphinx mdx SPHINXOPTS="-W --keep-going"

1 comment on commit 3475388

@github-actions
Copy link

@github-actions github-actions bot commented on 3475388 Feb 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for dagster-docs ready!

✅ Preview
https://dagster-docs-9afu15gnp-elementl.vercel.app

Built with commit 3475388.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.