diff --git a/.cspell.json b/.cspell.json index 9234f7d..8d1b49c 100644 --- a/.cspell.json +++ b/.cspell.json @@ -39,6 +39,7 @@ ".gitignore", ".pre-commit-config.yaml", ".prettierignore", + ".taplo.toml", ".vscode/*", "pyproject.toml" ], @@ -54,6 +55,6 @@ "tomllib" ], "language": "en-US", - "version": "0.2", - "words": [] + "useGitignore": true, + "version": "0.2" } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79edf73..ffdbca6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,9 +5,6 @@ concurrency: cancel-in-progress: |- ${{ github.ref != format('refs/heads/{0}', github.event.repository.default_branch) }} -env: - PYTHONHASHSEED: "0" - on: push: branches: diff --git a/.github/workflows/docnb.yml b/.github/workflows/docnb.yml index af45d0e..e051554 100644 --- a/.github/workflows/docnb.yml +++ b/.github/workflows/docnb.yml @@ -14,13 +14,16 @@ on: jobs: docnb: + env: + EXECUTE_NB: yes + FORCE_COLOR: yes + GITHUB_REPO: ${{ github.event.pull_request.head.repo.full_name }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + UV_PYTHON: ${{ inputs.python-version }} name: Execute and build documentation runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: ${{ inputs.python-version }} - uses: astral-sh/setup-uv@v5 with: cache-dependency-glob: | @@ -46,12 +49,6 @@ jobs: with: ijulia: true - name: Build documentation and run notebooks - env: - EXECUTE_NB: yes - FORCE_COLOR: yes - GITHUB_REPO: ${{ github.event.pull_request.head.repo.full_name }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - UV_SYSTEM_PYTHON: 1 run: >- uv run \ --group doc \ diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index c39de15..a7c707c 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -11,13 +11,13 @@ on: jobs: linkcheck: + env: + FORCE_COLOR: yes + UV_PYTHON: ${{ inputs.python-version }} name: Check external links runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: ${{ inputs.python-version }} - uses: astral-sh/setup-uv@v5 with: cache-dependency-glob: | @@ -28,9 +28,7 @@ jobs: sudo apt-get update -y sudo apt-get install -y ${{ inputs.apt-packages }} - env: - FORCE_COLOR: yes GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - UV_SYSTEM_PYTHON: 1 name: Run Sphinx linkcheck run: >- uv run \ diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 996e330..50065f5 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -36,7 +36,7 @@ jobs: env: FORCE_COLOR: 1 TERM: xterm-256color - UV_SYSTEM_PYTHON: 1 + UV_PYTHON: ${{ inputs.python-version }} if: needs.determine-hooks.outputs.skipped-hooks needs: determine-hooks runs-on: ubuntu-24.04 @@ -44,9 +44,6 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-python@v5 - with: - python-version: ${{ inputs.python-version }} - uses: astral-sh/setup-uv@v5 with: cache-dependency-glob: | diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 08ea952..feec0aa 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -55,6 +55,7 @@ jobs: name: Run unit tests env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + UV_PYTHON: ${{ matrix.python-version }} needs: create-matrix runs-on: ${{ matrix.runs-on }} strategy: @@ -62,9 +63,6 @@ jobs: matrix: ${{ fromJSON(needs.create-matrix.outputs.matrix) }} steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - uses: astral-sh/setup-uv@v5 with: cache-dependency-glob: | @@ -97,9 +95,7 @@ jobs: if: inputs.multithreaded name: Determine pytest multithreading flags run: echo "flags=--numprocesses=auto" | tee -a $GITHUB_OUTPUT - - env: - UV_SYSTEM_PYTHON: 1 - name: Run tests with pytest + - name: Run tests with pytest run: >- uv run \ --group test \ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2223c75..e5b325a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: - id: check-useless-excludes - repo: https://github.com/ComPWA/policy - rev: 0.5.4 + rev: 0.5.15 hooks: - id: check-dev-files args: @@ -25,7 +25,7 @@ repos: - --update-lock-files=no - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.1 + rev: v0.9.1 hooks: - id: ruff args: [--fix] @@ -44,7 +44,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/ComPWA/prettier-pre-commit - rev: v3.3.3 + rev: v3.4.2 hooks: - id: prettier @@ -54,14 +54,14 @@ repos: - id: taplo-format - repo: https://github.com/pappasam/toml-sort - rev: v0.23.1 + rev: v0.24.2 hooks: - id: toml-sort args: - --in-place - repo: https://github.com/streetsidesoftware/cspell-cli - rev: v8.15.2 + rev: v8.17.0 hooks: - id: cspell @@ -77,6 +77,6 @@ repos: )$ - repo: https://github.com/ComPWA/pyright-pre-commit - rev: v1.1.386 + rev: v1.1.391 hooks: - id: pyright diff --git a/.taplo.toml b/.taplo.toml index 0db1df7..71fcb1b 100644 --- a/.taplo.toml +++ b/.taplo.toml @@ -10,3 +10,10 @@ compact_inline_tables = true indent_string = " " reorder_arrays = true reorder_keys = true + +[[rule]] +include = ["**/pyproject.toml"] +keys = ["tool.tox"] + +[rule.formatting] +reorder_arrays = false diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1e9ddcc..976535b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,10 +12,10 @@ git clone https://github.com/ComPWA/actions cd actions ``` -Now it's simply a matter of creating and activating the [virtual environment](https://docs.astral.sh/uv/pip/environments) with [`uv sync`](https://docs.astral.sh/uv/reference/cli/#uv-sync). The dependencies for the project are 'pinned' in each commit through the [`uv.lock` file](https://docs.astral.sh/uv/concepts/projects/#project-lockfile). +Now it's simply a matter of creating and activating the [virtual environment](https://docs.astral.sh/uv/pip/environments) with [`uv sync`](https://docs.astral.sh/uv/reference/cli/#uv-sync). The dependencies for the project are 'pinned' in each commit through the [`uv.lock` file](https://docs.astral.sh/uv/concepts/projects/layout/#the-lockfile). ```shell -uv sync +uv sync --all-extras source .venv/bin/activate ``` diff --git a/pyproject.toml b/pyproject.toml index d607522..5f782b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,7 +95,6 @@ sort_first = [ "build-system", "project", "tool.setuptools", - "tool.setuptools_scm", ] spaces_indent_inline_array = 4 trailing_comma_inline_array = true