From 9e2ac0676fc6129c52eff4c6403bd29eabf7cc9c Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Tue, 7 Nov 2023 10:31:36 +0100 Subject: [PATCH 01/14] uniform workflow acrso repositories --- .circleci/config.yml | 58 ++++++++++++-------------------------------- 1 file changed, 16 insertions(+), 42 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b836e0f19..b255cc4ea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,74 +1,48 @@ -# Use the latest 2.1 version of CircleCI pipeline process engine. -# See: https://circleci.com/docs/2.0/configuration-reference version: 2.1 - -# Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects. -# See: https://circleci.com/docs/2.0/orb-intro/ orbs: - # The python orb contains a set of prepackaged CircleCI configuration you can use repeatedly in your configuration files - # Orb commands and jobs help you with common scripting around a language/tool - # so you dont have to copy and paste it everywhere. - # See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/python python: circleci/python@1.5.0 - -# Define a job to be invoked later in a workflow. -# See: https://circleci.com/docs/2.0/configuration-reference/#jobs jobs: - build-docs: # This is the name of the job, feel free to change it to better match what you're trying to do! - # These next lines defines a Docker executors: https://circleci.com/docs/2.0/executor-types/ - # You can specify an image from Dockerhub or use one of the convenience images from CircleCI's Developer Hub - # A list of available CircleCI Docker convenience images are available here: https://circleci.com/developer/images/image/cimg/python - # The executor is the environment in which the steps below will be executed - below will use a python 3.10.2 container - # Change the version below to your required version of python + build-docs: docker: - image: cimg/python:3.10.2 - # Checkout the code as the first step. This is a dedicated CircleCI step. - # The python orb's install-packages step will install the dependencies from a Pipfile via Pipenv by default. - # Here we're making sure we use just use the system-wide pip. By default it uses the project root's requirements.txt. - # Then run your tests! - # CircleCI will report the results back to your VCS provider. steps: - - checkout + - checkout: + path: docs + - run: + name: Clone main repo into a subdirectory + command: git clone git@github.com:napari/napari.git napari - run: name: Install qt libs + xvfb command: sudo apt-get update && sudo apt-get install -y xvfb libegl1 libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 x11-utils - - run: name: Setup virtual environment - # app-dir: ~/project/package-directory/ # If you're requirements.txt isn't in the root directory. command: | python -m venv venv . venv/bin/activate python -m pip install --upgrade pip - - run: - name: Clone main repo - command: git clone git@github.com:napari/napari.git napari + - run: name: Install napari-dev command: | - . venv/bin/activate - python -m pip install -e napari/".[pyside,dev]" -c "napari/resources/constraints/constraints_py3.10_docs.txt" - - run: - name: Install python dependencies - command: | - . venv/bin/activate - python -m pip install -r requirements.txt -c "napari/resources/constraints/constraints_py3.10_docs.txt" + . app/venv/bin/activate + python -m pip install -e "napari/[pyside,dev]" + environment: + PIP_CONSTRAINT: napari/resources/constraints/constraints_py3.10_docs.txt - run: name: Build docs command: | . venv/bin/activate + cd docs xvfb-run --auto-servernum make docs GALLERY_PATH=../napari/examples/ + environment: + PIP_CONSTRAINT: napari/resources/constraints/constraints_py3.10_docs.txt - store_artifacts: path: docs/_build/ - persist_to_workspace: root: . paths: - docs/_build/ - -# Invoke jobs via workflows -# See: https://circleci.com/docs/2.0/configuration-reference/#workflows workflows: - build-docs: # This is the name of the workflow, feel free to change it to better match your workflow. - # Inside the workflow, you define the jobs you want to run. + build-docs: jobs: - - build-docs + - build-docs \ No newline at end of file From 6a31187b7d8db143b1f1b1d49f2914978e739499 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Tue, 7 Nov 2023 10:34:21 +0100 Subject: [PATCH 02/14] fix path --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b255cc4ea..9288ced3a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,7 +24,7 @@ jobs: - run: name: Install napari-dev command: | - . app/venv/bin/activate + . venv/bin/activate python -m pip install -e "napari/[pyside,dev]" environment: PIP_CONSTRAINT: napari/resources/constraints/constraints_py3.10_docs.txt From b980bb6bc6f4d5cac32183f2e2b238328759159f Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Tue, 7 Nov 2023 10:36:08 +0100 Subject: [PATCH 03/14] add enter --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9288ced3a..7e10b4040 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -45,4 +45,4 @@ jobs: workflows: build-docs: jobs: - - build-docs \ No newline at end of file + - build-docs From 5adab1c764421c9bdf530380644491279b556421 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Tue, 7 Nov 2023 11:18:51 +0100 Subject: [PATCH 04/14] sync github workflows --- .github/workflows/build_docs.yml | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index a75b80e6f..df5c73f70 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -14,31 +14,34 @@ jobs: runs-on: ubuntu-latest steps: - name: Clone docs repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + path: docs # place in a named directory - name: Clone main repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: napari # place in a named directory repository: napari/napari # ensure version metadata is proper fetch-depth: 0 - - name: Copy examples to docs folder - run: | - cp -R napari/examples . - - uses: actions/setup-python@v4 with: python-version: "3.10" + cache-dependency-path: | + napari/setup.cfg + docs/requirements.txt - uses: tlambert03/setup-qt-libs@v1 - name: Install Dependencies run: | python -m pip install --upgrade pip - python -m pip install "napari/[all]" -c "napari/resources/constraints/constraints_py3.10_docs.txt" - python -m pip install -r requirements.txt -c "napari/resources/constraints/constraints_py3.10_docs.txt" + python -m pip install "napari/[all]" + python -m pip install -r requirements.txt + env: + PIP_CONSTRAINT: ${{ github.workspace }}/napari/resources/constraints/constraints_py3.10_docs.txt - name: Testing run: | @@ -50,11 +53,15 @@ jobs: env: GOOGLE_CALENDAR_ID: ${{ secrets.GOOGLE_CALENDAR_ID }} GOOGLE_CALENDAR_API_KEY: ${{ secrets.GOOGLE_CALENDAR_API_KEY }} + PIP_CONSTRAINT: ${{ github.workspace }}/napari-repo/resources/constraints/constraints_py3.10_docs.txt with: - run: make docs GALLERY_PATH=../examples/ + # the napari-docs repo is cloned into a docs/ folder, hence the + # invocation below. Locally, you should simply run make docs + run: make -C docs docs GALLERY_PATH=../examples/ + - name: Upload artifact uses: actions/upload-artifact@v3 with: name: docs - path: docs/_build + path: docs/docs/_build From 521dd063d70471856430f9b841bb2a7a827fd6ab Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Tue, 7 Nov 2023 11:31:30 +0100 Subject: [PATCH 05/14] fix path --- .github/workflows/build_docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index df5c73f70..427680bcc 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -39,7 +39,7 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install "napari/[all]" - python -m pip install -r requirements.txt + python -m pip install -r docs/requirements.txt env: PIP_CONSTRAINT: ${{ github.workspace }}/napari/resources/constraints/constraints_py3.10_docs.txt From 8d46539764996a916d792629b28ce5ebd56387d1 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Tue, 7 Nov 2023 11:39:39 +0100 Subject: [PATCH 06/14] fix path 2 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7e10b4040..76dc11b8b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,7 +35,7 @@ jobs: cd docs xvfb-run --auto-servernum make docs GALLERY_PATH=../napari/examples/ environment: - PIP_CONSTRAINT: napari/resources/constraints/constraints_py3.10_docs.txt + PIP_CONSTRAINT: ../napari/resources/constraints/constraints_py3.10_docs.txt - store_artifacts: path: docs/_build/ - persist_to_workspace: From 471cff33ace1f2673df3d25e7e0abadb449ed5ca Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Tue, 7 Nov 2023 11:59:46 +0100 Subject: [PATCH 07/14] try new paths --- .circleci/config.yml | 2 +- .github/workflows/build_docs.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 76dc11b8b..28b85e8d1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,7 +33,7 @@ jobs: command: | . venv/bin/activate cd docs - xvfb-run --auto-servernum make docs GALLERY_PATH=../napari/examples/ + xvfb-run --auto-servernum make docs GALLERY_PATH=../../napari/examples/ environment: PIP_CONSTRAINT: ../napari/resources/constraints/constraints_py3.10_docs.txt - store_artifacts: diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 427680bcc..6136d64da 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -53,7 +53,7 @@ jobs: env: GOOGLE_CALENDAR_ID: ${{ secrets.GOOGLE_CALENDAR_ID }} GOOGLE_CALENDAR_API_KEY: ${{ secrets.GOOGLE_CALENDAR_API_KEY }} - PIP_CONSTRAINT: ${{ github.workspace }}/napari-repo/resources/constraints/constraints_py3.10_docs.txt + PIP_CONSTRAINT: ${{ github.workspace }}/napari/resources/constraints/constraints_py3.10_docs.txt with: # the napari-docs repo is cloned into a docs/ folder, hence the # invocation below. Locally, you should simply run make docs From c757f521dead78fb2cca8cf18bbcc2e351a1e56e Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Tue, 7 Nov 2023 12:06:02 +0100 Subject: [PATCH 08/14] add next `..` --- .github/workflows/build_docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 6136d64da..277ac9a57 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -57,7 +57,7 @@ jobs: with: # the napari-docs repo is cloned into a docs/ folder, hence the # invocation below. Locally, you should simply run make docs - run: make -C docs docs GALLERY_PATH=../examples/ + run: make -C docs docs GALLERY_PATH=../../examples/ - name: Upload artifact From 95ea400a89fbe028c17cd7d2ebea5ea063e043b2 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Tue, 7 Nov 2023 12:10:44 +0100 Subject: [PATCH 09/14] fix persist path --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 28b85e8d1..8bc680c2d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,11 +37,11 @@ jobs: environment: PIP_CONSTRAINT: ../napari/resources/constraints/constraints_py3.10_docs.txt - store_artifacts: - path: docs/_build/ + path: docs/docs/_build/ - persist_to_workspace: root: . paths: - - docs/_build/ + - docs/docs/_build/ workflows: build-docs: jobs: From c331601cd3603b0f036cef72b445eea1e4dcfa26 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Tue, 7 Nov 2023 12:16:35 +0100 Subject: [PATCH 10/14] do not overwritte GALLERY_PATH --- .circleci/config.yml | 2 +- .github/workflows/build_docs.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8bc680c2d..1665d336f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,7 +33,7 @@ jobs: command: | . venv/bin/activate cd docs - xvfb-run --auto-servernum make docs GALLERY_PATH=../../napari/examples/ + xvfb-run --auto-servernum make docs environment: PIP_CONSTRAINT: ../napari/resources/constraints/constraints_py3.10_docs.txt - store_artifacts: diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 277ac9a57..ae9c016b4 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -57,7 +57,7 @@ jobs: with: # the napari-docs repo is cloned into a docs/ folder, hence the # invocation below. Locally, you should simply run make docs - run: make -C docs docs GALLERY_PATH=../../examples/ + run: make -C docs docs - name: Upload artifact From b6a65657b9798972a3abc511a3f0c4c602af9163 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Tue, 7 Nov 2023 12:18:00 +0100 Subject: [PATCH 11/14] remove obsolete comment --- .github/workflows/build_docs.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index ae9c016b4..9c58f97e8 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -55,8 +55,6 @@ jobs: GOOGLE_CALENDAR_API_KEY: ${{ secrets.GOOGLE_CALENDAR_API_KEY }} PIP_CONSTRAINT: ${{ github.workspace }}/napari/resources/constraints/constraints_py3.10_docs.txt with: - # the napari-docs repo is cloned into a docs/ folder, hence the - # invocation below. Locally, you should simply run make docs run: make -C docs docs From 5d5e74452a70ab28f9e6f0d8b1d4e91cab01b0a2 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Tue, 7 Nov 2023 12:31:01 +0100 Subject: [PATCH 12/14] fix trailing spaces --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1665d336f..411655cdb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2.1 orbs: python: circleci/python@1.5.0 jobs: - build-docs: + build-docs: docker: - image: cimg/python:3.10.2 steps: @@ -25,7 +25,7 @@ jobs: name: Install napari-dev command: | . venv/bin/activate - python -m pip install -e "napari/[pyside,dev]" + python -m pip install -e "napari/[pyside,dev]" environment: PIP_CONSTRAINT: napari/resources/constraints/constraints_py3.10_docs.txt - run: @@ -43,6 +43,6 @@ jobs: paths: - docs/docs/_build/ workflows: - build-docs: + build-docs: jobs: - build-docs From aae09b2aefb8cbcbf0cf794740e06be9a61fe4f8 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Sat, 11 Nov 2023 12:47:32 +0100 Subject: [PATCH 13/14] restore part of comments --- .circleci/config.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 411655cdb..28d8c168f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,10 +1,15 @@ +# Use the latest 2.1 version of CircleCI pipeline process engine. +# See: https://circleci.com/docs/2.1/configuration-reference version: 2.1 +# Orbs are reusable packages of CircleCI configuration that you may share across projects. +# See: https://circleci.com/docs/2.1/orb-intro/ orbs: python: circleci/python@1.5.0 jobs: build-docs: docker: - - image: cimg/python:3.10.2 + # A list of available CircleCI Docker convenience images are available here: https://circleci.com/developer/images/image/cimg/python + - image: cimg/python:3.10.13 steps: - checkout: path: docs From b965aee1aa4d7d9242b98cb90ca068f06f20c957 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Sat, 11 Nov 2023 15:47:01 +0100 Subject: [PATCH 14/14] Update .circleci/config.yml Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com> --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 28d8c168f..581424b69 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,3 +1,5 @@ +# As much as possible, this file should be kept in sync with: +# https://github.com/napari/napari/blob/main/.circleci/config.yaml # Use the latest 2.1 version of CircleCI pipeline process engine. # See: https://circleci.com/docs/2.1/configuration-reference version: 2.1