Switch packaging to hatchling, add scan CLI, optional extras, and include policy assets#7
Merged
Jeffrin-dev merged 1 commit intomainfrom Mar 28, 2026
Conversation
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.
Motivation
shadowauditconsole script and provide a simple CLIscansubcommand to allow ad-hoc PII scans without loading optional heavyweight deps.policies/*are packaged and available at install time.Description
[build-system]section topyproject.tomlto usehatchlingand moved non-essential libraries into[project.optional-dependencies]groupsnerandsiem, while keeping minimaldependenciesin the core install.shadowaudit = "shadowaudit.cli:main"inpyproject.tomland preserved CLI behavior forpolicy check,report, andproxy.shadowaudit/cli.pywith ascansubcommand that usesPIIScannerand prints JSON output, and updated serialization to fall back todataclasses.asdictwhenmodel_dumpis not available.MANIFEST.into includepolicies/gdpr.yaml,policies/hipaa.yaml, andpolicies/pci_dss.yamlin source distributions and addedtests/test_cli_scan.pyto cover the newscancommand.Testing
pytest tests/test_cli_policy_check.py tests/test_cli_proxy.py tests/test_cli_report.py tests/test_cli_scan.pyand all included tests passed (5 passed).pytestfor the full suite which showed two existing unrelated failures intests/test_policy_and_secrets.py(these are from an externaldetect-secretsAPI mismatch and were not caused by these changes).python -m shadowaudit.cli scan "Reach me at alice@example.com",python -m shadowaudit.cli policy check policies/gdpr.yaml, andpython -m shadowaudit.cli report --format gdpr --from 2026-01-01 --to 2026-01-31, all of which produced expected output.python -m pip install -e .but the build step failed in this environment becausehatchlingcould not be downloaded due to network/proxy restrictions, andpytest --cov=... --cov-fail-under=80could not be run becausepytest-covis not installed in the current environment.Codex Task