Skip to content

Commit

Permalink
introduce conda-lock file for docs
Browse files Browse the repository at this point in the history
Signed-off-by: Niels Bantilan <[email protected]>
  • Loading branch information
cosmicBboy committed Dec 8, 2023
1 parent e221f9f commit c522bf6
Show file tree
Hide file tree
Showing 7 changed files with 16,732 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
- name: Codespell
uses: codespell-project/actions-codespell@v2
with:
skip: "*.pb"
skip: "*.pb,monodocs-environment.lock.yaml"
15 changes: 9 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ jobs:
uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: 3.9
mamba-version: "*"
channels: conda-forge
channel-priority: true
activate-environment: monodocs-env
environment-file: monodocs-environment.yaml
- shell: bash -el {0}
run: |
conda install -c conda-forge conda-lock
conda-lock install -n monodocs-env monodocs-environment.lock.yaml
- shell: bash -el {0}
run: |
conda activate monodocs-env
conda info
conda list
conda config --show-sources
Expand All @@ -48,7 +49,9 @@ jobs:
uses: ts-graphviz/setup-graphviz@v1
- name: Build the documentation
shell: bash -el {0}
run: make docs
run: |
conda activate monodocs-env
make docs
generate_kustomize:
runs-on: ubuntu-latest
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ install-piptools: ## Install pip-tools
doc-requirements.txt: doc-requirements.in install-piptools
$(call PIP_COMPILE,doc-requirements.in)

.PHONY: install-conda-lock
install-conda-lock:
pip install conda-lock

.PHONY: conda-lock
conda-lock: install-conda-lock
conda-lock -f monodocs-environment.yaml --without-cuda --lockfile monodocs-environment.lock.yaml

.PHONY: stats
stats:
@generate-dashboard -o deployment/stats/prometheus/flytepropeller-dashboard.json stats/flytepropeller.dashboard.py
Expand Down
11 changes: 8 additions & 3 deletions docs/.readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ build:
os: "ubuntu-22.04"
tools:
python: "mambaforge-22.9"
commands:
- cat monodocs-environment.lock.yaml
- mamba install -c conda-forge conda-lock
- conda-lock install -p /home/docs/monodocs-env monodocs-environment.lock.yaml
- conda info
- conda env list
- cat docs/conf.py
- cd docs && /home/docs/monodocs-env/bin/python -m sphinx -T -E -b html -d docs/_build/doctrees -D language=en . $READTHEDOCS_OUTPUT/html

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

conda:
environment: monodocs-environment.yaml
5 changes: 0 additions & 5 deletions docs/_ext/import_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ class Project:


def update_sys_path_for_flytekit(import_project_config: ImportProjectsConfig):
# create flytekit/_version.py file manually
with open(f"{import_project_config.flytekit_api_dir}/flytekit/_version.py", "w") as f:
f.write(f'__version__ = "dev"')


# add flytekit to python path
flytekit_dir = os.path.abspath(import_project_config.flytekit_api_dir)
flytekit_src_dir = os.path.abspath(os.path.join(flytekit_dir, "flytekit"))
Expand Down
Loading

0 comments on commit c522bf6

Please sign in to comment.