Skip to content

Optional AI Assistant Rules (AGENTS.md) #1220

Optional AI Assistant Rules (AGENTS.md)

Optional AI Assistant Rules (AGENTS.md) #1220

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches: ["*"]
schedule:
- cron: "0 0 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
names:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: "my_extension"
pyname: "my_extension"
- name: "myextension"
pyname: "myextension"
- name: "my-extension"
pyname: "my_extension"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Setup Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Install dependencies
run: |
python -m pip install "copier>=9.2.0" jinja2-time
- name: Create pure frontend extension
env:
NAME: ${{ matrix.name }}
PYNAME: ${{ matrix.pyname }}
run: |
set -eux
mkdir ${NAME}
python -m copier copy -l -d author_name="My Name" -d labextension_name="${NAME}" -d python_name="${PYNAME}" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . ${NAME}
pushd ${NAME}
python -m pip install "jupyterlab>=4.0.0,<5" setuptools
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
jlpm lint:check
python -m pip install -e .
jupyter labextension develop . --overwrite
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "${NAME}.*OK"
python -m jupyterlab.browser_check
jupyter labextension uninstall ${NAME}
python -m pip uninstall -y ${NAME} jupyterlab
popd
rm -rf ${NAME}
quoted-description:
runs-on: ubuntu-latest
strategy:
matrix:
# This will be used by the base setup action
python-version: ["3.13"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Install dependencies
run: |
python -m pip install "copier>=9.2.0" jinja2-time
- name: Setup Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Create pure frontend extension
run: |
set -eux
mkdir myextension
python -m copier copy -l -d author_name="My Name" -d description="Let's \"rock and roll\"" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension
pushd myextension
pip install "jupyterlab>=4.0.0,<5" setuptools
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
jlpm lint:check
pip install -e .
jupyter labextension develop . --overwrite
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "myextension.*OK"
python -m jupyterlab.browser_check
jupyter labextension uninstall myextension
pip uninstall -y myextension jupyterlab
popd
rm -rf myextension
no-tests:
runs-on: ubuntu-latest
strategy:
matrix:
# This will be used by the base setup action
python-version: ["3.13"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Install dependencies
run: |
python -m pip install "copier>=9.2.0" jinja2-time
- name: Setup Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Create pure frontend extension
run: |
set -eux
mkdir myextension
python -m copier copy -l -d author_name="My Name" -d test=n -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension
pushd myextension
pip install "jupyterlab>=4.0.0,<5" setuptools
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
jlpm lint:check
pip install -e .
jupyter labextension develop . --overwrite
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "myextension.*OK"
python -m jupyterlab.browser_check
jupyter labextension uninstall myextension
pip uninstall -y myextension jupyterlab
popd
rm -rf myextension
settings:
runs-on: ubuntu-latest
strategy:
matrix:
# This will be used by the base setup action
python-version: ["3.9", "3.13"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Install dependencies
run: |
python -m pip install "copier>=9.2.0" jinja2-time
- name: Setup Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Create pure frontend extension
run: |
set -eux
mkdir myextension
python -m copier copy -l -d author_name="My Name" -d has_settings=y -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension
pushd myextension
pip install "jupyterlab>=4.0.0,<5" setuptools
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
# It is not easily possible to get this version compatible with linter rules
jlpm lint
jlpm lint:check
pip install -e .
jupyter labextension develop . --overwrite
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "myextension.*OK"
python -m jupyterlab.browser_check
jupyter labextension uninstall myextension
pip uninstall -y myextension jupyterlab
popd
rm -rf myextension
ai-rules:
runs-on: ubuntu-latest
strategy:
matrix:
# Test different combinations of AI rules settings
include:
- has_ai_rules: "y"
create_claude_symlink: "y"
create_gemini_symlink: "y"
- has_ai_rules: "y"
create_claude_symlink: "n"
create_gemini_symlink: "y"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Install dependencies
run: |
python -m pip install "copier>=9.2.0" jinja2-time
- name: Setup Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Create extension with AI rules
run: |
set -eux
mkdir myextension
python -m copier copy -l -d author_name="My Name" -d has_ai_rules=${{ matrix.has_ai_rules }} -d create_claude_symlink=${{ matrix.create_claude_symlink }} -d create_gemini_symlink=${{ matrix.create_gemini_symlink }} -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension
cd myextension
- name: Verify AGENTS.md exists
run: |
set -eux
cd myextension
test -f AGENTS.md
echo "✓ AGENTS.md exists"
# Verify it has content
test -s AGENTS.md
echo "✓ AGENTS.md is not empty"
# Check for expected content markers
grep -q "JupyterLab Extension Development" AGENTS.md
echo "✓ AGENTS.md contains expected content"
- name: Verify CLAUDE.md symlink (if enabled)
if: matrix.create_claude_symlink == 'y'
run: |
set -eux
cd myextension
test -L CLAUDE.md
echo "✓ CLAUDE.md is a symlink"
# Verify it points to AGENTS.md
readlink CLAUDE.md | grep -q "AGENTS.md"
echo "✓ CLAUDE.md points to AGENTS.md"
# Verify content is accessible through symlink
test -s CLAUDE.md
echo "✓ CLAUDE.md symlink is readable"
- name: Verify CLAUDE.md does not exist (if disabled)
if: matrix.create_claude_symlink == 'n'
run: |
set -eux
cd myextension
if [ -f CLAUDE.md ]; then
echo "✗ CLAUDE.md should not exist when create_claude_symlink=n"
exit 1
fi
echo "✓ CLAUDE.md correctly not created"
- name: Verify GEMINI.md symlink (if enabled)
if: matrix.create_gemini_symlink == 'y'
run: |
set -eux
cd myextension
test -L GEMINI.md
echo "✓ GEMINI.md is a symlink"
readlink GEMINI.md | grep -q "AGENTS.md"
echo "✓ GEMINI.md points to AGENTS.md"
test -s GEMINI.md
echo "✓ GEMINI.md symlink is readable"
- name: Install and validate extension still works
run: |
set -eux
cd myextension
pip install "jupyterlab>=4.0.0,<5" setuptools
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
jlpm lint:check
pip install -e .
jupyter labextension develop . --overwrite
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "myextension.*OK"
- name: Cleanup
if: always()
run: rm -rf myextension
server:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
# This will be used by the base setup action
python-version: ["3.9", "3.13"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Install dependencies
run: |
python -m pip install "copier>=9.2.0" jinja2-time build
- name: Setup Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Create server extension pip install
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
run: |
mkdir myextension
python -m copier copy -l -d kind=frontend-and-server -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension
cd myextension
cat pyproject.toml
pip install .
pip install "jupyterlab>=4.0.0,<5"
jlpm
jlpm lint:check
- name: Check pip install method
run: |
set -eux
jupyter server extension list
jupyter server extension list 2>&1 | grep -ie "myextension.*OK"
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "myextension.*OK"
# This test should be made outside the extension folder
python -m jupyterlab.browser_check
pip uninstall -y myextension jupyterlab
rm -rf myextension
shell: bash
- name: Create server extension pip develop
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
run: |
mkdir myextension
python -m copier copy -l -d kind=frontend-and-server -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension
cd myextension
python -m pip install -e .[test]
python -m pip install "jupyterlab>=4.0.0,<5" setuptools
jupyter labextension develop . --overwrite
jupyter server extension enable myextension
# Check unit tests are passing
python -m pytest -vv -r ap --cov myextension
- name: Check pip develop method
run: |
set -eux
jupyter server extension list
jupyter server extension list 2>&1 | grep -ie "myextension.*OK"
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "myextension.*OK"
# This test should be made outside the extension folder
python -m jupyterlab.browser_check
shell: bash
- name: Build server extension in develop mode
run: |
jupyter labextension develop ./myextension --overwrite
jupyter labextension build ./myextension
jupyter labextension uninstall myextension
python -m pip uninstall -y myextension jupyterlab
- run: |
set -eux
rm -rf myextension
shell: bash
- name: Install server extension from a tarball
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
run: |
mkdir myextension
python -m copier copy -l -d kind=frontend-and-server -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension
cd myextension
python -m pip install "jupyterlab>=4.0.0,<5"
jupyter lab clean --all
python -m build
cd dist
python -m pip install myextension-0.1.0.tar.gz
- name: Check install tarball method
run: |
set -eux
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "myextension.*OK"
jupyter server extension list
jupyter server extension list 2>&1 | grep -ie "myextension.*OK"
jupyter lab build --dev-build --no-minimize
python -m jupyterlab.browser_check
cp myextension/dist/*.tar.gz myextension.tar.gz
cp myextension/dist/*.whl myextension.whl
python -m pip uninstall -y myextension jupyterlab
rm -rf myextension
shell: bash
- uses: actions/upload-artifact@v4
if: startsWith(runner.os, 'Linux')
with:
name: myextension-sdist-${{ matrix.python-version }}
path: |
myextension.tar.gz
myextension.whl
test_isolated:
needs: server
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.13"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: "x64"
- name: Setup pip cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
pip-${{ matrix.python-version }}-
pip-
- uses: actions/download-artifact@v4
with:
name: myextension-sdist-${{ matrix.python-version }}
- name: Install and Test
run: |
set -eux
# Remove NodeJS, twice to take care of system and locally installed node versions.
sudo rm -rf $(which node)
sudo rm -rf $(which node)
python -m pip install myextension.tar.gz
python -m pip install "jupyterlab>=4.0.0,<5"
jupyter labextension list 2>&1 | grep -ie "myextension.*OK"
jupyter server extension list
jupyter server extension list 2>&1 | grep -ie "myextension.*OK"
python -m jupyterlab.browser_check --no-browser-test
theme:
runs-on: ubuntu-latest
strategy:
matrix:
# This will be used by the base setup action
python-version: ["3.9", "3.13"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Install dependencies
run: |
python -m pip install "copier>=9.2.0" jinja2-time build
- name: Setup Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Create pure frontend extension
run: |
set -eux
mkdir mytheme
python -m copier copy -l -d kind=theme -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . mytheme
pushd mytheme
python -m pip install "jupyterlab>=4.0.0,<5" setuptools
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
jlpm lint:check
python -m pip install -e .
jupyter labextension develop . --overwrite
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "mytheme.*OK"
python -m jupyterlab.browser_check
jupyter labextension uninstall mytheme
python -m pip uninstall -y mytheme jupyterlab
popd
rm -rf mytheme
mimerenderer:
runs-on: ubuntu-latest
strategy:
matrix:
# This will be used by the base setup action
python-version: ["3.9", "3.13"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Install dependencies
run: |
python -m pip install "copier>=9.2.0" jinja2-time build
- name: Setup Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Create pure frontend extension
run: |
set -eux
mkdir myextension
python -m copier copy -l -d kind=mimerenderer -d viewer_name="My Viewer" -d mimetype="application/vnd.my_org.my_type" -d mimetype_name="my_type" -d file_extension=".my_type" -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension
pushd myextension
python -m pip install "jupyterlab>=4.0.0,<5" setuptools
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
jlpm lint:check
python -m pip install -e .
jupyter labextension develop . --overwrite
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "myextension.*OK"
python -m jupyterlab.browser_check
jupyter labextension uninstall myextension
python -m pip uninstall -y myextension jupyterlab
popd
rm -rf myextension
pnpm_linker:
runs-on: ubuntu-latest
strategy:
matrix:
kind: ["frontend", "frontend-and-server", "theme"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Install dependencies
run: |
python -m pip install "copier>=9.2.0" jinja2-time
- name: Setup Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Create pure frontend extension
env:
KIND: ${{ matrix.kind }}
run: |
set -eux
mkdir myextension
python -m copier copy -l -d kind=${KIND} -d author_name="My Name" -d labextension_name=myextension -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension
pushd myextension
sed -i 's/^\(nodeLinker:\s\).*$/\1pnpm/' .yarnrc.yml
python -m pip install "jupyterlab>=4.0.0,<5"
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
if [ ! -d node_modules/.store ] ; then echo 'nodes_module directory should contain a .store directory when using pnpm nodeLinker'; exit 1; fi;
jlpm build
popd
rm -rf myextension