-
Notifications
You must be signed in to change notification settings - Fork 1
Rename package from chipflow_lib to chipflow #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
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
|
|
b21a9ba to
9cefb0a
Compare
Rename the main package from chipflow_lib to chipflow, maintaining full backward compatibility through a compatibility shim. Changes: - Renamed chipflow_lib/ directory to chipflow/ - Updated all internal imports from chipflow_lib to chipflow - Created chipflow_lib/ backward compatibility package that re-exports from chipflow with deprecation warnings - Updated pyproject.toml package name and references - Updated all documentation references from chipflow_lib to chipflow - Updated test imports and mock patches - Changed simulatable_interface default base from "com.chipflow.chipflow_lib" to "com.chipflow.chipflow" The chipflow_lib backward compatibility shim: - Shows deprecation warning on import - Re-exports all symbols from chipflow via __path__ manipulation - Allows existing code using chipflow_lib to continue working - Will be maintained temporarily before removal in future version All tests pass with the new package structure. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Replace wildcard import in chipflow_lib with explicit minimal API based on
actual usage in chipflow-digital-ip and chipflow-examples repositories.
Changes:
- chipflow_lib/__init__.py: Only export ChipFlowError, __version__, and
internal API functions (_parse_config, etc.)
- chipflow_lib/platforms/__init__.py: Stub module exporting pin signatures
and software build utilities used by dependent packages
- chipflow_lib/steps/{board,sim,software}.py: Stub modules exporting step
classes used by chipflow-examples
- chipflow_lib/config.py: Stub module proxying to chipflow.config
- tests/fixtures/mock.toml: Updated step references to use new module names
All backward compatibility stubs now show deprecation warnings encouraging
users to migrate to the new 'chipflow' package name.
Tests: 37 passed, 4 skipped. All backward compatibility imports verified.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
Add noqa: E402 annotations to imports that intentionally come after deprecation warnings. The imports need to be after warnings.warn() so users see the deprecation message when they import these modules. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
JTAGSignature is used by chipflow-examples mcu_soc project but was missing from the backward compatibility stub exports. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Add three new tests to verify pinlock file loading behavior: - test_load_pinlock_file: validates successful loading of valid lockfile - test_load_pinlock_missing_file: ensures proper error when file missing - test_load_pinlock_malformed_file: ensures proper error for invalid data Fix bug in load_pinlock() where only pydantic.ValidationError was caught, but Pydantic 2.x also raises PydanticUserError for incomplete models. Now catches both exception types. Fix test isolation by clearing ensure_chipflow_root() cache between tests to prevent environment pollution across test runs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Fix issue where real-world pins.lock files were incorrectly reported as malformed due to unresolved forward references in Pydantic models. Changes: - Call model_rebuild() on Package and LockFile after importing all package types to resolve forward references - Chain validation errors using 'from e' to preserve detailed error information for debugging while showing user-friendly message The model_rebuild() calls are necessary because the lockfile models use forward references to package types (GAPackageDef, QuadPackageDef, etc.) that are only imported later in the __init__.py file. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
a1bac06 to
f02183b
Compare
f02183b to
01bd3ae
Compare
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
This PR renames the main package from
chipflow_libtochipflow, maintaining full backward compatibility through a compatibility shim.Changes Made
Package Structure
chipflow_lib/directory tochipflow/chipflow_lib/backward compatibility package that:chipflowvia__path__manipulationchipflow_libto continue working without modificationsCode Updates
chipflow_libtochipflowpyproject.toml:chipflow-lib→chipflowchipflow_lib.cli:run→chipflow.cli:runsimulatable_interface():com.chipflow.chipflow_lib→com.chipflow.chipflowDocumentation
chipflow_libtochipflowdocs/conf.pyto import fromchipflow.rstfiles with new package nameTests
chipflowchipflow_lib.*tochipflow.*Backward Compatibility
The
chipflow_libcompatibility shim ensures existing code continues to work:The deprecation warning encourages users to update:
Testing
✅ All 37 tests pass
✅ Backward compatibility verified -
import chipflow_libworks with deprecation warning✅ Submodule imports work:
from chipflow_lib.platforms import UARTSignature✅ New imports work:
from chipflow.platforms import UARTSignatureMigration Path
Users can migrate gradually:
chipflow_libcode continues to work (with warnings)chipflow_libtochipflowchipflow_libcompatibility shim🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]