Skip to content

Commit

Permalink
DX: migrate to uv environment
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Oct 15, 2024
1 parent c84a732 commit 03dad96
Show file tree
Hide file tree
Showing 15 changed files with 81 additions and 68 deletions.
5 changes: 4 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
],
"ignorePaths": [
"**/.cspell.json",
".envrc",
".gitignore",
".pre-commit-config.yaml",
".vscode/*"
".vscode/*",
"pyproject.toml"
],
"language": "en-US",
"words": ["ampform", "compwa", "qrules", "tensorwaves", "Zenodo"],
Expand All @@ -34,6 +36,7 @@
"PYTHONHASHSEED",
"bdist",
"commitlint",
"nodefaults",
"noreply",
"prereleased",
"rtfd",
Expand Down
3 changes: 2 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
layout anaconda
uv sync --all-extras --quiet
source .venv/bin/activate
4 changes: 2 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on:
jobs:
milestone:
if: startsWith(github.ref, 'refs/tags')
uses: ComPWA/actions/.github/workflows/close-milestone.yml@v1
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@v1
uses: ComPWA/actions/.github/workflows/push-to-version-branches.yml@v2
34 changes: 0 additions & 34 deletions .github/workflows/ci.yml

This file was deleted.

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 }}
2 changes: 1 addition & 1 deletion .github/workflows/pr-linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ on:

jobs:
lint-pr:
uses: ComPWA/actions/.github/workflows/pr-linting.yml@v1
uses: ComPWA/actions/.github/workflows/pr-linting.yml@v2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
uv.lock
43 changes: 25 additions & 18 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
ci:
autoupdate_commit_msg: "MAINT: autoupdate pre-commit hooks"
autoupdate_commit_msg: "MAINT: update lock files"
autoupdate_schedule: quarterly
skip:
- prettier

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

- repo: https://github.com/ComPWA/policy
rev: 0.5.0rc2
hooks:
- id: check-dev-files
args:
- --keep-issue-templates
- --no-python
- --no-pypi
- --repo-name=.github
- --repo-title=Public ComPWA GitHub profile

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-case-conflict
- id: check-merge-conflict
Expand All @@ -21,25 +30,23 @@ 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/policy
rev: 0.3.18
- repo: https://github.com/ComPWA/taplo-pre-commit
rev: v0.9.3
hooks:
- id: check-dev-files
args:
- --keep-issue-templates
- --no-gitpod
- --no-notebook
- --no-prettierrc
- --no-python
- --repo-name=compwa-github
- --repo-title=Public ComPWA GitHub profile
- 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/streetsidesoftware/cspell-cli
rev: v8.13.1
rev: v8.15.1
hooks:
- id: cspell
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
12 changes: 12 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[formatting]
align_comments = false
align_entries = false
allowed_blank_lines = 1
array_auto_collapse = false
array_auto_expand = true
array_trailing_comma = true
column_width = 88
compact_inline_tables = true
indent_string = " "
reorder_arrays = true
reorder_keys = true
8 changes: 6 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"recommendations": [
"eamodio.gitlens",
"esbenp.prettier-vscode",
"github.vscode-github-actions",
"Soulcode.vscode-unwanted-extensions",
"mhutchie.git-graph",
"soulcode.vscode-unwanted-extensions",
"stkb.rewrap",
"streetsidesoftware.code-spell-checker"
"streetsidesoftware.code-spell-checker",
"tamasfe.even-better-toml"
],
"unwantedRecommendations": [
"bungcip.better-toml",
"davidanson.vscode-markdownlint",
"garaioag.garaio-vscode-unwanted-recommendations",
"ms-python.flake8",
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
"python.terminal.activateEnvironment": false,
"redhat.telemetry.enabled": false,
"rewrap.wrappingColumn": 88,
"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
Expand Up @@ -3,6 +3,7 @@
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/ComPWA/.github/main.svg)](https://results.pre-commit.ci/latest/github/ComPWA/.github/main)
[![Spelling checked](https://img.shields.io/badge/cspell-checked-brightgreen.svg)](https://github.com/streetsidesoftware/cspell/tree/master/packages/cspell)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![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)

This repository manages the GitHub profile and repository templates for the [ComPWA Organization](https://github.com/ComPWA).

Expand Down
7 changes: 0 additions & 7 deletions environment.yml

This file was deleted.

21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[project]
name = "compwa-github-page"
version = "0.0.0"

[project.optional-dependencies]
dev = [
"pre-commit-uv",
]

[tool.tomlsort]
all = false
ignore_case = true
in_place = true
sort_first = [
"build-system",
"project",
"tool.setuptools",
"tool.setuptools_scm",
]
spaces_indent_inline_array = 4
trailing_comma_inline_array = true

0 comments on commit 03dad96

Please sign in to comment.