Skip to content

Commit c4c800f

Browse files
authored
use uv for docs build (#558)
* use uv for docs build * remove docs/requirements.txt
1 parent 6e3faea commit c4c800f

File tree

7 files changed

+548
-58
lines changed

7 files changed

+548
-58
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ permissions:
1414

1515
env:
1616
JUST_VERSION: '1'
17-
PREK_VERSION: '0.2.11'
17+
PREK_VERSION: '0.2.12'
1818
TERRAFORM_VERSION: '1.13'
1919

2020
jobs:

.readthedocs.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@ build:
88
os: ubuntu-24.04
99
tools:
1010
python: 3.10
11+
jobs:
12+
pre_create_environment:
13+
- asdf plugin add uv
14+
- asdf install uv latest:0.9
15+
- asdf global uv latest
16+
create_environment:
17+
- uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
18+
install:
19+
- UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --frozen --group docs
1120

1221
mkdocs:
1322
configuration: mkdocs.yml
1423
fail_on_warning: false
1524

1625
# Optionally build your docs in additional formats such as PDF and ePub
1726
formats: all
18-
19-
# Optionally set requirements required to build your docs
20-
python:
21-
install:
22-
- requirements: docs/requirements.txt

docs/contributing/documentation.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@ Once you've got all that, the rest is simple:
1515
git clone git@github.com:salesforce/policy_sentry.git
1616

1717
# Set up the virtual environment
18-
python3 -m venv ./venv && source venv/bin/activate
19-
uv sync --frozen
20-
uv pip install -r docs/requirements.txt
18+
uv sync --frozen --all-groups
2119

2220
# Create the HTML files
23-
invoke docs.build-docs
24-
invoke docs.serve-docs
21+
just build-docs
22+
just serve-docs
2523

2624
# The above will open the built documentation in your browser
2725
```

docs/requirements.txt

Lines changed: 0 additions & 21 deletions
This file was deleted.

mkdocs.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ plugins:
1212
default_handler: python
1313
handlers:
1414
python:
15-
rendering:
15+
options:
1616
show_source: true
17-
# show_if_no_docstring: yes
18-
watch:
19-
- policy_sentry/
17+
# show_if_no_docstring: true
2018
extra_css:
2119
- custom.css
2220
nav:

pyproject.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,28 @@ dev = [
5454
"types-requests>=2.32.4",
5555
]
5656

57+
docs = [
58+
# unique to ReadTheDocs
59+
"atomicwrites>=1.4.0,<2.0.0",
60+
"distlib>=0.4.0,<0.5.0",
61+
"docutils>=0.22.0,<0.23.0",
62+
"filelock>=3.20.0,<4.0.0",
63+
"mkdocs>=1.6.0,<2.0.0",
64+
"mkdocs-material>=9.6.0,<10.0.0",
65+
"mkdocs-material-extensions>=1.3.0,<2.0.0",
66+
"mkdocstrings>=0.30.0,<0.31.0",
67+
"mkdocstrings-python>=1.18.0,<2.0.0",
68+
"mkdocstrings-python-legacy>=0.2.0,<0.3.0",
69+
"pygments>=2.19.0,<3.0.0",
70+
"pymdown-extensions>=10.16.0,<11.0.0",
71+
"pytkdocs>=0.16.0,<0.17.0",
72+
# Trying to see if RTFD needs these
73+
"markdown>=3.9.0,<4.0.0",
74+
"markupsafe>=3.0.0,<4.0.0",
75+
"jinja2>=3.1.0,<4.0.0",
76+
"typed-ast>=1.5.0,<2.0.0",
77+
]
78+
5779
[build-system]
5880
# `uv_build` backend doesn't support build hooks yet https://github.com/astral-sh/uv/issues/14561
5981
requires = ["hatchling"]

uv.lock

Lines changed: 511 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)