Skip to content

Commit

Permalink
DX: autoupdate developer configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Oct 11, 2024
1 parent 80792ea commit 3b2a606
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 36 deletions.
11 changes: 10 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
layout anaconda
if [ -e .venv ]; then
source .venv/bin/activate
elif [ -e venv ]; then
source venv/bin/activate
elif [ -e .pixi ]; then
watch_file pixi.lock
eval "$(pixi shell-hook)"
else
layout anaconda
fi
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pixi.lock linguist-language=YAML linguist-generated=true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ prof/

# Virtual environments
*venv/
.pixi/
.tox/
pyvenv*/

Expand Down
49 changes: 23 additions & 26 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,35 @@
ci:
autoupdate_commit_msg: "MAINT: update pip constraints and pre-commit"
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.4.1
hooks:
- id: check-dev-files
args:
- --dev-python-version=3.12
- --no-github-actions
- --no-prettierrc
- --no-python
- --no-ruff
- --no-version-branches
- --pin-requirements=quarterly
- --repo-name=strong2020-salamanca
- id: colab-toc-visible
- 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
Expand All @@ -38,23 +52,6 @@ repos:
metadata.varInspector
metadata.vscode
- repo: https://github.com/ComPWA/policy
rev: 0.3.18
hooks:
- id: check-dev-files
args:
- --dev-python-version=3.12
- --no-github-actions
- --no-gitpod
- --no-prettierrc
- --no-python
- --no-ruff
- --no-version-branches
- --pin-requirements=quarterly
- --repo-name=strong2020-salamanca
- id: colab-toc-visible
- id: remove-empty-tags

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.8.7
hooks:
Expand All @@ -74,15 +71,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 @@ -99,7 +96,7 @@ repos:
types_or: [jupyter]

- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 2.7.3
rev: 3.0.3
hooks:
- id: editorconfig-checker
name: editorconfig
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"diffEditor.experimental.showMoves": true,
"editor.formatOnSave": true,
"files.associations": {
"**/.constraints/py*.txt": "pip-requirements"
"**/.constraints/py*.txt": "pip-requirements",
"**/pixi.lock": "yaml"
},
"github-actions.workflows.pinned.workflows": [".github/workflows/ci.yml"],
"gitlens.telemetry.enabled": false,
Expand Down
5 changes: 0 additions & 5 deletions docs/lecture24_utilities.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@
" )\n",
" return histo"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
}
],
"metadata": {
Expand Down
2 changes: 0 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ dependencies:
- pip
- pip:
- -c .constraints/py3.12.txt -e .[dev]
variables:
PRETTIER_LEGACY_CLI: "1"
21 changes: 20 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,26 @@ sty = [
]
test = ["nbmake"]

[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["linux-64"]

[tool.pixi.activation.env]
PRETTIER_LEGACY_CLI = "1"

[tool.pixi.dependencies]
python = "3.12.*"

[tool.pixi.environments]
default = {features = [
"dev",
"doc",
"format",
"jupyter",
"sty",
"test",
]}

[tool.tomlsort]
all = false
ignore_case = true
Expand All @@ -80,7 +100,6 @@ sort_first = [
"tool.setuptools",
"tool.setuptools_scm",
]
sort_table_keys = true
spaces_indent_inline_array = 4
trailing_comma_inline_array = true

Expand Down

0 comments on commit 3b2a606

Please sign in to comment.