Skip to content

Commit

Permalink
DX: define developer environment with uv
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Oct 16, 2024
1 parent e34f9f2 commit cd50b03
Show file tree
Hide file tree
Showing 15 changed files with 3,812 additions and 166 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ indent_size = 4

[.gitmodules]
indent_size = unset

[uv.lock]
indent_size = 4
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
uv sync --all-extras --quiet
source .venv/bin/activate
2 changes: 1 addition & 1 deletion .github/workflows/clean-caches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Remove caches
runs-on: ubuntu-24.04
steps:
- uses: ComPWA/actions/clean-caches@v1
- uses: ComPWA/actions/clean-caches@v2
with:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ inputs.ref }}
21 changes: 21 additions & 0 deletions .github/workflows/lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Update

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: |-
${{ github.ref != format('refs/heads/{0}', github.event.repository.default_branch) }}
on:
pull_request:
branches:
- main
- epic/*
paths:
- .pre-commit-config.yaml
workflow_dispatch:

jobs:
lock:
uses: ComPWA/actions/.github/workflows/lock.yml@v2
secrets:
token: ${{ secrets.PAT }}
14 changes: 14 additions & 0 deletions .github/workflows/pr-linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: PR linting
on:
pull_request:
types:
- edited
- labeled
- opened
- reopened
- synchronize
- unlabeled

jobs:
lint-pr:
uses: ComPWA/actions/.github/workflows/pr-linting.yml@v2
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ version.py
*.log
*.pyc
*.synctex*
*condaenv.*
.coverage
.coverage.*
.ipynb_checkpoints/
Expand Down
56 changes: 30 additions & 26 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
ci:
autoupdate_commit_msg: "MAINT: autoupdate pre-commit hooks"
autoupdate_commit_msg: "MAINT: update lock files"
autoupdate_schedule: quarterly
skip:
- prettier
- taplo

repos:
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes

- repo: https://github.com/ComPWA/policy
rev: 0.5.0rc4
hooks:
- id: colab-toc-visible
- id: check-dev-files
args:
- --no-github-actions
- --no-pypi
- --no-version-branches
- --repo-name=gluex-amplitude
- id: remove-empty-tags

- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
hooks:
- id: nbstripout
args:
- --drop-empty-cells
- --extra-keys
- |
cell.attachments
cell.metadata.code_folding
cell.metadata.editable
cell.metadata.id
cell.metadata.pycharm
cell.metadata.slideshow
cell.metadata.user_expressions
metadata.celltoolbar
metadata.colab.name
Expand All @@ -36,21 +48,8 @@ repos:
metadata.varInspector
metadata.vscode
- repo: https://github.com/ComPWA/policy
rev: 0.3.11
hooks:
- id: colab-toc-visible
- id: check-dev-files
args:
- --no-github-actions
- --no-gitpod
- --no-prettierrc
- --no-pypi
- --no-version-branches
- --repo-name=gluex-amplitude

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.5
rev: v0.6.9
hooks:
- id: ruff
args: [--fix]
Expand All @@ -59,7 +58,7 @@ repos:
types_or: [python, pyi, jupyter]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-case-conflict
- id: check-json
Expand All @@ -75,15 +74,15 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
- repo: https://github.com/ComPWA/prettier-pre-commit
rev: v3.3.3
hooks:
- id: prettier

- repo: https://github.com/ComPWA/mirrors-taplo
rev: v0.8.1
- repo: https://github.com/ComPWA/taplo-pre-commit
rev: v0.9.3
hooks:
- id: taplo
- id: taplo-format

- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
Expand All @@ -93,7 +92,7 @@ repos:
- --in-place

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.8
rev: v19.1.1
hooks:
- id: clang-format
types_or:
Expand All @@ -102,7 +101,7 @@ repos:
- cuda

- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 2.7.3
rev: 3.0.3
hooks:
- id: editorconfig-checker
name: editorconfig
Expand All @@ -118,3 +117,8 @@ repos:
- id: latexindent
args:
- "-y=defaultIndent: ' '"

- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.4.22
hooks:
- id: uv-lock
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"github.vscode-github-actions",
"github.vscode-pull-request-github",
"james-yu.latex-workshop",
"mhutchie.git-graph",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-toolsai.jupyter",
Expand Down
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
},
"diffEditor.experimental.showMoves": true,
"editor.formatOnSave": true,
"git.autofetch": true,
"git.autoRepositoryDetection": false,
"git.autofetch": true,
"git.rebaseWhenSync": true,
"github-actions.workflows.pinned.refresh.enabled": true,
"github-actions.workflows.pinned.workflows": [
Expand Down Expand Up @@ -79,10 +79,14 @@
},
"notebook.formatOnSave.enabled": true,
"notebook.gotoSymbols.showAllSymbols": true,
"python.terminal.activateEnvironment": false,
"redhat.telemetry.enabled": false,
"rewrap.wrappingColumn": 88,
"ruff.enable": true,
"ruff.importStrategy": "fromEnvironment",
"ruff.organizeImports": true,
"search.exclude": {
"**/uv.lock": true
},
"telemetry.telemetryLevel": "off"
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Comparison repository for GlueX amplitude models

[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

This repository was created during PWA working group meetings for GlueX at Jefferson Lab, July 31st to August 4th, 2023. Live notes for these discussions can be found [here](https://hackmd.io/@QHYjhejHTIWXL2MltV3WNQ/r17prtBo3) on HackMD. Each meeting was organised like a 'hackathon' and the results of these programming sessions can be found on [compwa.github.io/gluex-amplitude](https://compwa.github.io/gluex-amplitude).
Expand Down
Loading

0 comments on commit cd50b03

Please sign in to comment.