Skip to content

Commit

Permalink
MAINT: update developer environment (#30)
Browse files Browse the repository at this point in the history
* MAINT: autoupdate pre-commit hooks
  • Loading branch information
redeboer authored Oct 14, 2024
1 parent 08274b8 commit 98b5d45
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 37 deletions.
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
"ignorePaths": [
"**/*.rst_t",
"**/.cspell.json",
"*.rst_t",
".editorconfig",
".envrc",
".gitattributes",
".gitignore",
".pre-commit-config.yaml",
".prettierignore",
Expand Down
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
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- package-name
permissions:
id-token: write
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: ComPWA/actions/build-pypi-distribution@v1
- uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clean-caches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
jobs:
cleanup:
name: Remove caches
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: ComPWA/actions/clean-caches@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
update_release_draft:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: release-drafter/release-drafter@v6
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ prof/

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

Expand Down
45 changes: 21 additions & 24 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,33 @@ ci:
autoupdate_schedule: quarterly # already done by requirements-cron.yml
skip:
- mypy
- prettier
- pyright
- taplo

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

- repo: https://github.com/ComPWA/policy
rev: 0.4.2
hooks:
- id: check-dev-files
args:
- --no-notebooks
- --no-prettierrc
- --repo-name=sphinx-api-relink
- --repo-title=sphinx-api-relink

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.6
rev: v0.6.9
hooks:
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-ast
- id: check-case-conflict
Expand All @@ -41,15 +49,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 @@ -58,24 +66,13 @@ repos:
args:
- --in-place

- repo: https://github.com/ComPWA/policy
rev: 0.3.18
hooks:
- id: check-dev-files
args:
- --no-gitpod
- --no-notebooks
- --no-prettierrc
- --repo-name=sphinx-api-relink
- --repo-title=sphinx-api-relink

- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v8.13.1
rev: v8.15.1
hooks:
- id: cspell

- 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 @@ -94,7 +91,7 @@ repos:
types:
- python

- repo: https://github.com/ComPWA/mirrors-pyright
rev: v1.1.374
- repo: https://github.com/ComPWA/pyright-pre-commit
rev: v1.1.384
hooks:
- id: pyright
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"github.vscode-github-actions",
"mhutchie.git-graph",
"ms-python.mypy-type-checker",
"ms-python.python",
"ms-python.vscode-pylance",
Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"cSpell.enabled": true,
"coverage-gutters.coverageFileNames": ["coverage.xml"],
"coverage-gutters.coverageReportFileName": "**/htmlcov/index.html",
"coverage-gutters.showGutterCoverage": false,
"coverage-gutters.showLineCoverage": true,
"cSpell.enabled": true,
"diffEditor.experimental.showMoves": true,
"editor.formatOnSave": true,
"files.associations": {
"**/pixi.lock": "yaml",
"*.rst_t": "jinja"
},
"files.watcherExclude": {
Expand All @@ -57,7 +58,6 @@
},
"notebook.formatOnSave.enabled": true,
"python.analysis.autoImportCompletions": false,
"python.analysis.typeCheckingMode": "strict",
"python.terminal.activateEnvironment": false,
"python.testing.unittestEnabled": false,
"redhat.telemetry.enabled": false,
Expand Down
4 changes: 1 addition & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: sphinx-api-relink
channels:
- defaults
dependencies:
- python==3.9.*
- python==3.12.*
- pip
- pip:
- -e .[dev]
variables:
PRETTIER_LEGACY_CLI: "1"
26 changes: 23 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ requires-python = ">=3.9"
dev = ["sphinx-api-relink[sty]"]
sty = [
"mypy",
"pre-commit",
"pre-commit-uv",
"ruff",
"sphinx-api-relink[types]",
]
Expand Down Expand Up @@ -80,6 +80,8 @@ namespaces = false
where = ["src"]

[tool.setuptools_scm]
local_scheme = "no-local-version"
version_scheme = "post-release"
write_to = "src/version.py"

[tool.coverage.run]
Expand All @@ -96,6 +98,26 @@ files = [
show_error_codes = true
warn_unused_configs = true

[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",
"sty",
"types",
]}

[tool.pixi.pypi-dependencies]
sphinx-api-relink = {path = ".", editable = true}

[tool.pyright]
exclude = [
"**/.git",
Expand Down Expand Up @@ -126,7 +148,6 @@ typeCheckingMode = "strict"
preview = true
show-fixes = true
src = ["src"]
target-version = "py39"

[tool.ruff.format]
docstring-code-format = true
Expand Down Expand Up @@ -193,6 +214,5 @@ sort_first = [
"tool.setuptools",
"tool.setuptools_scm",
]
sort_table_keys = true
spaces_indent_inline_array = 4
trailing_comma_inline_array = true

0 comments on commit 98b5d45

Please sign in to comment.