1919set -e
2020
2121export REMOTE=" iceberg_docs"
22+ export VENV_DIR=" .venv"
2223
2324# Ensures the presence of a specified remote repository for documentation.
2425# If the remote doesn't exist, it adds it using the provided URL.
@@ -34,12 +35,20 @@ create_or_update_docs_remote () {
3435 git fetch " ${REMOTE} "
3536}
3637
38+ # Creates the virtual environment if it doesn't exist.
39+ create_venv () {
40+ if [ ! -d " ${VENV_DIR} " ]; then
41+ echo " --> creating virtual environment at ${VENV_DIR} "
42+ python3 -m venv " ${VENV_DIR} "
43+ fi
44+ }
45+
3746# Installs or upgrades dependencies specified in the 'requirements.txt' file using pip.
3847install_deps () {
3948 echo " --> install deps"
4049
41- # Use pip to install or upgrade dependencies from the 'requirements.txt' file quietly
42- pip3 -q install -r requirements.txt --upgrade
50+ # Use pip from venv to install or upgrade dependencies from the 'requirements.txt' file quietly
51+ " ${VENV_DIR} /bin/ pip3" -q install -r requirements.txt --upgrade
4352}
4453
4554# Checks if a provided argument is not empty. If empty, displays an error message and exits with a status code 1.
@@ -186,16 +195,16 @@ pull_versioned_docs () {
186195
187196check_markdown_files () {
188197 echo " --> check markdown file styles"
189- if ! python3 -m pymarkdown --config markdownlint.yml scan docs/docs/nightly/docs/* .md docs/* .md README.md
198+ if ! " ${VENV_DIR} /bin/ python3" -m pymarkdown --config markdownlint.yml scan docs/docs/nightly/docs/* .md docs/* .md README.md
190199 then
191- echo " Markdown style issues found. Please run './dev/lint.sh - -fix' to fix them."
200+ echo " Markdown style issues found. Please run 'make lint -fix' to fix them."
192201 exit 1
193202 fi
194203}
195204
196205fix_markdown_files () {
197206 echo " --> fix markdown file styles"
198- python3 -m pymarkdown --config markdownlint.yml fix docs/docs/nightly/docs/* .md docs/* .md README.md
207+ " ${VENV_DIR} /bin/ python3" -m pymarkdown --config markdownlint.yml fix docs/docs/nightly/docs/* .md docs/* .md README.md
199208}
200209
201210# Cleans up artifacts and temporary files generated during documentation management.
0 commit comments