Skip to content

Commit affc32b

Browse files
robtaylorclaude
andcommitted
Rename chipflow_lib to chipflow with backward compatibility
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]>
1 parent 310fc79 commit affc32b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+212
-186
lines changed

chipflow/__init__.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# SPDX-License-Identifier: BSD-2-Clause
2+
"""
3+
Chipflow library
4+
5+
This is the main entry point for the ChipFlow library, providing tools for
6+
building ASIC designs using the Amaranth HDL framework.
7+
"""
8+
9+
import importlib.metadata
10+
from typing import TYPE_CHECKING
11+
12+
# Import core utilities
13+
from .utils import (
14+
ChipFlowError,
15+
ensure_chipflow_root,
16+
get_cls_by_reference,
17+
get_src_loc,
18+
)
19+
20+
if TYPE_CHECKING:
21+
from .config import Config
22+
23+
__version__ = importlib.metadata.version("chipflow")
24+
25+
26+
# Maintain backward compatibility with underscore-prefixed names
27+
_get_cls_by_reference = get_cls_by_reference
28+
_ensure_chipflow_root = ensure_chipflow_root
29+
_get_src_loc = get_src_loc
30+
31+
32+
def _parse_config() -> 'Config':
33+
"""Parse the chipflow.toml configuration file."""
34+
from .config.parser import _parse_config as config_parse
35+
return config_parse()
36+
37+
38+
__all__ = [
39+
'__version__',
40+
'ChipFlowError',
41+
'ensure_chipflow_root',
42+
]
File renamed without changes.

chipflow_lib/_pin_lock.py renamed to chipflow/_pin_lock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Backward compatibility shim for pin lock functionality.
44
55
This module re-exports pin lock functionality from the packaging module.
6-
New code should import directly from chipflow_lib.packaging instead.
6+
New code should import directly from chipflow.packaging instead.
77
"""
88

99
# Re-export from packaging module for backward compatibility

chipflow_lib/cli.py renamed to chipflow/cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ class UnexpectedError(ChipFlowError):
2323

2424

2525
DEFAULT_STEPS = {
26-
"silicon": "chipflow_lib.steps.silicon:SiliconStep",
27-
"sim": "chipflow_lib.steps.sim:SimStep",
28-
"software": "chipflow_lib.steps.software:SoftwareStep"
26+
"silicon": "chipflow.steps.silicon:SiliconStep",
27+
"sim": "chipflow.steps.sim:SimStep",
28+
"software": "chipflow.steps.software:SoftwareStep"
2929
}
3030

3131

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)