Repository navigation
Release 0.1.0: project settings, real-model fixes, PyPI publishing - #24
Merged
Merged
Conversation
…init` `init` now saves only what `test` uses, in .code2test/config.json: confidence_threshold, output_dir and exclude_patterns (settable with --confidence, --output-dir and repeatable --exclude). `test` takes them as defaults; options on the command line win. Files from older versions (with language/framework keys) still load; invalid values stop the run with a clear message. Also: - `--exclude` adds to the built-in exclusions instead of replacing them (replacing them made the next run analyze the generated tests) and can be repeated; the output directory is always excluded. - `--framework` is removed: only pytest tests are generated. - Run reports go under the project root, like the tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VGBhCd3VqGRk2KLZg1Tqu2
The version is defined once, as code2test.__version__: pyproject reads it (dynamic version) and the JSON reports use it instead of a literal. Module docstrings and comments that still described CodeWiki's documentation generator now describe the dependency analysis, the exception base class is Code2TestError, and `python -m code2test`'s docstring names the right module. The CodeWiki attribution and the ~/.codewiki settings location (kept so saved settings keep working) remain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VGBhCd3VqGRk2KLZg1Tqu2
The static intent took everything before the first "." in a docstring, so "Return the sum ... plus tax at rate (0.2 means 20%)" became "Return the sum ... plus tax at rate (0", and "e.g." ended a summary early. The summary now ends at ".", "!" or "?" followed by a space or the end of the paragraph (skipping e.g., i.e., etc., vs., cf.), only the first paragraph is used, and wrapped lines are joined instead of keeping a newline inside the intent. Found while preparing the real model checks for 0.1.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VGBhCd3VqGRk2KLZg1Tqu2
Found by running `code2test test` interactively against a real model: - Intents were never stored in interactive mode, so an edited intent was lost (`intent show` found nothing) and the next session inferred it again. Every presented intent is now stored, an edit is saved as user-edited, and a later session starts from the edited intent. - The end-of-session table read keys the session never set, so it showed "Tests Generated 0, Verified 0, Avg Confidence 0%" after saving 44 verified tests. It now lists components, test files saved, tests saved and skipped components. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VGBhCd3VqGRk2KLZg1Tqu2
- CHANGELOG.md with the 0.1.0 entry: features, measured results, known limitations. - .github/workflows/publish.yml builds, checks (twine) and uploads to PyPI with trusted publishing when a GitHub release is published; it refuses a release whose tag does not match code2test.__version__. - README and quickstart install with `pip install code2test`, with the GitHub tag as the alternative; the CI examples install the package. - docs/task.md lists the release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VGBhCd3VqGRk2KLZg1Tqu2
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
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.
Summary
Everything for the 0.1.0 release (Python-only alpha). After this merges,
mastergets thev0.1.0tag. Publishing a GitHub release from that tag uploads the package to PyPI.Changes
code2test initsettings are used.initsavesconfidence_threshold,output_dirandexclude_patternsto.code2test/config.json, andcode2test testuses them as defaults. Command-line options win. Config files from older versions still load, and invalid values stop the run with a clear message.--excludeadds to the built-in exclusions and can be repeated. It used to replace them, so generated tests were analyzed as project code on the next run. The output directory is now always excluded.--frameworkremoved: only pytest tests are generated.code2test.__version__.pyproject.tomland the reports read it.~/.codewikisettings location remain.Bugs found by the real-model checks (each has a test)
Release material
CHANGELOG.mdwith the 0.1.0 entry..github/workflows/publish.yml: when a GitHub release is published, it builds, runstwine check, and uploads to PyPI with trusted publishing, so no token is stored. It refuses a release whose tag doesn't match the package version.pip install code2test, with the GitHub tag as the alternative. The CI examples install the package.Verification
Unit tests:
pytestpasses (122 tests plus the new ones);ruff checkandruff format --checkare clean.Real-model checks (MiniMax
MiniMax-M3.1-Flash-Preview, on a 3-function sample projectshop/pricing.py):code2test test .interactive: acceptapply_discount, edittotal_with_tax's intent, skipformat_priceintent showreturns it at 95% confidence) and the model generated tests for the edited detail;verify: 74/74 passpercent / 1000), thencode2test verify tests/code2test verify --diagnose tests/code2test verify --fix tests/verify: 75/75 passcode2test config validatePackage:
git archiveof the final commit.twine check: PASSED for both.code2test --versiongives 0.1.0.code2test test --auto --exit-code .run from that install on the sample:verify: 123/123 pass.Release notes (paste into the GitHub release for
v0.1.0)After merge
v0.1.0on the merge commit.code2testCirkitly, repositorycode2testpublish.yml, environmentpypiv0.1.0tag with the notes above. That triggers the PyPI upload.🤖 Generated with Claude Code
https://claude.ai/code/session_01VGBhCd3VqGRk2KLZg1Tqu2
Generated by Claude Code