From 3cb67e99da3a713425b81642db6cd35c6bf456fe Mon Sep 17 00:00:00 2001 From: mgrani Date: Wed, 3 Sep 2025 15:25:02 +0200 Subject: [PATCH] chore: gitlab ci update --- .gitlab-ci.yml | 38 +++++++++++++++++++++++--------------- tests/lexis_test2.py | 2 +- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f15947d..ee35b40 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,24 +6,36 @@ variables: PYTHON_VERSION: "3.11" SPHINX_OUTPUT_DIR: "public" DOCS_SOURCE_DIR: "docs/source" - MAX_ARTIFACT_SIZE_MB: 100 # Control artifact size + PIP_DISABLE_PIP_VERSION_CHECK: "1" + POETRY_VIRTUALENVS_IN_PROJECT: "true" # ensure .venv is created in repo -# Install project and dependencies first +# Install project and dependencies first (creates .venv artifact) install-deps: stage: build image: python:${PYTHON_VERSION} script: - - pip install poetry pandas # Install pandas explicitly - - poetry install --with docs # Install all dependencies including docs + - python -m pip install -U pip setuptools wheel + - python -m pip install poetry + - poetry --version + # Ensure venv is in-project -> .venv/ + - poetry config virtualenvs.in-project true + # Install all deps including docs (adjust flags to your needs) + - poetry install --no-interaction --with docs + # Show where the venv is to confirm + - echo "VENV PATH: $(poetry env info -p)" + - test -d .venv # fail early if venv wasn't created cache: - key: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}" + key: "${CI_COMMIT_REF_SLUG}-py${PYTHON_VERSION}" paths: - .venv/ + - .cache/pip/ + - .cache/pypoetry/ artifacts: paths: - .venv/ + expire_in: 1 week -# Build documentation with versioning +# Build documentation build-docs: stage: build image: python:${PYTHON_VERSION} @@ -34,21 +46,17 @@ build-docs: GIT_DEPTH: 100 GIT_SUBMODULE_STRATEGY: recursive before_script: - # Activate the cached virtual environment - source .venv/bin/activate + - python --version + - pip --version script: - git fetch --tags - cd ${DOCS_SOURCE_DIR}/.. - - # Build only current version to reduce artifact size + # Build only current version to keep artifacts small - sphinx-build -b html ${DOCS_SOURCE_DIR} ../${SPHINX_OUTPUT_DIR}/latest - - # Optional: Uncomment for full versioned builds (may need artifact splitting) - # - sphinx-multiversion ${DOCS_SOURCE_DIR} ../${SPHINX_OUTPUT_DIR} - - # Reduce artifact size by deleting unnecessary files + # Optional cleanup to reduce size - find ../${SPHINX_OUTPUT_DIR} -name '*.pyc' -delete - # NOTE: mogrify (ImageMagick) isn't in the python image by default; remove or install if you need this step. + # If you REALLY need to convert SVGs, install ImageMagick first; otherwise keep this disabled: # - apt-get update && apt-get install -y imagemagick # - find ../${SPHINX_OUTPUT_DIR} -name '*.svg' -exec mogrify -format png {} \; -delete artifacts: diff --git a/tests/lexis_test2.py b/tests/lexis_test2.py index c4593ee..59eb4b6 100644 --- a/tests/lexis_test2.py +++ b/tests/lexis_test2.py @@ -50,7 +50,7 @@ for i in range(2000): except: traceback.print_exc() print("ERROR IN get project collection Trying to refresh session") - irods. __check_access_token + print("==========================================") -- 2.51.2