Skip to content

Commit fd417d5

Browse files
committed
Clean up docs rules and add install-ci target
1 parent e81cbab commit fd417d5

File tree

4 files changed

+23
-33
lines changed

4 files changed

+23
-33
lines changed

.github/py-shiny/setup/action.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,10 @@ runs:
1717
# cache-dependency-path: |
1818
# setup.cfg
1919

20-
- name: Upgrade pip
21-
shell: bash
22-
run: python -m pip install --upgrade pip
23-
2420
- name: Install dependencies
2521
shell: bash
2622
run: |
27-
pip install https://github.com/rstudio/py-htmltools/tarball/main
28-
make install-deps
23+
make install-ci
2924
3025
- name: Install
3126
shell: bash

.github/workflows/build-docs.yaml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,45 +22,29 @@ jobs:
2222
with:
2323
python-version: ${{ matrix.python-version }}
2424

25-
- name: Upgrade pip
26-
run: python -m pip install --upgrade pip
27-
2825
- name: Install Quarto
2926
uses: quarto-dev/quarto-actions/setup@v2
3027
with:
3128
version: 1.3.340
3229

33-
- name: Install dependencies
34-
run: |
35-
cd docs
36-
make ../venv
37-
make deps
38-
39-
- name: Run quartodoc
40-
run: |
41-
cd docs
42-
make quartodoc
43-
4430
- name: Build site
4531
run: |
46-
cd docs
47-
make site
32+
make docs
4833
4934
- name: Upload site artifact
5035
if: github.ref == 'refs/heads/main'
5136
uses: actions/upload-pages-artifact@v1
5237
with:
5338
path: "docs/_site"
5439

55-
5640
deploy:
5741
if: github.ref == 'refs/heads/main'
5842
needs: build
5943

6044
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
6145
permissions:
62-
pages: write # to deploy to Pages
63-
id-token: write # to verify the deployment originates from an appropriate source
46+
pages: write # to deploy to Pages
47+
id-token: write # to verify the deployment originates from an appropriate source
6448

6549
# Deploy to the github-pages environment
6650
environment:

.github/workflows/pytest.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,7 @@ jobs:
195195
python-version: "3.10"
196196
- name: Install dependencies
197197
run: |
198-
python -m pip install --upgrade pip
199-
pip install https://github.com/rstudio/py-htmltools/tarball/main
200-
make install-deps
198+
make install-ci
201199
make install
202200
- name: "Build Package"
203201
run: |

Makefile

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,11 @@ install-deps: $(UV) FORCE ## install dependencies
146146
. $(PYBIN)/activate && \
147147
uv pip install -e ".[dev,test]" --refresh
148148

149+
install-ci: $(UV) FORCE ## install dependencies for CI
150+
. $(PYBIN)/activate && \
151+
uv pip install -e ".[dev,test]" --refresh \
152+
"htmltools @ git+https://github.com/posit-dev/py-htmltools.git"
153+
149154

150155

151156
# ## If caching is ever used, we could run:
@@ -237,15 +242,23 @@ install-docs: $(UV) FORCE
237242
"htmltools @ git+https://github.com/posit-dev/py-htmltools.git" \
238243
"shinylive @ git+https://github.com/posit-dev/py-shinylive.git"
239244

240-
docs: $(PYBIN) FORCE ## docs: build quartodoc docs
245+
docs: docs-serve FORCE ## docs: build and serve docs in browser
246+
247+
docs-serve: $(PYBIN) FORCE ## docs: serve docs in browser
248+
$(MAKE) docs-quartodoc
249+
@echo "-------- Previewing docs in browser --------"
250+
@cd docs && make serve
251+
252+
docs-site: $(PYBIN) FORCE ## docs: render quarto site
253+
$(MAKE) docs-quartodoc
254+
@echo "-------- Previewing docs in browser --------"
255+
@cd docs && make serve
256+
257+
docs-quartodoc: $(PYBIN) FORCE ## docs: build quartodoc docs
241258
$(MAKE) install-docs
242259
@echo "-------- Building docs with quartodoc --------"
243260
@cd docs && make quartodoc
244261

245-
docs-preview: $(PYBIN) FORCE ## docs: preview docs in browser
246-
$(MAKE) install-docs
247-
@echo "-------- Previewing docs in browser --------"
248-
@cd docs && make serve
249262

250263
# -----------------
251264
# Testing with playwright

0 commit comments

Comments
 (0)