Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DX: define developer environment with uv #26

Merged
merged 7 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
16 changes: 0 additions & 16 deletions .github/workflows/cd.yml

This file was deleted.

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 }}
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 }}
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
44 changes: 26 additions & 18 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
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.0
hooks:
- id: check-dev-files
args:
- --no-cd
- --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 +31,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.

22 changes: 22 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[project]
name = "compwa-github-page"
requires-python = ">=3.12"
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
Loading