Skip to content
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
29 changes: 17 additions & 12 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@ In short, this is how that works.
3. Synchronize the locked, tooling-only development environment:

```bash
uv sync --frozen --only-group dev --no-install-project
uv sync --locked --only-group dev --no-install-project
```

4. Make sure all tests pass:
4. Run the ordinary repository checks:

```bash
uv run invoke test
uv run --no-sync invoke check typecheck test docs
```

5. Start making your changes on a feature branch based on **main**.
6. Make sure all tests still pass:
5. Branch from `main` for ordinary changes. For an existing coordinated
initiative, follow the base branch recorded in its handoff.
6. Repeat the ordinary checks and run any relevant integration checks:

```bash
uv run invoke test
uv run --no-sync invoke check typecheck test docs
```

7. Commit your changes and push your branch to GitHub.
Expand All @@ -34,12 +35,16 @@ In short, this is how that works.
During development, use [pyinvoke](http://docs.pyinvoke.org/) tasks on the
command line to ease recurring operations:

* `uv run invoke check`: Run Ruff lint and format checks.
* `uv run invoke test`: Run the pure package tests.
* `uv run invoke typecheck`: Run Pyright over the coordination package and pure tests.
* `uv run invoke docs`: Build the MkDocs documentation strictly into temporary storage.
* `uv run invoke build`: Build wheel and source distributions into temporary storage.
* `uv run invoke --list`: Show available aliases.
* `uv run --no-sync invoke check`: Run Ruff lint and format checks.
* `uv run --no-sync invoke test`: Run the pure package tests.
* `uv run --no-sync invoke typecheck`: Run Pyright over the coordination package and pure tests.
* `uv run --no-sync invoke docs`: Build the MkDocs documentation strictly into temporary storage.
* `uv run --no-sync invoke build`: Build wheel and source distributions into temporary storage.
* `uv run --no-sync invoke --list`: Show available aliases.

Use the canonical checkout for each repository and record progress in the
initiative handoff or draft PR. Create an additional worktree only when
explicitly requested and record its visible path, branch, and owner.

## Bug reports

Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [main, initiative/candidate-artifact-integration]
pull_request:
branches: [main, initiative/geometry-tessellation, initiative/repository-modernisation]

permissions:
contents: read
Expand All @@ -18,7 +17,6 @@ env:

jobs:
quality:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'docs-only') }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -44,7 +42,7 @@ jobs:
with:
version: "0.12.7"
- name: Synchronize pure development tools
run: uv sync --frozen --only-group dev --no-install-project
run: uv sync --locked --only-group dev --no-install-project
- name: Verify runtime packages are excluded
run: >-
uv run --no-sync python -c
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/candidate-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ name: candidate-contracts

on:
pull_request:
branches:
- main
- c3-upgrade
- initiative/geometry-tessellation
- initiative/repository-modernisation
- initiative/candidate-artifact-integration
push:
branches:
- initiative/candidate-artifact-integration
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@ name: docs

on:
pull_request:
branches: [main, initiative/geometry-tessellation, initiative/repository-modernisation]
paths:
- "docs/**"
- "mkdocs.yml"
- "README.md"
- "CHANGELOG.md"
- "LICENSE"
- "pyproject.toml"
- "uv.lock"
- ".github/workflows/docs.yml"
push:
branches: [main, initiative/candidate-artifact-integration]

Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/framework-install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: framework-install

on:
workflow_dispatch:

permissions:
contents: read

jobs:
targets:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.targets.outputs.matrix }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- id: targets
run: |
matrix=$(jq -ce '{os: .install_check_os, python: .python}' framework-matrix.json)
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0
with:
version: "0.12.7"
- name: Build the metapackage wheel
run: |
mkdir -p "$RUNNER_TEMP/framework-source"
git archive --format=tar HEAD | tar -xf - -C "$RUNNER_TEMP/framework-source"
uv build --wheel --no-sources "$RUNNER_TEMP/framework-source" --out-dir "$RUNNER_TEMP/framework-dist"
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: framework-install-wheel
path: ${{ runner.temp }}/framework-dist/*.whl
if-no-files-found: error

install:
needs: targets
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.targets.outputs.matrix) }}
defaults:
run:
shell: bash
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: framework-install-wheel
path: ${{ runner.temp }}/framework-dist
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python }}
- uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0
with:
version: "0.12.7"
- name: Resolve and install the complete framework from PyPI
working-directory: ${{ runner.temp }}
run: |
uv venv framework-smoke --python "$(command -v python)"
smoke_python=framework-smoke/bin/python
if [[ "$RUNNER_OS" == Windows ]]; then
smoke_python=framework-smoke/Scripts/python.exe
fi
uv pip install --no-config --python "$smoke_python" --default-index https://pypi.org/simple framework-dist/*.whl
uv pip check --python "$smoke_python"
"$smoke_python" -I -c "import compas_framework; assert compas_framework.__version__"
1 change: 0 additions & 1 deletion .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: verify-pr
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
branches: [main, initiative/geometry-tessellation, initiative/repository-modernisation]

permissions:
contents: read
Expand Down
37 changes: 19 additions & 18 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,30 +35,32 @@ modernization initiatives.

## Default Environment

- Use the Conda environment `compas3` for all COMPAS Framework work unless a
package explicitly documents a different required environment.
- The default Python interpreter is:
- Use the locked, tooling-only uv environment for ordinary checks. Sync with
`uv sync --locked --only-group dev --no-install-project`, then use
`uv run --no-sync invoke` with the tasks listed in the contributor guide.
- Use `compas3` for local native and sibling-checkout integration unless the
owning package specifies another environment. The maintainer's interpreter is:

```text
/Users/vanmelet/miniforge3/envs/compas3/bin/python
```

- Run Python tools through this environment. Prefer explicit invocations such
as:

```text
/Users/vanmelet/miniforge3/envs/compas3/bin/python -m pytest
/Users/vanmelet/miniforge3/envs/compas3/bin/python -m ruff check
/Users/vanmelet/miniforge3/envs/compas3/bin/python -m ruff format --check
/Users/vanmelet/miniforge3/envs/compas3/bin/python -m pyright
```

- Run the Pyright package installed in `compas3`. Do not use `npx` and do not
treat results from the shell's default Python or another environment as
authoritative.
- Verify native package imports with `compas3` before reporting a compiled
extension as unavailable.

## Checkouts and Progress

- Work in each repository's canonical checkout on the agreed task branch.
Check the branch and working tree before editing, and preserve existing changes.
- Create an additional worktree only when explicitly requested. Use an agreed,
visible path outside system temporary directories and record its path, branch,
owner, and cleanup status in the handoff.
- Assign one writer per repository at a time. Read-only work and writes in
distinct package repositories can run in parallel.
- At meaningful checkpoints, report the checkout, branch, changed files, and
verification status. When commits and pushes are authorized, keep the draft PR
current so progress is visible.

## Delegation

Use the explorer for repository investigations.
Expand Down Expand Up @@ -125,8 +127,7 @@ STOP and request user approval.
After approval:
- Break the proposal into small tasks.
- Assign file and repository ownership.
- Execute independent tasks in parallel.
- Avoid concurrent edits to shared files.
- Execute independent tasks in parallel according to the checkout rules above.
- Run tests after each task.
- Keep implementation changes no broader than the accepted decisions.
- Remove obsolete paths instead of leaving unused abstractions behind when
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Added cross-package integration tests for continuous-geometry tessellation, triangle-processing plugin boundaries, serialization, and native geometry backends.
* Added immutable cross-repository candidate manifests, provenance and wheel
verification, secret-isolated native integration, and release-order checks.
* Added a manual clean-install check for the full metapackage.

### Changed

* Run ordinary CI on pull requests to any base branch and use canonical
checkouts for initiative work.
* Documented the COMPAS 3 geometry package compatibility matrix, native backend prerequisites, and geometry integration test workflow.
* Replaced legacy development extras and mutable workflows with locked PEP 735 tool groups, uv-based contributor commands, immutable actions, and Python 3.12–3.14 checks.
* Modernized release-candidate automation to build and verify one temporary
Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@ Development tooling is locked separately from the framework runtime packages.
Create a pure tool environment without installing native backends:

```bash
uv sync --frozen --only-group dev --no-install-project
uv run invoke check
uv run invoke typecheck
uv run invoke test
uv run invoke docs
uv sync --locked --only-group dev --no-install-project
uv run --no-sync invoke check typecheck test docs
```

The lock records the complete published project metadata. Its package sources
Expand Down
15 changes: 9 additions & 6 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,18 @@ Install [uv](https://docs.astral.sh/uv/), clone the repository, and synchronize
the locked development group:

```bash
uv sync --frozen --only-group dev --no-install-project
uv sync --locked --only-group dev --no-install-project
```

This is intentionally a tooling-only environment. Although `uv.lock` records
the full framework dependency graph, `--only-group dev --no-install-project`
does not install the project or native backends. Use a package-specific native
environment for cross-package geometry integration work.
environment, such as `compas3`, for local native geometry integration work.

Run focused tests while developing, then run the repository aliases:

```bash
uv run invoke test
uv run invoke check
uv run invoke typecheck
uv run invoke docs
uv run --no-sync invoke check typecheck test docs
```

Integration tests and examples should use public APIs and span package
Expand All @@ -28,6 +25,12 @@ The Invoke tasks are thin aliases for Ruff, Pyright, pytest, MkDocs, and
`uv build`. The direct commands used by CI remain visible in the
workflow files.

Use each repository's canonical checkout and make progress visible through the
initiative handoff and draft pull request. Keep one writer per repository at a
time. Read-only work and writes in different repositories can run in parallel.
Create an additional worktree only when explicitly requested and record its
visible path, branch, and owner in the handoff.

Changes to coordinated candidate infrastructure use the isolated locked group:

```bash
Expand Down
13 changes: 10 additions & 3 deletions docs/testing.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Testing Strategy

Framework tests are organized by the contract they exercise:
Cross-package integration can cover:

- plugin discovery and dispatch through public COMPAS APIs;
- data roundtrips across serialization formats and package boundaries;
- end-to-end workflows combining geometry, algorithms, models, and viewing;
- performance baselines for representative cross-package operations; and
- packaging checks for the supported Python and operating-system matrix.
- installation checks for coordinated package releases.

## Pure repository checks

The ordinary pull-request matrix covers Python 3.12, 3.13, and 3.14 on Linux,
macOS, and Windows without installing the framework runtime dependencies:

```bash
uv sync --frozen --only-group dev --no-install-project
uv sync --locked --only-group dev --no-install-project
uv run --no-sync ruff check .
uv run --no-sync ruff format --check .
uv run --no-sync pyright
Expand Down Expand Up @@ -42,6 +42,13 @@ uv run --no-sync mkdocs build --strict
CI supplies a temporary `--site-dir`; generated documentation never lands in
the repository checkout.

## Complete installation

The manual `framework-install` workflow builds one metapackage wheel and tries
a clean installation with its required dependencies from PyPI on each target
in `framework-matrix.json`. Run it after the intended upstream releases are
available. Keep the result alongside the runtime and exact-artifact evidence.

## Native integration

`native-candidate-integration.yml` is the authoritative Linux x86-64,
Expand Down
4 changes: 4 additions & 0 deletions framework-matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"python": ["3.12", "3.13", "3.14"],
"install_check_os": ["ubuntu-latest", "macos-latest", "windows-latest"]
}
11 changes: 11 additions & 0 deletions tests/test_package.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import json
import tomllib
from pathlib import Path
from runpy import run_path

Expand All @@ -8,6 +10,15 @@ def test_version_is_available():
assert namespace["__version__"]


def test_install_matrix_covers_declared_python_versions():
root = Path(__file__).resolve().parents[1]
project = tomllib.loads((root / "pyproject.toml").read_text(encoding="utf-8"))["project"]
matrix = json.loads((root / "framework-matrix.json").read_text(encoding="utf-8"))
classifier_prefix = "Programming Language :: Python :: 3."
declared = {classifier.removeprefix("Programming Language :: Python :: ") for classifier in project["classifiers"] if classifier.startswith(classifier_prefix)}
assert set(matrix["python"]) == declared


def test_local_build_uses_current_working_tree(tmp_path):
source = Path(__file__).parents[1]
namespace = run_path(str(source / "tasks.py"))
Expand Down
Loading