Skip to content

Migrate setup.py to pyproject.toml with optional extras #26

@krisrowe

Description

@krisrowe

Problem

The repo uses setup.py instead of pyproject.toml. This is the legacy packaging format. More importantly, all dependencies (SDK, CLI, MCP) are bundled in a single install_requires — consumers who only need the SDK (e.g., to import gwsa.sdk.mail from another package) are forced to pull in Click, FastMCP, and other interface-layer dependencies they don't use.

Proposed solution

Migrate from setup.py to pyproject.toml with optional extras:

[project]
name = "gwsa"
dependencies = [
    # SDK-only dependencies
    "google-auth",
    "google-auth-oauthlib",
    "httpx",
    # ... other SDK imports
]

[project.optional-dependencies]
cli = ["click>=8.0"]
mcp = ["mcp>=1.0.0"]

This enables:

# SDK only (for cross-repo import)
pip install "git+https://github.com/krisrowe/gworkspace-access.git"

# Full install
pipx install "gwsa[cli,mcp] @ git+https://github.com/krisrowe/gworkspace-access.git"

No code changes should be required — the SDK layer already doesn't import Click or FastMCP. This is purely a packaging change. Verify by checking that no __init__.py eagerly imports from cli/ or mcp/ at package load time; if so, make those imports lazy.

See krisrowe/mcp/framework/ for the pattern documentation.

Work breakdown

  • Audit gwsa/__init__.py for eager imports of cli/mcp modules
  • Catalog current install_requires and split into base vs cli vs mcp
  • Create pyproject.toml with optional extras
  • Remove setup.py
  • Verify pip install . (SDK only) works without Click/FastMCP
  • Verify pip install ".[cli,mcp]" works with full functionality
  • Update README install instructions
  • Update any downstream repos that depend on gwsa (currently: notes uses gwsa in optional [google] extra — no change needed)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions