From b5f8dd7b35a3b331af50cef6b740a0c5e6e75a1e Mon Sep 17 00:00:00 2001 From: tomvanmele Date: Tue, 24 Nov 2026 22:51:53 +0100 Subject: [PATCH] Separate Framework package checks from sibling integration fixtures --- .github/CONTRIBUTING.md | 2 +- .github/pull_request_template.md | 4 +- .../workflows/scene-candidate-integration.yml | 1 - CHANGELOG.md | 9 ++- README.md | 12 +-- docs/examples.md | 10 +-- docs/index.md | 10 +-- docs/installation.md | 6 +- docs/packages.md | 16 ++-- docs/release.md | 6 ++ docs/testing.md | 22 +++--- framework-matrix.json | 13 +++- pyproject.toml | 7 +- tests/conftest.py | 53 ------------- tests/integration/conftest.py | 24 ++++++ .../test_geometry_package_matrix.py | 2 +- .../test_geometry_tessellation_integration.py | 0 .../test_native_geometry_backends.py | 0 tests/test_distribution_artifacts.py | 28 ++----- tests/test_package.py | 76 +++++++++++++------ 20 files changed, 157 insertions(+), 144 deletions(-) delete mode 100644 tests/conftest.py create mode 100644 tests/integration/conftest.py rename tests/{ => integration}/test_geometry_package_matrix.py (98%) rename tests/{ => integration}/test_geometry_tessellation_integration.py (100%) rename tests/{ => integration}/test_native_geometry_backends.py (100%) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 311aab3..44371a8 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -37,7 +37,7 @@ command line to ease recurring operations: * `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 framework package and pure tests. +* `uv run --no-sync invoke typecheck`: Run Pyright over the metapackage 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. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 086d6a0..4502930 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -14,9 +14,7 @@ _Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._ - [ ] I added a line to the `CHANGELOG.md` file in the `Unreleased` section under the most fitting heading (e.g. `Added`, `Changed`, `Removed`). -- [ ] I ran the pure package tests locally (`uv run invoke test`). -- [ ] I ran lint locally and there are no errors (`uv run invoke lint`). -- [ ] I added new functions/classes and made them available on a second-level import, e.g. `compas.datastructures.Mesh`. +- [ ] I ran the local checks (`uv run --no-sync invoke check typecheck test docs`). - [ ] I recorded any applicable cross-package verification evidence in this pull request. - [ ] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added necessary documentation (if appropriate) diff --git a/.github/workflows/scene-candidate-integration.yml b/.github/workflows/scene-candidate-integration.yml index 16163f8..30fab75 100644 --- a/.github/workflows/scene-candidate-integration.yml +++ b/.github/workflows/scene-candidate-integration.yml @@ -2,7 +2,6 @@ name: scene-candidate-integration on: pull_request: - branches: [c3-upgrade] paths: - .github/scene-candidates/** - .github/workflows/scene-candidate-integration.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 5045102..79e3f0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,12 +13,15 @@ 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. +* Added a framework package matrix and a manual clean-install check for the + declared Python and operating system targets. ### Changed -* Run ordinary CI on pull requests to any base branch and use canonical - checkouts for initiative work. +* Use canonical checkouts for initiative work and run ordinary CI on pull + requests targeting any base branch. +* Keep sibling-checkout fixtures outside the pure suite and validate scene + candidate pins without duplicating their revisions. * 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 63bc652..bd1e9c8 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ The integration and release package for the main COMPAS framework packages: `compas`, `compas_occ`, `compas_cgal`, `compas_libigl`, `compas_gmsh`, `compas_viewer`, `compas_model`, `compas_shapeop`, and `compas_session`. -In addition to providing one installation target, this repository hosts -full-framework tests, data roundtrips, performance checks, examples, and -documentation. +This repository owns the metapackage, cross-package verification, and release +candidate evidence. Individual package APIs and examples live in their owning +repositories. ## Installation @@ -14,8 +14,10 @@ documentation. pip install compas_framework ``` -Python 3.12, 3.13, and 3.14 are supported. Some geometry backends have native -dependencies and may be easier to install through conda-forge. +The metapackage targets Python 3.12, 3.13, and 3.14. Complete runtime +installation across the target matrix still needs hosted verification. Some +geometry backends also require native libraries. See the +[package matrix](docs/packages.md) for current verification coverage. The COMPAS 3 metapackage does not currently provide Rhino, Grasshopper, or Blender extras. Those bundles will return after their owning packages declare diff --git a/docs/examples.md b/docs/examples.md index ed7a2c0..a812a2b 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -16,7 +16,7 @@ required package files. Run it only against artifacts built from the same checkout by setting `COMPAS_FRAMEWORK_DIST_DIR` to their temporary output directory. The local -`uv run invoke build` command builds the current working tree rather than only +`uv run --no-sync invoke build` command builds the current working tree rather than only committed `HEAD` content. ## Core geometry conversions @@ -45,14 +45,14 @@ plugin-dispatch examples: ## Pending native integration fixtures -[`tests/test_native_geometry_backends.py`](https://github.com/compas-dev/compas_framework/blob/main/tests/test_native_geometry_backends.py) +`tests/integration/test_native_geometry_backends.py` and -[`tests/test_geometry_tessellation_integration.py`](https://github.com/compas-dev/compas_framework/blob/main/tests/test_geometry_tessellation_integration.py) +`tests/integration/test_geometry_tessellation_integration.py` are pending geometry and typing candidate-integration fixtures. They are outside the ordinary Ruff, Pyright, and runtime gates and are not authoritative proof of the accepted target contracts. They are not used as the candidate gate. The installed-artifact contracts in `.github/candidates` exercise the approved current boundaries without source -checkout fallbacks. The reviewed live manifest exists, but until its hosted run -succeeds, do not cite either fixture set as positive candidate evidence. +checkout fallbacks. See the [testing strategy](testing.md) for the scope of +recorded candidate evidence. diff --git a/docs/index.md b/docs/index.md index 86b033e..347fca0 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,8 +1,8 @@ # COMPAS Framework `compas_framework` is the integration and release package for the main COMPAS -framework. It provides one tested installation target and a home for workflows -that cross package boundaries. +framework. It provides a single installation target and owns cross-package +verification and release candidate evidence. The distribution installs `compas`, `compas_occ`, `compas_cgal`, `compas_libigl`, `compas_gmsh`, `compas_viewer`, `compas_model`, @@ -10,6 +10,6 @@ The distribution installs `compas`, `compas_occ`, `compas_cgal`, Grasshopper, or Blender extras because the published host packages do not yet declare compatible COMPAS 3 dependencies. -This repository focuses on framework-level plugin discovery, data roundtrips, -performance checks, examples, and documentation. Implementations owned by one -package remain in that package's repository. +See the [testing strategy](testing.md) for the verified scope and the +[package matrix](packages.md) for coverage by package. Implementation and +package-local examples live in their owning repositories. diff --git a/docs/installation.md b/docs/installation.md index eea3528..0e4d7ad 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -1,6 +1,8 @@ # Installation -The framework supports Python 3.12, 3.13, and 3.14. +The metapackage targets Python 3.12, 3.13, and 3.14. Full runtime support is +verified separately from the package metadata and pure tooling checks. See +the [package matrix](packages.md) for current coverage. ```bash python -m pip install compas_framework @@ -24,7 +26,7 @@ environment: ```bash git clone https://github.com/compas-dev/compas_framework.git cd compas_framework -uv sync --frozen --only-group dev --no-install-project +uv sync --locked --only-group dev --no-install-project ``` Alternatively, `environment.yml` bootstraps Python and uv with Conda. Run the diff --git a/docs/packages.md b/docs/packages.md index 7e8d3f6..3823c22 100644 --- a/docs/packages.md +++ b/docs/packages.md @@ -17,12 +17,16 @@ mixing these releases with COMPAS 2 is unsupported. | `compas_shapeop` | ShapeOp constraint solving | No geometry-tessellation API role | | `compas_session` | Session management for COMPAS workflows and tools | No geometry-tessellation API role | -Compatibility is established by the framework test suite and released as one -versioned dependency set. - -The table intentionally does not predict package release numbers. Each package -may have a different next major version, but its dependency metadata must express -the same `compas>=3` baseline before coordinated publication. +The [framework matrix](https://github.com/compas-dev/compas_framework/blob/c3-upgrade/framework-matrix.json) +records all required distributions, their configured integration checks, and +the Python and OS targets for clean installation. The native artifact gate +covers Core, OCC, CGAL, and libigl on Linux x86-64 with Python 3.12. The scene +gate covers Core, Viewer, and Model from pinned sources. An empty coverage entry +indicates that the current integration gates do not exercise that package. + +Package release numbers can differ. The tooling lock and candidate pins serve +their respective checks. Before promotion, record and verify the release set +and encode its approved compatibility ranges in the wheel metadata. ## Geometry-tessellation release checklist diff --git a/docs/release.md b/docs/release.md index c7faf0b..465dac6 100644 --- a/docs/release.md +++ b/docs/release.md @@ -20,6 +20,12 @@ approval and implementation. Main remains untouched. 4. The workflow uploads the verified files only as a temporary GitHub Actions candidate artifact. +Before promoting a framework release, record the approved compatibility ranges +for all required packages in `pyproject.toml`. Confirm the verified wheel +contains those ranges. After the matching upstream packages are public, run +`framework-install.yml` against the release commit and record the result +alongside the exact-artifact evidence. + For a coordinated native release, every owning repository builds its wheel once through its protected workflow. The reviewed framework manifest records the producing run and immutable archive/wheel hashes. After the hosted native diff --git a/docs/testing.md b/docs/testing.md index 04ecce2..adb3fa0 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -1,12 +1,12 @@ # Testing Strategy -Cross-package integration can cover: +Framework tests are organized by the contract they exercise: - 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 -- installation checks for coordinated package releases. +- packaging checks for the supported Python and operating-system matrix. ## Pure repository checks @@ -44,10 +44,12 @@ 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. +The manual `framework-install.yml` workflow builds the metapackage from a +selected commit and installs it from scratch with its dependencies from PyPI. +It runs dependency checks on every target in the [package matrix](packages.md). +Run it after the matching upstream distributions are available. The runtime +and artifact gates supply separate evidence of cross-package behavior and +exact artifact provenance. ## Native integration @@ -83,10 +85,10 @@ checks the schema, provenance rules, archive safety, wheel metadata, offline revalidation, release-order fixtures, and focused negative cases proving that a changed digest and a skipped backend are rejected. -The larger `tests/test_native_geometry_backends.py` and -`tests/test_geometry_tessellation_integration.py` files remain pending -strategy-era fixtures outside the ordinary gates. They are not substituted -for the installed-artifact contracts or cited as current integration evidence. +The pending geometry fixtures live under `tests/integration/`. For local +diagnostics, explicitly select a file in that directory from `compas3`. The +fixtures require the Core, OCC, CGAL, and libigl sibling checkouts. Bare +`pytest` runs the pure suite and never loads those checkouts. Geometry-tessellation performance thresholds are deferred until the framework has an environment-normalized benchmark runner. Wall-clock assertions in this diff --git a/framework-matrix.json b/framework-matrix.json index d27e2bf..cb88de1 100644 --- a/framework-matrix.json +++ b/framework-matrix.json @@ -1,4 +1,15 @@ { "python": ["3.12", "3.13", "3.14"], - "install_check_os": ["ubuntu-latest", "macos-latest", "windows-latest"] + "install_check_os": ["ubuntu-latest", "macos-latest", "windows-latest"], + "packages": { + "compas": ["native-artifact", "scene-source"], + "compas-cgal": ["native-artifact"], + "compas-gmsh": [], + "compas-libigl": ["native-artifact"], + "compas-model": ["scene-source"], + "compas-occ": ["native-artifact"], + "compas-session": [], + "compas-shapeop": [], + "compas-viewer": ["scene-source"] + } } diff --git a/pyproject.toml b/pyproject.toml index f2303ab..68bd950 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -111,8 +111,8 @@ where = ["src"] # ============================================================================ [tool.pytest.ini_options] -minversion = "6.0" -testpaths = ["tests", "src/compas_framework"] +minversion = "9.0" +testpaths = ["tests/test_package.py"] python_files = ["test_*.py", "*_test.py", "test.py"] addopts = [ "-ra", @@ -165,8 +165,7 @@ line-length = 179 indent-width = 4 target-version = "py312" extend-exclude = [ - "tests/test_geometry_tessellation_integration.py", - "tests/test_native_geometry_backends.py", + "tests/integration", ] [tool.ruff.lint] diff --git a/tests/conftest.py b/tests/conftest.py deleted file mode 100644 index 4baab77..0000000 --- a/tests/conftest.py +++ /dev/null @@ -1,53 +0,0 @@ -import sys -from importlib import import_module -from pathlib import Path - -import pytest - - -FRAMEWORK_ROOT = Path(__file__).parents[1] -CODE_ROOT = FRAMEWORK_ROOT.parent -SIBLING_REPOSITORIES = ( - "compas", - "compas_occ", - "compas_cgal", - "compas_libigl", -) - - -# Integration tests exercise the checked-out sibling sources without installing -# or modifying their environments. Insert in reverse so core COMPAS has highest -# precedence when multiple distributions are already installed. -for repository in reversed(SIBLING_REPOSITORIES): - source = CODE_ROOT / repository / "src" - if source.is_dir(): - sys.path.insert(0, str(source)) - - -def _module_is_below(module, root): - filepath = getattr(module, "__file__", None) - return filepath is not None and Path(filepath).resolve().is_relative_to(root.resolve()) - - -# Pytest plugins and interactive runners can populate sys.modules before this -# conftest is collected. Remove only mismatched sibling packages so collection -# cannot silently exercise an installed copy instead of the checkout. -for repository in SIBLING_REPOSITORIES: - source = CODE_ROOT / repository / "src" - module = sys.modules.get(repository) - if source.is_dir() and module is not None and not _module_is_below(module, source): - for name in [name for name in sys.modules if name == repository or name.startswith(repository + ".")]: - del sys.modules[name] - - -@pytest.fixture(scope="session", autouse=True) -def assert_sibling_source_provenance(): - resolved = {} - for repository in SIBLING_REPOSITORIES: - source = CODE_ROOT / repository / "src" - if not source.is_dir(): - continue - module = import_module(repository) - assert _module_is_below(module, source), f"{repository} resolved from {getattr(module, '__file__', None)!r}; expected checkout below {source}" - resolved[repository] = module - return resolved diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py new file mode 100644 index 0000000..8d4790f --- /dev/null +++ b/tests/integration/conftest.py @@ -0,0 +1,24 @@ +import sys +from pathlib import Path + +import pytest + + +CODE_ROOT = Path(__file__).resolve().parents[3] +SIBLING_REPOSITORIES = ("compas", "compas_occ", "compas_cgal", "compas_libigl") + + +def pytest_configure(config): + sources = {name: CODE_ROOT / name / "src" for name in SIBLING_REPOSITORIES} + missing = [str(source) for source in sources.values() if not source.is_dir()] + if missing: + raise pytest.UsageError("Integration tests require sibling checkouts: " + ", ".join(missing)) + + for name, source in sources.items(): + module = sys.modules.get(name) + if module is not None: + module_file = getattr(module, "__file__", None) + if not module_file or not Path(module_file).resolve().is_relative_to(source.resolve()): + raise pytest.UsageError(f"{name} was already imported from {module_file!r}. Start with a fresh Python process.") + + sys.path[:0] = [str(source) for source in sources.values()] diff --git a/tests/test_geometry_package_matrix.py b/tests/integration/test_geometry_package_matrix.py similarity index 98% rename from tests/test_geometry_package_matrix.py rename to tests/integration/test_geometry_package_matrix.py index 214af01..412bfd2 100644 --- a/tests/test_geometry_package_matrix.py +++ b/tests/integration/test_geometry_package_matrix.py @@ -8,7 +8,7 @@ pytestmark = pytest.mark.integration -CODE_ROOT = Path(__file__).parents[2] +CODE_ROOT = Path(__file__).parents[3] def _pyproject(repository): diff --git a/tests/test_geometry_tessellation_integration.py b/tests/integration/test_geometry_tessellation_integration.py similarity index 100% rename from tests/test_geometry_tessellation_integration.py rename to tests/integration/test_geometry_tessellation_integration.py diff --git a/tests/test_native_geometry_backends.py b/tests/integration/test_native_geometry_backends.py similarity index 100% rename from tests/test_native_geometry_backends.py rename to tests/integration/test_native_geometry_backends.py diff --git a/tests/test_distribution_artifacts.py b/tests/test_distribution_artifacts.py index 1e7e6cc..ce69ef6 100644 --- a/tests/test_distribution_artifacts.py +++ b/tests/test_distribution_artifacts.py @@ -1,28 +1,15 @@ import os -import re import tarfile +import tomllib import zipfile from email.parser import BytesParser from pathlib import Path - -RUNTIME_DEPENDENCIES = { - "compas", - "compas-cgal", - "compas-gmsh", - "compas-libigl", - "compas-model", - "compas-occ", - "compas-session", - "compas-shapeop", - "compas-viewer", -} -DEVELOPMENT_DEPENDENCIES = {"build", "invoke", "mkdocs", "pyright", "pytest", "ruff", "twine"} +from packaging.requirements import Requirement +from packaging.utils import canonicalize_name -def canonical_name(requirement: str) -> str: - name = re.split(r"[ (;<>=]", requirement, maxsplit=1)[0] - return re.sub(r"[-_.]+", "-", name).lower() +DEVELOPMENT_DEPENDENCIES = {"build", "invoke", "mkdocs", "pyright", "pytest", "ruff", "twine"} def test_built_distributions_are_complete(): @@ -39,11 +26,12 @@ def test_built_distributions_are_complete(): metadata = BytesParser().parsebytes(archive.read(metadata_path)) raw_requirements = metadata.get_all("Requires-Dist", []) - requirements = {canonical_name(requirement) for requirement in raw_requirements} + requirements = {Requirement(value) for value in raw_requirements} assert "compas_framework/__init__.py" in names assert set(metadata["Requires-Python"].split(",")) == {">=3.12", "<3.15"} - assert RUNTIME_DEPENDENCIES <= requirements - assert DEVELOPMENT_DEPENDENCIES.isdisjoint(requirements) + assert DEVELOPMENT_DEPENDENCIES.isdisjoint(canonicalize_name(requirement.name) for requirement in requirements) + project = tomllib.loads((Path(__file__).resolve().parents[1] / "pyproject.toml").read_text())["project"] + assert requirements == {Requirement(value) for value in project["dependencies"]} assert metadata.get_all("Provides-Extra", []) == [] assert all("extra ==" not in requirement for requirement in raw_requirements) diff --git a/tests/test_package.py b/tests/test_package.py index 152088e..1ae5057 100644 --- a/tests/test_package.py +++ b/tests/test_package.py @@ -3,6 +3,14 @@ import tomllib from pathlib import Path from runpy import run_path +from urllib.parse import urlsplit + +import pytest +from packaging.requirements import Requirement +from packaging.utils import canonicalize_name + + +ROOT = Path(__file__).resolve().parents[1] def test_version_is_available(): @@ -11,15 +19,6 @@ 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")) @@ -69,22 +68,50 @@ def test_native_candidate_integration_runs_from_the_protected_initiative_branch( assert "inputs.manifest_path || '.github/candidates/native-linux-py312.json'" in workflow -def test_scene_candidate_integration_pins_exact_source_revisions(): - source = Path(__file__).parents[1] - workflow = (source / ".github" / "workflows" / "scene-candidate-integration.yml").read_text() - - for filename, distribution in (("core-requirements.txt", "compas"), ("viewer-requirements.txt", "compas_viewer")): - requirement = (source / ".github" / "scene-candidates" / filename).read_text().strip() - prefix = f"{distribution} @ git+https://github.com/compas-dev/{distribution}.git@" - assert requirement.startswith(prefix) - assert re.fullmatch(r"[0-9a-f]{40}", requirement.removeprefix(prefix)) - assert "branches: [c3-upgrade]" in workflow - assert "core-requirements.txt" in workflow - assert "viewer-requirements.txt" in workflow +@pytest.mark.parametrize( + ("filename", "distribution", "repository"), + [ + ("core-requirements.txt", "compas", "compas-dev/compas"), + ("viewer-requirements.txt", "compas_viewer", "compas-dev/compas_viewer"), + ("model-requirements.txt", "compas_model", "BlockResearchGroup/compas_model"), + ], +) +def test_scene_candidate_pins_exact_source_revision(filename, distribution, repository): + requirement = Requirement((ROOT / ".github" / "scene-candidates" / filename).read_text().strip()) + assert requirement.name == distribution + assert requirement.url is not None + url = urlsplit(requirement.url) + assert url.scheme == "git+https" + assert url.netloc == "github.com" + repository_path, _, revision = url.path.rpartition("@") + assert repository_path == f"/{repository}.git" + assert re.fullmatch(r"[0-9a-f]{40}", revision) + assert requirement.marker is None + assert not requirement.extras + assert not url.query and not url.fragment + workflow = (ROOT / ".github" / "workflows" / "scene-candidate-integration.yml").read_text() + assert filename in workflow assert "--no-deps" in workflow assert "source-installed-candidates" in workflow +def test_framework_matrix_matches_package_metadata_and_candidate_coverage(): + matrix = json.loads((ROOT / "framework-matrix.json").read_text()) + project = tomllib.loads((ROOT / "pyproject.toml").read_text())["project"] + dependencies = {canonicalize_name(Requirement(value).name) for value in project["dependencies"]} + assert set(matrix["packages"]) == dependencies + assert matrix["python"] == [ + classifier.removeprefix("Programming Language :: Python :: ") for classifier in project["classifiers"] if classifier.startswith("Programming Language :: Python :: 3.") + ] + + native_manifest = json.loads((ROOT / ".github" / "candidates" / "native-linux-py312.json").read_text()) + native_packages = {package["distribution"] for package in native_manifest["packages"]} + scene_packages = {canonicalize_name(Requirement(path.read_text().strip()).name) for path in (ROOT / ".github" / "scene-candidates").glob("*-requirements.txt")} + coverage = {name: set(gates) for name, gates in matrix["packages"].items()} + assert coverage == {name: {gate for gate, packages in [("native-artifact", native_packages), ("scene-source", scene_packages)] if name in packages} for name in dependencies} + assert native_packages | scene_packages <= dependencies + + def test_framework_examples_page_is_link_oriented(): page = (Path(__file__).parents[1] / "docs" / "examples.md").read_text() @@ -93,7 +120,8 @@ def test_framework_examples_page_is_link_oriented(): def test_pending_candidate_fixtures_are_outside_ordinary_static_gates(): - configuration = (Path(__file__).parents[1] / "pyproject.toml").read_text() + configuration = tomllib.loads((ROOT / "pyproject.toml").read_text())["tool"] - assert '"tests/test_geometry_tessellation_integration.py"' in configuration - assert '"tests/test_native_geometry_backends.py"' in configuration + assert "tests/integration" in configuration["ruff"]["extend-exclude"] + assert configuration["pytest"]["ini_options"]["testpaths"] == ["tests/test_package.py"] + assert not (ROOT / "tests" / "conftest.py").exists()