Repository navigation
feat(python): publish the chart statistics as the Python package ournotes-sim - #52
Merged
Merged
Conversation
…otes-sim python/ is the Python package ournotes-sim, a package outside the workspace with its own lockfile. Its extension module ournotes_sim._native runs the chart statistics of ournotes-sim on a deck data document held in memory, the charts measured in parallel: - chart_stats(data, seeds=None, workers=None, aptitude=True) returns the ournotes-deck.chart-stats/3 document of an nnnotes.deck-data/1 document. - chart_stats_cached(..., cache_dir=...) keeps the simulation programs in a directory and returns the cache counters with the same document. - info() names the model: version, repository, sourceSha256, the formats it reads and writes, and the source commit of a release build (None for other builds). - MASTER_TABLES lists the master tables a deck data document holds. The package ships type stubs and py.typed. Its tests run on synthetic deck data documents and check that the package version equals the workspace version and that its licence files equal the repository's. CI builds the wheel, tests it on CPython 3.11 and 3.14 and checks formatting and lints of the binding crate. A release builds one abi3 wheel for each of the five release platforms with the release commit compiled into info()["commit"], tests every wheel on its platform, requires the new check before publishing the GitHub release, and then publishes the wheels to PyPI through trusted publishing. The package is published as wheels only, so every installation reports the sourceSha256 of the release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…change the package The wheel matrix moves to the reusable workflow wheels.yml. The release calls it with the release commit, and it also runs on pull requests that change python/, the wheel test script or the workflow itself, with the pull request's commit compiled into info()["commit"]. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
python/, the Python packageournotes-sim(moduleournotes_sim), built with maturin as one abi3 wheel per platform.API
chart_stats(data, seeds=None, workers=None, aptitude=True) -> str: theournotes-deck.chart-stats/3document of annnnotes.deck-data/1document, charts measured in parallel.chart_stats_cached(..., *, cache_dir) -> (str, dict): the same document with the simulation programs kept incache_dir, plus the cache counters.info(): name, version, repository,sourceSha256, formats, and the release commit (Nonefor other builds).MASTER_TABLES: the master tables a deck data document holds._native.pyi) andpy.typed.Build and release
python/is excluded from the workspace and has its ownCargo.lock; the release resolves and checks its version with the workspace version.python: fmt and clippy of the binding crate, then the wheel's tests on CPython 3.11 and 3.14 (scripts/release/smoke-python.py).wheelsjob builds the five platform wheels withSOURCE_COMMITcompiled intoinfo()["commit"]and tests each one on its platform;publishnow also requires thepythoncheck; apypijob checks the wheels withtwineand publishes them through trusted publishing (environmentpypi).ournotes-simmanifest and changesourceSha256.Tests
python/testsrun against the installed wheel on synthetic deck data documents (info fields, empty chart set with and without the cache, invalid data errors, version and licence consistency with the workspace).