Skip to content

Bring fp-py to the nativelite compliance floor (manifest, tests, CI guard) - #11

Merged
JSBtechnologies merged 3 commits into
mainfrom
feat/packaging
Aug 28, 2026
Merged

Bring fp-py to the nativelite compliance floor (manifest, tests, CI guard)#11
JSBtechnologies merged 3 commits into
mainfrom
feat/packaging

Conversation

@JSBtechnologies

@JSBtechnologies JSBtechnologies commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Closes #4, #5, #6, #9.

Brings fp-py from "runtime is clean but nothing proves it" to a package that proves and enforces its nativelite compliance. Three tightly-coupled blockers landed as one reviewable unit (each depends on the previous):

1. Packaging (#4, #9)

  • pyproject.toml (hatchling) with explicit dependencies = [] — zero-dep is now machine-verifiable; version 0.1.0; MIT via LICENSE.
  • Adopt src/fp/ layout; expose fp.__version__.
  • coverage is dev-only ([project.optional-dependencies]).

2. Tests (#5)

  • stdlib unittest suite (tests/), deterministic via mock — no live network.
  • Covers fingerprint determinism, get_components structure + fallbacks, machine_id per-platform branches, the CLI, and every fp.client path (success / merge / invalid-JSON / URLError / TimeoutError).
  • 16 tests, 93% coverage (client.py 100%), above the 80% bar. Run: python -m unittest discover -s tests.

3. CI + dependency guard (#6)

  • tools/dep_guard.py — stdlib-only (tomllib + ast); asserts empty runtime deps and scans imports against sys.stdlib_module_names.
  • .github/workflows/ci.yml — unittest matrix (3.9–3.13) + a guard job.

How verified (clean venv, locally)

pip install -e ".[dev]"                 -> ok
python -m unittest discover -s tests    -> 16 passed
coverage report                         -> 93% total
python tools/dep_guard.py               -> OK (exit 0)
  (planted `import requests`)           -> FAILED (exit 1)

No runtime behavior changed — this is packaging, tests, and enforcement only.

- pyproject.toml (hatchling) with explicit dependencies = [] — the zero-dep
  guarantee is now machine-verifiable; version 0.1.0; MIT via LICENSE file
- move fp/ -> src/fp/ per package-anatomy standard
- expose fp.__version__
- coverage pinned dev-only under [project.optional-dependencies]

Verified: pip install -e . succeeds; import fp, fp.__version__, python -m fp,
and 64-char fingerprint all work; declared runtime deps are empty.

Closes #4. Closes #9.
- tests/test_fingerprint.py: fingerprint determinism, get_components structure
  + fallbacks, machine_id per-platform branches, CLI (default + --components)
- tests/test_client.py: get_fingerprint, post_fingerprint success/merge/
  invalid-JSON(ValueError)/URLError/TimeoutError — all via mock, no live network
- runnable with: python -m unittest discover -s tests

Verified: 16 tests pass; coverage 93% (client.py 100%), above the 80% bar.

Closes #5.
- tools/dep_guard.py: stdlib-only (tomllib + ast). Asserts pyproject
  dependencies == [] and scans src/fp imports against sys.stdlib_module_names;
  fails the build on any third-party runtime import.
- .github/workflows/ci.yml: unittest across Python 3.9-3.13 + a dependency-guard
  job on 3.12.

Verified locally: guard passes clean; fails (exit 1) on a planted 'import
requests'.

Closes #6.
@JSBtechnologies JSBtechnologies changed the title build: add pyproject.toml manifest + src/ layout (zero-dep, installable) Bring fp-py to the nativelite compliance floor (manifest, tests, CI guard) Aug 28, 2026
@JSBtechnologies
JSBtechnologies merged commit f7ce234 into main Aug 28, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add pyproject.toml manifest (declare dependencies = [], version, build backend)

1 participant