-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from panel-extensions/setup_ci
Configure CI
- Loading branch information
Showing
6 changed files
with
274 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
.venv | ||
.pyc | ||
.env | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
default_stages: [pre-commit] | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
- id: check-builtin-literals | ||
- id: check-case-conflict | ||
- id: check-docstring-first | ||
- id: check-executables-have-shebangs | ||
- id: check-toml | ||
- id: check-json | ||
- id: detect-private-key | ||
- id: end-of-file-fixer | ||
exclude: \.min\.js$ | ||
- id: trailing-whitespace | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.7.0 | ||
hooks: | ||
- id: ruff | ||
files: src/panel_neuroglancer | ||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.3.0 | ||
hooks: | ||
- id: codespell | ||
additional_dependencies: | ||
- tomli | ||
- repo: https://github.com/shssoichiro/oxipng | ||
rev: v8.0.0 | ||
hooks: | ||
- id: oxipng | ||
stages: [manual] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
[project] | ||
name = "panel-neuroglancer" | ||
channels = ["conda-forge"] | ||
platforms = ["osx-arm64", "osx-64", "linux-64", "win-64"] | ||
|
||
[tasks] | ||
postinstall = "pip install --no-build-isolation --no-deps --disable-pip-version-check -e ." | ||
|
||
[dependencies] | ||
python = ">=3.10" | ||
panel = ">=1.5.4" | ||
packaging = "*" | ||
|
||
[pypi-dependencies] | ||
neuroglancer = ">=2.40.1" | ||
|
||
[host-dependencies] | ||
pip = "*" | ||
setuptools = ">=61" | ||
setuptools-scm = "*" | ||
hatchling = "*" | ||
hatch-vcs = "*" | ||
|
||
[feature.test.dependencies] | ||
pytest = ">=6" | ||
pytest-cov = "*" | ||
pytest-rerunfailures = "*" | ||
pytest-xdist = "*" | ||
mypy = "*" | ||
[feature.test.tasks] | ||
test = "pytest" | ||
test-coverage = "pytest --cov=panel_neuroglancer--cov-report=xml --cov-report=term-missing" | ||
|
||
[feature.build.dependencies] | ||
python-build = "*" | ||
twine = "*" | ||
wheel = "*" | ||
|
||
[feature.build.tasks] | ||
build-wheel = "python -m build --no-isolation ." | ||
check-wheel = "twine check dist/*" | ||
|
||
[feature.lint.dependencies] | ||
pre-commit = "*" | ||
|
||
[feature.lint.tasks] | ||
pre-commit-install = "pre-commit install" | ||
pre-commit-run = "pre-commit run -a" | ||
|
||
[feature.py310.dependencies] | ||
python = "3.10.*" | ||
[feature.py311.dependencies] | ||
python = "3.11.*" | ||
[feature.py312.dependencies] | ||
python = "3.12.*" | ||
|
||
[environments] | ||
default = ["test"] | ||
py310 = ["py310", "test"] | ||
py311 = ["py311", "test"] | ||
py312 = ["py312", "test"] | ||
build = ["build"] | ||
lint = { features = ["lint"], no-default-feature = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,91 @@ | ||
[build-system] | ||
requires = ["hatchling", "hatch-vcs", "panel>=1.5.4", "packaging"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "panel-neuroglancer" | ||
version = "0.1.0" | ||
description = "Add your description here" | ||
dynamic = ["version"] | ||
description = "Volumetric data viewer built on HoloViz Panel and Neuroglancer" | ||
readme = "README.md" | ||
requires-python = ">=3.10" | ||
dependencies = [ | ||
"neuroglancer>=2.40.1", | ||
"panel>=1.5.4", | ||
] | ||
classifiers = [ | ||
"License :: OSI Approved :: BSD License", | ||
"Development Status :: 5 - Production/Stable", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: 3.13", | ||
"Operating System :: OS Independent", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Science/Research", | ||
"Natural Language :: English", | ||
"Topic :: Scientific/Engineering", | ||
"Topic :: Software Development :: Libraries", | ||
] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/panel-extensions/panel-neuroglancer" | ||
Source = "https://github.com/panel-extensions/panel-neuroglancer" | ||
|
||
[tool.ruff] | ||
exclude = [ | ||
".git", | ||
"__pycache__", | ||
".tox", | ||
".eggs", | ||
"*.egg", | ||
"doc", | ||
"dist", | ||
"build", | ||
"_build", | ||
"examples", | ||
".ipynb_checkpoints", | ||
"node_modules", | ||
] | ||
line-length = 165 | ||
fix = true | ||
|
||
|
||
[tool.ruff.lint] | ||
ignore = [ | ||
"E402", # Module level import not at top of file | ||
"E712", # Avoid equality comparisons to True | ||
"E731", # Do not assign a lambda expression, use a def | ||
"N803", # Argument name should be lowercase | ||
"N806", # Variable name should be lowercase | ||
] | ||
select = [ | ||
"B", # flake8-bugbear | ||
"E", # pycodestyle errors | ||
"F", # pyflakes | ||
"W", # pycodestyle warnings | ||
"I", # isort | ||
"PIE", | ||
"T20", | ||
"RUF006", | ||
"UP004", | ||
"UP006", | ||
"UP020", | ||
"UP028", | ||
"UP030", | ||
"UP031", | ||
"UP032", | ||
"UP034", | ||
"UP036", | ||
] | ||
|
||
[tool.hatch.version] | ||
source = "vcs" | ||
raw-options = { version_scheme = "no-guess-dev" } | ||
|
||
[tool.isort] | ||
force_grid_wrap = 4 | ||
multi_line_output = 5 | ||
combine_as_imports = true | ||
lines_between_types = 1 | ||
include_trailing_comma = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters