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 75ef644 commit da49a70
Show file tree
Hide file tree
Showing 21 changed files with 3,558 additions and 6,202 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ indent_size = 4

[LICENSE]
indent_size = unset

[uv.lock]
indent_size = 4
4 changes: 2 additions & 2 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
watch_file pixi.lock
eval "$(pixi shell-hook)"
uv sync --all-extras --quiet
source .venv/bin/activate
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
docs/**/* linguist-documentation=false
pixi.lock linguist-language=YAML
37 changes: 37 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name-template: '"Symbolic Amplitudes for Light Baryons" $NEXT_PATCH_VERSION'
tag-template: $NEXT_PATCH_VERSION

references:
- main
- epic/*

categories:
- title: ✨ New features
label: ✨ Feature
- title: ⚠️ Enhancements and optimizations
label: ⚙️ Enhancement
- title: ⚠️ API changes
label: ⚠️ Interface
- title: ⚠️ Changes that may affect behavior
label: ❗ Behavior
- title: 🐛 Bug fixes
label: 🐛 Bug
- title: 📝 Documentation
label: 📝 Docs
- title: 🔨 Maintenance
label: 🔨 Maintenance
- title: 🖱️ Developer Experience
label: 🖱️ DX

change-template: "- $TITLE (#$NUMBER)"

replacers:
- search: /([A-Z]+!?:\s*)(.*)/g
replace: $2

sort-direction: ascending

template: |
$CHANGES
_The full changelog as commits can be found [here](https://github.com/ComPWA/"Symbolic Amplitudes for Light Baryons"/compare/$PREVIOUS_TAG...$NEXT_PATCH_VERSION)._
16 changes: 16 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CD

on:
release:
types:
- prereleased
- released

jobs:
milestone:
if: startsWith(github.ref, 'refs/tags')
uses: ComPWA/actions/.github/workflows/close-milestone.yml@v2
push:
if: startsWith(github.ref, 'refs/tags') && !github.event.release.prerelease
secrets: inherit
uses: ComPWA/actions/.github/workflows/push-to-version-branches.yml@v2
37 changes: 0 additions & 37 deletions .github/workflows/ci-docs.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: |-
${{ github.ref != format('refs/heads/{0}', github.event.repository.default_branch) }}
env:
PYTHONHASHSEED: "0"

on:
push:
branches:
- main
- epic/*
- "[0-9]+.[0-9]+.x"
pull_request:
branches:
- main
- epic/*
- "[0-9]+.[0-9]+.x"
workflow_dispatch:
inputs:
specific-pip-packages:
description: Run CI with specific pip packages
required: false
type: string

jobs:
doc:
uses: ComPWA/actions/.github/workflows/ci-docs.yml@v2
permissions:
pages: write
id-token: write
with:
gh-pages: true
specific-pip-packages: ${{ inputs.specific-pip-packages }}
4 changes: 2 additions & 2 deletions .github/workflows/clean-caches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ on:
jobs:
cleanup:
name: Remove caches
runs-on: ubuntu-22.04
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 }}
7 changes: 4 additions & 3 deletions .github/workflows/pr-linting.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
name: PR linting
jobs:
lint-pr:
uses: ComPWA/actions/.github/workflows/pr-linting.yml@v1
on:
pull_request:
types:
Expand All @@ -11,3 +8,7 @@ on:
- reopened
- synchronize
- unlabeled

jobs:
lint-pr:
uses: ComPWA/actions/.github/workflows/pr-linting.yml@v2
16 changes: 16 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Release Drafter

on:
push:
branches:
- main
- epic/*
workflow_dispatch:

jobs:
update_release_draft:
runs-on: ubuntu-24.04
steps:
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*.egg-info
.ipynb_checkpoints/
.pixi
.venv/
.virtual_documents/
node_modules/
**/*.pickle
Expand Down
90 changes: 60 additions & 30 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ci:
autoupdate_commit_msg: "MAINT: autoupdate pre-commit config"
autoupdate_commit_msg: "MAINT: update lock files"
autoupdate_schedule: quarterly

repos:
Expand All @@ -8,31 +8,17 @@ repos:
- id: check-hooks-apply
- id: check-useless-excludes

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/ComPWA/policy
rev: 0.3.18
rev: 0.5.0rc4
hooks:
- id: check-dev-files
args:
- --no-pypi
- --repo-name=gluex-nstar
- --repo-name="Symbolic Amplitudes for Light Baryons"
- id: fix-nbformat-version
- id: remove-empty-tags

- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 2.7.3
hooks:
- id: editorconfig-checker
name: editorconfig
alias: ec
exclude: >-
(?x)^(
.*\.py
)$
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
hooks:
Expand All @@ -42,12 +28,44 @@ repos:
- --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
metadata.colab.provenance
metadata.interpreter
metadata.notify_time
metadata.toc
metadata.toc-autonumbering
metadata.toc-showcode
metadata.toc-showmarkdowntxt
metadata.toc-showtags
metadata.varInspector
metadata.vscode
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
hooks:
- id: ruff
args: [--fix]
types_or: [python, pyi, jupyter]
- id: ruff-format
types_or: [python, pyi, jupyter]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/ComPWA/prettier-pre-commit
rev: v3.3.3
hooks:
- id: prettier
exclude: >-
Expand All @@ -60,18 +78,30 @@ repos:
hooks:
- id: taplo

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

- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
- id: toml-sort
args:
- --in-place

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.7
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 3.0.3
hooks:
- id: ruff
args: [--fix]
types_or: [python, pyi, jupyter]
- id: ruff-format
types_or: [python, pyi, jupyter]
- id: editorconfig-checker
name: editorconfig
alias: ec
exclude: >-
(?x)^(
.*\.py
)$
- 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
14 changes: 14 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,21 @@
"ms-vsliveshare.vsliveshare",
"redhat.vscode-yaml",
"simonsiefke.svg-preview",
"soulcode.vscode-unwanted-extensions",
"stkb.rewrap",
"tamasfe.even-better-toml",
"yzhang.markdown-all-in-one"
],
"unwantedRecommendations": [
"bungcip.better-toml",
"davidanson.vscode-markdownlint",
"garaioag.garaio-vscode-unwanted-recommendations",
"ms-python.black-formatter",
"ms-python.flake8",
"ms-python.isort",
"ms-python.mypy-type-checker",
"ms-python.pylint",
"travisillig.vscode-json-stable-stringify",
"tyriar.sort-lines"
]
}
Loading

0 comments on commit da49a70

Please sign in to comment.