Skip to content

Commit

Permalink
fix: source .venv/bin/activate before build
Browse files Browse the repository at this point in the history
- rename `mkdocs.yml` to `mkdocs.yaml`
- same reflects in `docs/gen_docs.py`
- activates virtual environment before build

**Related items**

*Issues*

- Closes #253
- Closes #259
  • Loading branch information
yozachar committed Mar 29, 2023
1 parent 9ae6e8e commit 7737bd2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ jobs:
run: poetry install --no-interaction --no-ansi --only docs
# build package
- name: Build package
run: python build.py
run: |
source .venv/bin/activate
python build.py
# publish package
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
4 changes: 2 additions & 2 deletions docs/gen_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ def generate_documentation(source: Path, discard_refs: bool = True):
# generate reference documentation
nav_items = _generate_reference(source / "validators/__init__.py", source / "docs/reference")
# backup mkdocs config
_update_mkdocs_config(source / "mkdocs.yml", source / "mkdocs.bak.yml", nav_items)
_update_mkdocs_config(source / "mkdocs.yaml", source / "mkdocs.bak.yml", nav_items)
# build docs as subprocess
print(run(("mkdocs", "build"), capture_output=True).stderr.decode())
# restore mkdocs config
move(str(source / "mkdocs.bak.yml"), source / "mkdocs.yml")
move(str(source / "mkdocs.bak.yml"), source / "mkdocs.yaml")
# optionally discard reference folder
if discard_refs:
rmtree(source / "docs/reference")
Expand Down
File renamed without changes.

0 comments on commit 7737bd2

Please sign in to comment.