Skip to content

refactor: migrate from flat-layout to src-layout - #9

Merged
codeasier merged 1 commit into
mainfrom
refactor/src-layout
Apr 12, 2026
Merged

codeasier merged 1 commit into
mainfrom
refactor/src-layout

Conversation

@codeasier

Copy link
Copy Markdown
Owner

📝 Description

  • Move pt_snap_cli/ directory to src/pt_snap_cli/ (src-layout)
  • Update pyproject.toml package discovery: where = ["src"]
  • Update project structure diagrams in README.md and README_zh.md

This follows Python packaging best practices — src-layout prevents accidental imports of the working tree instead of the installed package.

🔗 Related Issue

Fixes #8

🧪 Testing

  • Tests added/updated (191 tests passing)
  • Manual testing completed

✅ Checklist

  • Code follows project guidelines
  • Documentation updated (if applicable)
  • No new warnings introduced
  • Changes tested locally

📸 Screenshots (if applicable)

📋 Additional Notes

Verification

pip install -e .[dev]    ✅
pytest --cov             ✅ 191 passed, 92% coverage
ruff check .             ✅ All checks passed
black --check .          ✅ 32 files unchanged
pt-snap --version        ✅ 0.1.0b1

What didn't change

  • No Python source code content modified
  • No import paths changed (still from pt_snap_cli.xxx import ...)
  • No test code changes
  • No CI/CD workflow changes needed
  • package-data, coverage.source, and project.scripts all reference package name (not filesystem path)

Move pt_snap_cli/ to src/pt_snap_cli/ and update pyproject.toml
package discovery to where = ["src"]. This follows the Python
packaging best practice of src-layout to prevent accidental
imports of the working tree instead of the installed package.

Also update project structure diagrams in README.md and README_zh.md.
@codeasier
codeasier merged commit b307df3 into main Apr 12, 2026
5 checks passed
@codeasier
codeasier deleted the refactor/src-layout branch April 17, 2026 13:30
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.

[FEATURE] 迁移至 src-layout 标准项目结构

1 participant