Skip to content

Commit

Permalink
Merge branch 'main' into pyautogui
Browse files Browse the repository at this point in the history
  • Loading branch information
melissawm authored Nov 30, 2024
2 parents c14a7b1 + e192a22 commit 6f0aa88
Show file tree
Hide file tree
Showing 342 changed files with 9,316 additions and 4,594 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ jobs:
environment:
PIP_CONSTRAINT: ../napari/resources/constraints/constraints_py3.10_docs.txt
- store_artifacts:
path: docs/docs/_build/
path: docs/docs/_build/html/
- persist_to_workspace:
root: .
paths:
- docs/docs/_build/
- docs/docs/_build/html/
workflows:
build-docs:
jobs:
Expand Down
28 changes: 5 additions & 23 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
# See: .github/workflows/labeler.yml and https://github.com/marketplace/actions/labeler
design:
- 'napari/_qt/qt_resources/**/*'

documentation:
- 'docs/**/*'
- 'docs/*'

preferences:
- 'napari/_qt/**/*/preferences_dialog.py'
- 'napari/settings/**/*.py'

qt:
- 'napari/_qt/**/*.py'
- 'napari/_qt/**/*.py'
- 'napari/qt/**/*.py'
- 'napari/qt/**/*.py'

task:
- '.github/**/*'

tests:
- '**/*/_tests/**/*.py'
- changed-files:
- any-glob-to-any-file: 'docs/**'

vispy:
- 'napari/_vispy'
maintenance:
- changed-files:
- any-glob-to-any-file: ['.circleci/*', '.github/**/*']
18 changes: 18 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Actionlint

on:
pull_request:
paths:
- '.github/**'

jobs:
actionlint:
name: Action lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check workflow files
run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
./actionlint -color -ignore SC2129
shell: bash
121 changes: 121 additions & 0 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# As much as possible, this file should be kept in sync with
# https://github.com/napari/napari/blob/main/.github/workflows/build_docs.yml
#
# Note this workflow is also triggered by
# https://github.com/napari/napari/blob/main/.github/workflows/deploy_docs.yml when a
# commit to `main` occurs in `napari/napari`

name: Build & Deploy PR Docs

on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
workflow_dispatch:
inputs:
target_directory:
description: 'The directory to deploy the docs to'
required: true
default: 'dev'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-upload:
name: Build & Upload Artifact
runs-on: ubuntu-latest
steps:
- name: Clone docs repo
uses: actions/checkout@v4
with:
# place in '/home/runner/work/docs/docs/docs'
path: docs # place in a named directory

- name: Clone main repo
uses: actions/checkout@v4
with:
# place in '/home/runner/work/docs/docs/napari'
path: napari # place in a named directory
repository: napari/napari
# ensure version metadata is proper
fetch-depth: 0

- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache-dependency-path: |
napari/pyproject.toml
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]"
env:
PIP_CONSTRAINT: ${{ github.workspace }}/napari/resources/constraints/constraints_py3.10_docs.txt

- name: Testing
run: |
python -c 'import napari; print(napari.__version__)'
python -c 'import napari.layers; print(napari.layers.__doc__)'
- name: Create fallback videos
run: |
sudo apt-get update && sudo apt-get install -y ffmpeg
cd docs
make fallback-videos
- name: Build Docs
uses: aganders3/headless-gui@v2
env:
GOOGLE_CALENDAR_ID: ${{ secrets.GOOGLE_CALENDAR_ID }}
GOOGLE_CALENDAR_API_KEY: ${{ secrets.GOOGLE_CALENDAR_API_KEY }}
PIP_CONSTRAINT: ${{ github.workspace }}/napari/resources/constraints/constraints_py3.10_docs.txt
with:
# Runs in '/home/runner/work/docs/docs/docs'
# Built HTML pages in '/home/runner/work/docs/docs/docs/docs/_build/html'
run: make -C docs docs
# skipping setup stops the action from running the default (tiling) window manager
# the window manager is not necessary for docs builds at this time and it was causing
# problems with screenshots (https://github.com/napari/docs/issues/285)
linux-setup: "echo 'skip setup'"
linux-teardown: "echo 'skip teardown'"

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: html
path: docs/docs/_build/html/

deploy:
name: Download & Deploy Artifact
needs: build-and-upload
runs-on: ubuntu-latest
# Working directory: '/home/runner/work/docs/docs'
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: html
# Downloads to '/home/runner/work/docs/docs/html'
path: html

- name: Deploy Docs
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && (startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/main'))
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: napari/napari.github.io
publish_dir: ./html
publish_branch: gh-pages
destination_dir: ${{ github.event.inputs.target_directory || 'dev' }}
cname: napari.org
2 changes: 1 addition & 1 deletion .github/workflows/circleci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
api-token: ${{ secrets.CIRCLECI_TOKEN }}
artifact-path: 0/docs/docs/_build/index.html
artifact-path: 0/docs/docs/_build/html/index.html
circleci-jobs: build-docs
job-title: Check the rendered docs here!
80 changes: 0 additions & 80 deletions .github/workflows/deploy_docs.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/edit_pr_description.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Remove html In PR description
on:
# see https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
pull_request_target:
types:
- opened
- synchronize
- reopened
- edited
permissions:
pull-requests: write

jobs:
remove_comment:
name: Remove html comments.
uses: napari/napari/.github/workflows/edit_pr_description.yml@main
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
Original file line number Diff line number Diff line change
@@ -1,40 +1,37 @@
# As much as possible, this file should be kept in sync with
# https://github.com/napari/napari/blob/main/.github/workflows/build_docs.yml
name: Build PR Docs
name: External links checker

on:
pull_request:
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
repository_dispatch:
workflow_dispatch: # can also be triggered manually
schedule:
- cron: "0 0 * * *" # every sunday at midnight

jobs:
build-and-upload:
name: Build & Upload Artifact
link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Clone docs repo
uses: actions/checkout@v4
with:
# place in '/home/runner/work/docs/docs/docs'
path: docs # place in a named directory

- name: Clone main repo
uses: actions/checkout@v4
with:
# place in '/home/runner/work/docs/docs/napari'
path: napari # place in a named directory
repository: napari/napari
# ensure version metadata is proper
fetch-depth: 0

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache-dependency-path: |
napari/setup.cfg
napari/pyproject.toml
docs/requirements.txt
- uses: tlambert03/setup-qt-libs@v1
Expand All @@ -43,31 +40,29 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install "napari/[all]"
python -m pip install -r docs/requirements.txt
env:
PIP_CONSTRAINT: ${{ github.workspace }}/napari/resources/constraints/constraints_py3.10_docs.txt

- name: Testing
run: |
python -c 'import napari; print(napari.__version__)'
python -c 'import napari.layers; print(napari.layers.__doc__)'
- name: Build Docs
- name: Run link checker
uses: aganders3/headless-gui@v2
env:
GOOGLE_CALENDAR_ID: ${{ secrets.GOOGLE_CALENDAR_ID }}
GOOGLE_CALENDAR_API_KEY: ${{ secrets.GOOGLE_CALENDAR_API_KEY }}
PIP_CONSTRAINT: ${{ github.workspace }}/napari/resources/constraints/constraints_py3.10_docs.txt
with:
run: make -C docs docs
# Runs in '/home/runner/work/docs/docs/docs'
# Built HTML pages in '/home/runner/work/docs/docs/docs/docs/_build/html'
run: |
python -m pip install -r docs/requirements.txt
make -C docs linkcheck-files
# skipping setup stops the action from running the default (tiling) window manager
# the window manager is not necessary for docs builds at this time and it was causing
# problems with screenshots (https://github.com/napari/docs/issues/285)
linux-setup: "echo 'skip setup'"
linux-teardown: "echo 'skip teardown'"

- name: Upload artifact
uses: actions/upload-artifact@v3
- name: Create issue from file
if: ${{ failure() }}
uses: peter-evans/create-issue-from-file@v4
with:
name: docs
path: docs/docs/_build
title: Link Checker Report
content-filepath: ./docs/docs/_build/html/output.txt
labels: maintenance, task
Loading

0 comments on commit 6f0aa88

Please sign in to comment.