1.7 KiB
1.7 KiB
1. Move Top-Level Modules Into a Real Package [DONE]
Summary
Move the current flat module layout into a proper chromy/ package so imports, packaging, and future subpackages are easier to manage.
Implementation Steps
- Create a
chromy/package with__init__.py. - Move
main.py,cli_app.py,cli_parser.py,chroma_functions.py,chunk_functions.py,embed.py, andutilities.pyintochromy/. - Move
handlers/intochromy/handlers/. - Update imports to absolute package imports such as
from chromy.cli_app import execute_commandandfrom chromy.handlers.add_data import handle_add_data. - Update
[project.scripts]inpyproject.tomlfrommain:maintochromy.main:main. - Update setuptools configuration to package
chromyandchromy.handlersinstead of using top-levelpy-modules. - Update README development commands from
uv run python main.py --helptouv run python -m chromy.main --help.
Public Interface Changes
- The installed CLI command remains
chromy. - Programmatic imports move from top-level modules to
chromy.*. - Running from source should use
python -m chromy.main.
Test Plan
- Run
uv run python -m chromy.main --help. - Run
uv run python -m chromy.main list-collections. - Build the package with
uv build. - Install locally in editable mode and confirm
chromy --helpresolves the packaged entrypoint. - Test all commands to verify they still work:
- [creating, listing, deleting] collections
- [adding, deleting] documents to a collection (use romeo_and_juliet.txt)
- querying
Assumptions
- Backward-compatible top-level imports are not required.
- The package refactor should preserve behavior before deeper service or architecture changes are made.