Skip to content

Export the public API from parley/__init__.py #35

Description

@5uper0

parley/__init__.py is empty, so nothing is importable from the package root: from parley import run_consensus fails today. Every user has to know the internal module layout (from parley.consensus import run_consensus, from parley.spec import DecisionSpec, …) before they can write their first line. The layout is an implementation detail; the public surface should be one import away.

What is wanted

Re-export the public names in parley/__init__.py and declare __all__:

  • from parley.agent: Agent, Verdict
  • from parley.preferences: PreferenceSheet, HardConstraint, Evaluation
  • from parley.consensus: run_consensus, ConsensusResult, AgentLike, verify_outcome
  • from parley.transcript: Transcript
  • from parley.spec: DecisionSpec, PartySpec, Constraint, UtilityTerm

Leave parley.net out — it stays an explicit opt-in because its signing path depends on the optional crypto extra, and the core package import must stay pure-stdlib.

Re-exports only: no logic in __init__.py, no behaviour change anywhere, and the existing deep imports keep working.

How to verify

Add a small test (e.g. tests/test_public_api.py) that imports every name in __all__ from parley directly, and asserts parley.net is not pulled in by a bare import parley ("parley.net" not in sys.modules). Then:

.venv/bin/pytest -q

All existing tests must stay green.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions