diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index b71aa69..a809d36 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -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. @@ -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 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d62179f..ddba12f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/candidate-contracts.yml b/.github/workflows/candidate-contracts.yml index 77ae168..5f7aaa7 100644 --- a/.github/workflows/candidate-contracts.yml +++ b/.github/workflows/candidate-contracts.yml @@ -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 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 2649af4..0f30d09 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -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] diff --git a/.github/workflows/framework-install.yml b/.github/workflows/framework-install.yml new file mode 100644 index 0000000..d7778e4 --- /dev/null +++ b/.github/workflows/framework-install.yml @@ -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__" diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index feb4877..1107789 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -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 diff --git a/AGENTS.md b/AGENTS.md index 6603c1e..88c262c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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. @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index d1d738f..be0552c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 3ac9f60..d456f79 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docs/contributing.md b/docs/contributing.md index c697031..94789d8 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -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 @@ -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 diff --git a/docs/testing.md b/docs/testing.md index f64e91c..04ecce2 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -1,12 +1,12 @@ # 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 @@ -14,7 +14,7 @@ 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 @@ -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, diff --git a/framework-matrix.json b/framework-matrix.json new file mode 100644 index 0000000..d27e2bf --- /dev/null +++ b/framework-matrix.json @@ -0,0 +1,4 @@ +{ + "python": ["3.12", "3.13", "3.14"], + "install_check_os": ["ubuntu-latest", "macos-latest", "windows-latest"] +} diff --git a/tests/test_package.py b/tests/test_package.py index b877fbd..1f38fe1 100644 --- a/tests/test_package.py +++ b/tests/test_package.py @@ -1,3 +1,5 @@ +import json +import tomllib from pathlib import Path from runpy import run_path @@ -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"))