Lobstersgram is a uv-managed Python workspace. Keep changes small, preserve the boundaries between the application and reusable packages, and run the checks that cover the code you touched.
This file is adapted from the python-package-copier-template AGENTS.md.
src/lobstersgram/contains the main Telegram application and itslobstersgramcommand-line entrypoint.packages/md-to-telegraph/contains the reusable Markdown-to-Telegraph package.packages/markdown-this/contains the reusable URL/HTML-to-Markdown package.- Each child package has its own
pyproject.toml, metadata, dependencies, version,README.md,src/<import_name>/, and package-local tests. - The root
pyproject.tomlowns workspace membership and shared Ruff, pytest, and coverage configuration.uv.lockis shared by the workspace. - Root
tests/covers the application; tests for a reusable package belong in that package'stests/directory.
uv sync
uv run lobstersgram --help
uv run pytest -q
uv run pytest packages/markdown-this/tests/test_html.py
uv run ruff check .
uv run ruff format --check .
uv build --all-packagesThe default coverage gate measures md_to_telegraph and markdown_this at
100%. The application tests run in the same pytest invocation, but the root
configuration does not currently enforce 100% coverage for lobstersgram.
- Keep Telegram orchestration, configuration, persistence, and runtime state
in
src/lobstersgram/. - Keep reusable conversion and extraction logic in the relevant child package.
- Reusable packages should not import application modules from
lobstersgram. - Put shared QA configuration in the root
pyproject.toml; keep package metadata and package-specific runtime dependencies in the child package'spyproject.toml.
Packages are versioned and released independently. Bump a package from the workspace root, for example:
uv version --package markdown-this --bump patch
uv lock
git tag markdown-this-v<version>
git push origin markdown-this-v<version>The reusable packages are published independently. Each publishing workflow
is dedicated to one package: publish-md-to-telegraph.yml publishes
md-to-telegraph, and publish-markdown-this.yml publishes markdown-this.
The lobstersgram application is not published to PyPI yet. A release tag only
activates the matching workflow.
- Use
apply_patchfor manual edits. - Do not manually edit
uv.lock; regenerate it withuv lockafter dependency or version changes. - Do not overwrite runtime state files such as
state.json, subscribers, message maps, or bookmarks unless the task explicitly requires it. - Never discard unrelated user changes with destructive git commands.
- Before handing off a change, run the narrowest useful tests plus
ruff check; for dependency, packaging, or workspace changes also runuv build --all-packages.