スキル一覧に戻る
smith6jt-cop

repo-reorganization

by smith6jt-cop

Using skills repo for AI memory management.

0🍴 0📅 2026年1月23日
GitHubで見るManusで実行

SKILL.md


name: repo-reorganization description: "Python package reorganization with pyproject.toml inside package directory" author: smith6jt date: 2024-12-27

Repo Reorganization - Research Notes

Experiment Overview

ItemDetails
Date2024-12-27
GoalReorganize maxfuse repo to be self-contained in src/maxfuse/ with pyproject.toml inside the package
EnvironmentPython 3.12, hatchling build backend
StatusSuccess

Context

Needed to reorganize a project so the entire package (including pyproject.toml and README.md) lives inside src/maxfuse/. This enables the package to be portable - the repo name can change but the package remains self-contained.

Standard src layout puts pyproject.toml at repo root, but we needed it inside the package directory itself.

Verified Workflow

Final Directory Structure

repo/
├── src/
│   ├── maxfuse/               # Self-contained package
│   │   ├── __init__.py
│   │   ├── pyproject.toml     # Inside package!
│   │   ├── README.md
│   │   ├── core/              # Submodules
│   │   └── mario/
│   └── other-repo/            # Can coexist with other repos
├── notebooks/
├── data/                      # Gitignored
├── results/                   # Gitignored
└── .gitignore

Working pyproject.toml Configuration

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "maxfuse"
version = "0.1.0"
readme = "README.md"
# ... other project metadata

[tool.hatch.build.targets.wheel]
only-include = ["__init__.py", "core", "mario"]

[tool.hatch.build.targets.wheel.force-include]
"__init__.py" = "maxfuse/__init__.py"
"core" = "maxfuse/core"
"mario" = "maxfuse/mario"

Installation

pip install -e src/maxfuse

Failed Attempts (Critical)

AttemptWhy it FailedLesson Learned
packages = ["."]Hatchling couldn't find package, .pth file was emptyCannot use "." as package name
packages = ["maxfuse"] with sources = [".."]Editable install didn't expose moduleSource remapping doesn't work for editable installs
directory = ".." in [tool.hatch.build]Module not found after installDirectory setting alone insufficient
Standard packages = ["src/maxfuse"]Path wrong since pyproject.toml is already inside packageMust use force-include when pyproject.toml is inside package

Final Parameters

The key is using force-include to explicitly map files to their destination paths:

[tool.hatch.build.targets.wheel]
only-include = ["__init__.py", "core", "mario"]

[tool.hatch.build.targets.wheel.force-include]
"__init__.py" = "maxfuse/__init__.py"
"core" = "maxfuse/core"
"mario" = "maxfuse/mario"

This tells hatchling:

  1. Only include these specific files/directories from current location
  2. Map them to maxfuse/ prefix in the wheel

Key Insights

  • When pyproject.toml is inside the package directory, standard src layout patterns don't work
  • force-include is the solution for non-standard layouts
  • The wheel size changing (e.g., 1.7KB to 52KB) indicates whether code is actually included
  • Editable installs create .pth files - check if they're empty when debugging
  • This pattern enables truly portable, self-contained packages

References

スコア

総合スコア

40/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です