Commit 6eb6554
Restructure Python package to follow best practices (#22)
Reorganize the Python emulator to follow Python Packaging Authority (PyPA)
guidelines and the "src layout" pattern. This makes the package structure
more professional, standard, and maintainable.
Changes:
- Move Python modules from src/ to src/host_emulator/
- Update package configuration in pyproject.toml with explicit package location
- Update all imports from "from src import" to "from host_emulator import"
- Maintain proper src layout to prevent accidental import of development version
New structure:
py/host-emulator/
├── src/
│ └── host_emulator/ ← Proper package name (underscores for Python)
│ ├── __init__.py
│ ├── common.py
│ ├── emulator.py
│ ├── i2c.py
│ ├── pin.py
│ └── uart.py
├── tests/
└── pyproject.toml
This structure follows:
- PEP 420 (Implicit Namespace Packages)
- PyPA packaging best practices
- Src layout pattern for proper isolation
All 29 tests continue to pass.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>1 parent 63520fd commit 6eb6554
9 files changed
Lines changed: 3 additions & 3 deletions
File tree
- py/host-emulator
- src/host_emulator
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | | - | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments