refactor(api)!: drop _mock suffix from plugin proxy names#56
Merged
Conversation
Rename all 26 plugin proxy singletons on the `bigfoot` module to drop the `_mock` suffix. Canonical API is now un-suffixed: bigfoot.subprocess, bigfoot.db, bigfoot.redis, bigfoot.mongo, bigfoot.popen, bigfoot.smtp, bigfoot.socket, bigfoot.dns, bigfoot.memcache, bigfoot.celery, bigfoot.log, bigfoot.boto3, bigfoot.async_subprocess, bigfoot.async_websocket, bigfoot.sync_websocket, bigfoot.psycopg2, bigfoot.asyncpg, bigfoot.elasticsearch, bigfoot.jwt, bigfoot.crypto, bigfoot.file_io, bigfoot.pika, bigfoot.ssh, bigfoot.grpc, bigfoot.mcp, bigfoot.native `bigfoot.http` was already un-suffixed and is unchanged. The old `_mock`-suffixed names are retained as deprecated backward-compat aliases via a module-level `__getattr__` hook in `src/bigfoot/__init__.py`. First access to any alias emits `DeprecationWarning` with message "bigfoot.<old> is deprecated; use bigfoot.<new> instead." and `stacklevel=2`. Subsequent accesses of the same alias are silent. The alias map is the sole reference to the old names anywhere in the codebase — every test, doc, example, plugin hint string, and README has been migrated. Changes: - src/bigfoot/__init__.py: canonical proxy assignments + deprecation shim - src/bigfoot/__init__.pyi: mirrored type stubs (canonical + aliases) - src/bigfoot/plugins/*.py: hint strings emit canonical names - tests/: full migration + new deprecation-alias tests (4 functions, 10 parametrized cases) covering identity, first-access warning, no re-warn on second access, and unknown-attribute AttributeError - docs/: 30 guide files migrated to canonical names - examples/: 31 files migrated to canonical names - README.md: code samples migrated - CHANGELOG.md: 0.20.0 entry with Changed + Deprecated sections - pyproject.toml: version 0.19.2 -> 0.20.0
Ruff ANN401 fires because the public contract for module-level __getattr__ is Any. Matches the project's existing noqa style in _mock_plugin.py.
There was a problem hiding this comment.
Code Review
This pull request renames all 26 plugin proxy attributes on the bigfoot module to remove the _mock suffix, establishing un-suffixed names like bigfoot.db and bigfoot.subprocess as canonical. Backward compatibility is preserved through deprecated aliases that trigger a DeprecationWarning on first access. The update is comprehensive, covering the core module, type stubs, documentation, examples, and internal error hints, and includes a version bump to 0.20.0. I have no feedback to provide as there are no review comments to address.
elijahr
added a commit
that referenced
this pull request
Apr 27, 2026
Resolves the 90-file conflict between this branch's bigfoot -> tripwire rename and PR #56's drop of the _mock suffix from plugin proxy attribute names. The merged form takes both changes: tripwire.subprocess.mock_run(...) instead of either bigfoot.subprocess.mock_run(...) (main) or tripwire.subprocess_mock.mock_run(...) (this branch). CHANGELOG 0.20.0 section now includes both PR #56's _mock-drop entry and this branch's rename + 10 design proposal entries.
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
bigfootmodule are renamed to drop the_mocksuffix. Canonical names are now un-suffixed:bigfoot.subprocess,bigfoot.db,bigfoot.redis,bigfoot.mongo,bigfoot.popen,bigfoot.log, etc.bigfoot.httpwas already un-suffixed and is unchanged._mocknames (bigfoot.subprocess_mock, etc.) are retained as deprecated backward-compat aliases wired through a module-level__getattr__insrc/bigfoot/__init__.py. First access to any alias emitsDeprecationWarningwith message"bigfoot.<old> is deprecated; use bigfoot.<new> instead."andstacklevel=2. Subsequent accesses are silent.__init__.pyonly — every test, doc, example, plugin hint string, and README has been migrated to the canonical names. Nothing else in the repo references the_mocknames except the deprecation shim itself and the tests that intentionally exercise it.### Changed+### Deprecatedsections.What changed
src/bigfoot/__init__.py— canonical proxy assignments;_DEPRECATED_PROXY_ALIASESdict + module-level__getattr__emit warningssrc/bigfoot/__init__.pyi— mirrored type stubs (canonical declarations + deprecated aliases, both declared for type-checker compat)src/bigfoot/plugins/*.py— hint strings (format_mock_hint,format_assert_hint,format_unmocked_hint) now emit canonical namestests/unit/test_init.py— new parametrized deprecation-alias tests covering: identity between alias and canonical, first-access emits warning with exact message +stacklevel=2, no re-warn on second access, unknown attribute still raises standardAttributeError. Uses a fixture to snapshot/restore_warned_aliasesso state leaks don't mask behavior.tests/unit/test_*_plugin.pyfiles migrated mechanicallydocs/guides/*.md(30 files) +docs/reference/index.mdmigratedexamples/*/test_app.pyand exampleREADME.mdfiles (31 total) migratedREADME.mdcode samples migratedCHANGELOG.md0.20.0 entrypyproject.tomlversion bumpVerification
tests/, 31 passed inexamples/(1840 total)bigfoot.X_mockreferences survive outside__init__.py/__init__.pyi/the deprecation-alias test block/CHANGELOG history entriesFollow-up (not in this PR)
docs/guides/stateful-plugins.mddocuments an "Auto-assertion" behavior that contradicts the project's anti-auto-assert rule. Pre-existing, flagged by a review subagent during the migration sweep. Worth a separate cleanup PR.