Skip to content

Commit

Permalink
FIX: define dev dependencies as dependency groups (#26)
Browse files Browse the repository at this point in the history
* DX: run `pyright` in `tox -e sty` job
* FIX: remove `pre-commit-uv` and `tox` from environment
* MAINT: clean up `style` dependencies
* MAINT: update lock files
  • Loading branch information
redeboer authored Oct 28, 2024
1 parent 1f02273 commit 0fed08b
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 325 deletions.
6 changes: 4 additions & 2 deletions .binder/postBuild
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ set -ex
curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.cargo/env
uv export \
--extra jupyter \
--extra notebooks \
--group jupyter \
--group notebooks \
--no-dev \
> requirements.txt
uv pip install \
--requirement requirements.txt \
--system
rm requirements.txt
uv cache clean
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ on:

jobs:
doc:
uses: ComPWA/actions/.github/workflows/ci-docs.yml@v2
uses: ComPWA/actions/.github/workflows/ci-docs.yml@v2.1
permissions:
pages: write
id-token: write
Expand All @@ -39,4 +39,4 @@ jobs:
if: inputs.specific-pip-packages == ''
secrets:
token: ${{ secrets.PAT }}
uses: ComPWA/actions/.github/workflows/pre-commit.yml@v2
uses: ComPWA/actions/.github/workflows/pre-commit.yml@v2.1
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repos:
- id: check-useless-excludes

- repo: https://github.com/ComPWA/policy
rev: 0.5.0
rev: 0.5.5
hooks:
- id: check-dev-files
args:
Expand Down Expand Up @@ -52,7 +52,7 @@ repos:
metadata.vscode
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.0
rev: v0.7.1
hooks:
- id: ruff
args: [--fix]
Expand Down Expand Up @@ -104,11 +104,11 @@ repos:
)$
- repo: https://github.com/ComPWA/pyright-pre-commit
rev: v1.1.385
rev: v1.1.386
hooks:
- id: pyright

- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.4.24
rev: 0.4.27
hooks:
- id: uv-lock
49 changes: 18 additions & 31 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,20 @@ license = {text = "GPLv3 or later"}
name = "benchmarks"
requires-python = ">=3.12"

[project.optional-dependencies]
[project.readme]
content-type = "text/markdown"
file = "README.md"

[dependency-groups]
dev = [
"benchmarks[doc]",
"benchmarks[jupyter]",
"benchmarks[sty]",
"benchmarks[test]",
"ruff",
"sphinx-autobuild",
"tox",
{include-group = "doc"},
{include-group = "jupyter"},
{include-group = "style"},
{include-group = "test"},
]
doc = [
"benchmarks[notebooks]",
"myst-nb",
"myst-parser[linkify]",
"sphinx",
Expand All @@ -34,41 +37,25 @@ doc = [
"sphinx-codeautolink[ipython]",
"sphinx-copybutton",
"sphinx-togglebutton",
{include-group = "notebooks"},
]
jupyter = [
"jupyterlab",
"jupyterlab",
"jupyterlab-code-formatter >=3.0.0",
"jupyterlab-code-formatter",
"jupyterlab-git",
"jupyterlab-lsp",
"jupyterlab-myst",
"jupyterlab-myst",
"python-lsp-ruff",
"python-lsp-server[rope]",
]
lint = [
"ruff",
]
notebooks = [
"pandas",
]
sty = [
"benchmarks[format]",
"benchmarks[lint]",
"benchmarks[types]",
"pre-commit-uv",
"ruff",
]
notebooks = ["pandas"]
style = ["sphinx-api-relink"]
test = [
"nbmake",
{include-group = "notebooks"},
]
types = [
"sphinx-api-relink",
]

[project.readme]
content-type = "text/markdown"
file = "README.md"

[tool.setuptools]
include-package-data = false
Expand All @@ -95,6 +82,8 @@ reportUnusedFunction = true
reportUnusedImport = true
reportUnusedVariable = true
typeCheckingMode = "strict"
venv = ".venv"
venvPath = "."

[tool.pytest.ini_options]
addopts = [
Expand Down Expand Up @@ -304,8 +293,6 @@ description = Run all notebooks with pytest
allowlist_externals =
pre-commit
commands =
pre-commit run {posargs} --all-files
pre-commit run --all-files {posargs}
description = Perform all linting, formatting, and spelling checks
setenv =
SKIP = pyright
"""
Loading

0 comments on commit 0fed08b

Please sign in to comment.