Skip to content

Commit

Permalink
Move mkdocs to use poetry as docs (apache#1486)
Browse files Browse the repository at this point in the history
* poetry add $(cat mkdocs/requirements.txt | grep -v #) --group dev

* add `make docs`

* update instructions

* strict mode

* make docs-build

* docs-serve

* add comment

* add docs as dep group

* add make install-poetry
  • Loading branch information
kevinjqliu authored Jan 6, 2025
1 parent 59fffe3 commit e5bfa1e
Show file tree
Hide file tree
Showing 7 changed files with 707 additions and 46 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/python-ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Install poetry
run: make install-poetry
- uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install
working-directory: ./mkdocs
run: pip install -r requirements.txt
- name: Build
working-directory: ./mkdocs
run: mkdocs build --strict
run: make docs-install
- name: Build docs
run: make docs-build
12 changes: 6 additions & 6 deletions .github/workflows/python-release-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Install poetry
run: make install-poetry
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install
working-directory: ./mkdocs
run: pip install -r requirements.txt
- name: Build
working-directory: ./mkdocs
run: mkdocs build --strict
- name: Install docs
run: make docs-install
- name: Build docs
run: make docs-build
- name: Copy
working-directory: ./mkdocs
run: mv ./site /tmp/site
Expand Down
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ install-poetry: ## Install poetry if the user has not done that yet.
echo "Poetry is already installed."; \
fi

install-dependencies: ## Install dependencies including dev and all extras
install-dependencies: ## Install dependencies including dev, docs, and all extras
poetry install --all-extras

install: | install-poetry install-dependencies
Expand Down Expand Up @@ -97,3 +97,12 @@ clean: ## Clean up the project Python working environment
@find . -name "*.pyd" -exec echo Deleting {} \; -delete
@find . -name "*.pyo" -exec echo Deleting {} \; -delete
@echo "Cleanup complete"

docs-install:
poetry install --with docs

docs-serve:
poetry run mkdocs serve -f mkdocs/mkdocs.yml

docs-build:
poetry run mkdocs build -f mkdocs/mkdocs.yml --strict
5 changes: 2 additions & 3 deletions mkdocs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ The pyiceberg docs are stored in `docs/`.
## Running docs locally

```sh
pip3 install -r requirements.txt
mkdocs serve
open http://localhost:8000/
make docs-install
make docs-serve
```
28 changes: 0 additions & 28 deletions mkdocs/requirements.txt

This file was deleted.

Loading

0 comments on commit e5bfa1e

Please sign in to comment.