Welcome! If you are an AI assistant, coding agent, or language model (e.g., Antigravity, Claude Code, Cursor, Copilot) helping to develop python-ulid, please adhere to the guidelines in this document.
These instructions ensure consistency, prevent common development errors, and keep code quality aligned with the project's standards.
We use modern, fast, and strict tooling for Python development. Always use the specified commands below.
- Dependency Manager: We use uv.
- Do not use raw
pip,poetry, orpdm. - To install dependencies, run:
uv sync. - Always prefix commands with
uv runto execute them in the correct environment (e.g.,uv run pytest).
- Do not use raw
- Task Runner: We use Poe the Poet.
- Development tasks are defined in
pyproject.tomlunder[tool.poe.tasks]. - Run checks with
uv run poe check.
- Development tasks are defined in
- Linting & Formatting: We use Ruff.
- Standard line-length limit is 100 characters.
- Auto-format code using
uv run poe fmt.
- Static Typing: We use pyrefly for strict static analysis.
- Run type checking using
uv run poe check-types.
- Run type checking using
We require full, strict type annotations across the entire codebase.
- Rules:
- Always annotate all function parameters and return values.
- Avoid
Anywhere possible; use specific types, unions, or generics. - Run type checking to verify compliance:
uv run poe check-types.
- Formatting: Run formatting before finalizing any file modifications.
- Use
uv run poe fmtto auto-format. - Code style rules are detailed in
pyproject.tomland.ruff_defaults.toml.
- Use
- Imports: We use single-line imports and specific import order (
isortrules). Let Ruff handle this automatically.
- Never generate code with comments like
# TODO: implement this,# placeholder, or partial code blocks. - Implement the full logic requested, ensuring error handling and correct edge cases are covered.
We maintain a human-readable changelog in CHANGELOG.rst following the Keep a Changelog conventions.
- Section headings: Group entries under the standard headings, in this order:
Added,Changed,Deprecated,Removed,Fixed,Security. Omit any section that has no entries. - Removals belong under
Removed: Do not fold removed or renamed public APIs intoChanged. - Versioning: Follow Semantic Versioning. A breaking change (e.g. a removed public API) requires a major version bump and a
.. warning::admonition describing the migration path. - Entry format: Each release has a
`X.Y.Z`_ - YYYY-MM-DDheading plus a matching compare link at the bottom of the file (.. _X.Y.Z: https://github.com/mdomke/python-ulid/compare/PREV...X.Y.Z). - reStructuredText: Keep lines within 100 characters (enforced by
doc8) and reference public symbols with Sphinx roles such as:class:and:meth:β the changelog is included into the rendered documentation.
Before completing any task, you MUST run the verification commands to ensure no regressions or style issues are introduced.
- Format Code:
uv run poe fmt
- Run Lints, Types & Style Checks:
uv run poe check
- Run Test Suite:
uv run poe test
Make sure all checks pass without errors.
/ulid: Contains the source code of thepython-ulidpackage./tests: Contains all unit and integration tests. Write corresponding test cases here for any new logic./docs: Contains Sphinx-based documentation.pyproject.toml: The single source of truth for dependencies, tools configuration, and Poe tasks.
Refer to the primary developer documentation and CONTRIBUTING.md for more details.