Add Python wrapper proof-of-concept (TestPyPI) for #82 - #98
Open
stephenredhat wants to merge 2 commits into
Open
Add Python wrapper proof-of-concept (TestPyPI) for #82#98stephenredhat wants to merge 2 commits into
stephenredhat wants to merge 2 commits into
Conversation
Adds a small, stdlib-only Python package under python/ that makes the disclosure CLI usable from Python (pip install / uvx and an importable library API). It downloads the prebuilt release binary, verifies it against checksums.txt, caches it, and shells out to it -- no FFI, per the approach recommended on the issue. Exit code 1 (AI detected) is treated as a successful result; only exit code >= 2 raises. Covered by tests in python/tests. No changes to the Go tool or its layout. Intended for TestPyPI first. Fixes chaoss#82 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Stephen Oresanya <soresany@redhat.com>
stephenredhat
marked this pull request as ready for review
August 26, 2026 09:44
andrew
reviewed
Aug 28, 2026
andrew
reviewed
Aug 28, 2026
andrew
reviewed
Aug 28, 2026
Contributor
|
@stephenredhat regarding your open questions above:
I think the separate python/ folder in this repo with all the wrapper code (like in this PR) is good enough. For license, I'd prefer if we keep -or-later since it's more future-compatible than -only. Regarding PyPI name, can we name it disclosure-py? So we follow standard python wrapper naming conventions :) |
- __main__: return exit code 2 (not 1, "AI detected") on resolution failure - _binary: fail closed when checksum is unavailable or missing; verify before caching - packaging: bundle LICENSE in wheel and sdist - add tests for the exit-code and checksum failure paths Signed-off-by: Stephen Oresanya <soresany@redhat.com>
stephenredhat
force-pushed
the
python-wrapper-poc
branch
from
August 31, 2026 15:16
c5e73a9 to
b627a1f
Compare
Author
|
Thanks @andrew , fixed all three in the latest commit |
Author
|
@omkar-foss Thanks, Ill keep it in the python folder and name it disclosure-py. On the license I've matched what the repo already use for now |
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.
Description
Adds a small, stdlib-only Python wrapper for the
disclosureCLI under a newpython/dir, so it's installable viapip/uvxand importable from notebooks. Per @andrew's suggestion it distributes the prebuilt binary (downloads on first use, verifies againstchecksums.txt, caches, shells out) rather than building an FFI binding. Provides a CLI passthrough (disclosure scan ...) and a small library API (scan()/text()/version()return parsed JSON). No changes to the Go tool. Intended for TestPyPI first.This PR fixes #82
Notes for Reviewers
DISCLOSURE_VERSION.python/here vs a separate repo? license-onlyvs-or-later? PyPI namedisclosurevsdisclosure-cli?go build/go testpass unchanged;pytest(6) passes; verified end-to-end against a local v1.0.0 binary.Signed commits
Generative AI disclosure