Skip to content

Commit

Permalink
Initial project skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSkovMadsen committed Nov 23, 2024
0 parents commit e620144
Show file tree
Hide file tree
Showing 28 changed files with 1,426 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This file is managed by Copier; DO NOT EDIT OR REMOVE.
_commit: dbdb5dc
_src_path: https://github.com/panel-extensions/copier-template-panel-extension
add_autobump_workflow: true
author_email: marc.skov.madsen@gmail.com
author_name: Marc Skov Madsen
docs_url: https://awesome-panel.github.io/panel-copy-paste/
github_url: https://github.com/awesome-panel/panel-copy-paste
github_user: awesome-panel
minimal_python_version: py311
project_short_description: Extends HoloViz Panel with functionality to copy to and
paste from the clipboard
project_slug: panel-copy-paste
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pixi.lock linguist-language=YAML linguist-generated=true
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @awesome-panel
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
groups:
gh-actions:
patterns:
- "*"
45 changes: 45 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build
on:
pull_request:
push:
branches:
- main
tags:
- "*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Set up pixi
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 # v0.8.1
with:
environments: build
- name: Build project
run: pixi run -e build build-wheel
- name: Check package
run: pixi run -e build check-wheel
- name: Upload package
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: artifact
path: dist/*

release:
name: Publish package
if: startsWith(github.ref, 'refs/tags/')
needs: [build]
runs-on: ubuntu-latest
permissions:
id-token: write
environment: pypi
steps:
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: artifact
path: dist
- name: Publish package on PyPi
uses: pypa/gh-action-pypi-publish@f7600683efdcb7656dec5b29656edb7bc586e597 # v1.10.3
168 changes: 168 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
name: CI
on:
pull_request:
push:
branches:
- main
# Automatically stop old builds on the same branch/PR
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
setup:
name: Setup workflow
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
code_change: ${{ steps.filter.outputs.code }}
matrix: ${{ env.MATRIX }}
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request'
- name: Check for code changes
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
code:
- 'src/**'
- 'pyproject.toml'
- '.github/workflows/ci.yaml'
- name: Set matrix option
run: |
if [[ '${{ github.event_name }}' == 'workflow_dispatch' ]]; then
OPTION=${{ github.event.inputs.target }}
elif [[ '${{ github.event_name }}' == 'schedule' ]]; then
OPTION="full"
elif [[ '${{ github.event_name }}' == 'push' && '${{ github.ref_type }}' == 'tag' ]]; then
OPTION="full"
else
OPTION="default"
fi
echo "MATRIX_OPTION=$OPTION" >> $GITHUB_ENV
- name: Set test matrix with 'default' option
if: env.MATRIX_OPTION == 'default'
run: |
MATRIX=$(jq -nsc '{
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
"environment": ["test-310", "test-312"],
}')
echo "MATRIX=$MATRIX" >> $GITHUB_ENV
- name: Set test matrix with 'full' option
if: env.MATRIX_OPTION == 'full'
run: |
MATRIX=$(jq -nsc '{
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
"environment": ["test-310", "test-311", "test-312"]
}')
echo "MATRIX=$MATRIX" >> $GITHUB_ENV
- name: Set test matrix with 'downstream' option
if: env.MATRIX_OPTION == 'downstream'
run: |
MATRIX=$(jq -nsc '{
"os": ["ubuntu-latest"],
"environment": ["test-311"]
}')
echo "MATRIX=$MATRIX" >> $GITHUB_ENV
pixi_lock:
name: Pixi lock
runs-on: ubuntu-latest
steps:
- uses: holoviz-dev/holoviz_tasks/pixi_lock@v0
with:
cache: ${{ github.event.inputs.cache == 'true' || github.event.inputs.cache == '' }}

pre-commit:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up pixi
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 # v0.8.1
with:
environments: default lint
- name: pre-commit
run: pixi run pre-commit-run --color=always --show-diff-on-failure
pytest:
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
environment:
- py311
- py312
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- name: Checkout branch
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Set up pixi
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 # v0.8.1
with:
environments: ${{ matrix.environment }}
- name: Install repository
run: pixi run -e ${{ matrix.environment }} postinstall
- name: Run pytest
run: pixi run -e ${{ matrix.environment }} test-coverage --color=yes

pytest_ui:
name: ui:${{ matrix.environment }}:${{ matrix.os }}
needs: [pre-commit, setup, pixi_lock]
runs-on: ${{ matrix.os }}
if: needs.setup.outputs.code_change == 'true'
strategy:
fail-fast: false
matrix:
environment: ["test-ui"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
timeout-minutes: 60
env:
PANEL_LOG_LEVEL: info
steps:
- name: Checkout branch
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0

- name: Set up Pixi
uses: prefix-dev/setup-pixi@v0.8.1
with:
environments: ${{ matrix.environment }}

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 'py311'

- name: Install Dependencies
run: |
pixi run -e ${{ matrix.environment }} postinstall
- name: Verify Pixi Installation
run: pixi --version

- name: Configure Coverage
run: |
echo "[run]" > .uicoveragerc
echo "concurrency = greenlet" >> .uicoveragerc
- name: Test UI
run: |
FAIL="--screenshot only-on-failure --full-page-screenshot --output ui_screenshots --tracing retain-on-failure"
pixi run -e ${{ matrix.environment }} test-ui --cov-config=.uicoveragerc $FAIL
- name: Upload UI Screenshots
uses: actions/upload-artifact@v4
if: always()
with:
name: ui_screenshots_${{ runner.os }}
path: ./ui_screenshots
if-no-files-found: ignore
55 changes: 55 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build documentation

on:
push:
branches:
- main

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

# Default to bash
defaults:
run:
shell: bash

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Pixi
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 # v0.8.1
with:
environments: docs

- name: Build documentation
run: pixi run -e docs docs-build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./site

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
34 changes: 34 additions & 0 deletions .github/workflows/update-lockfiles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Update lockfiles
permissions:
contents: write
pull-requests: write

on:
workflow_dispatch:
schedule:
- cron: 0 5 1 * *

jobs:
pixi-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up pixi
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 # v0.8.1
with:
run-install: false
- name: Update lockfiles
run: |
pixi update --json --no-install | pixi exec pixi-diff-to-markdown >> diff.md
- name: Create pull request
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update pixi lockfile
title: Update pixi lockfile
body-path: diff.md
branch: update-pixi
base: main
labels: pixi
delete-branch: true
add-paths: pixi.lock
Loading

0 comments on commit e620144

Please sign in to comment.