Skip to content

Conversation

@nehalkpatel
Copy link
Owner

@nehalkpatel nehalkpatel commented Nov 25, 2025

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

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>
@nehalkpatel nehalkpatel merged commit 6eb6554 into main Nov 25, 2025
1 check passed
@nehalkpatel nehalkpatel deleted the feature/python-restructure branch November 25, 2025 06:55
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.

2 participants