Skip to content

Move server dependencies to optional extras#18

Closed
tijmenstor wants to merge 1 commit intomainfrom
fix/slim-client-dependencies
Closed

Move server dependencies to optional extras#18
tijmenstor wants to merge 1 commit intomainfrom
fix/slim-client-dependencies

Conversation

@tijmenstor
Copy link
Member

Summary

  • Move fastapi, pydantic, and uvicorn to [project.optional-dependencies] server
  • Client package now only requires requests
  • Example server script removed from default install (can still run via python -m devleaps.policies.example.main)

Motivation

The client only needs requests for HTTP calls. The server dependencies (especially pydantic-core which requires Rust compilation) add significant overhead for users who only need the client.

This change enables a much simpler Homebrew formula that doesn't require Rust/LLVM (~2GB) as build dependencies.

Migration

  • pip install devleaps-agent-policies - installs client only
  • pip install devleaps-agent-policies[server] - installs client + server dependencies

Test plan

  • Verify client works with only requests installed
  • Verify server works with [server] extras installed
  • Update homebrew-brew formula after release

🤖 Generated with Claude Code

The client only needs `requests` - move fastapi, pydantic, and uvicorn
to [project.optional-dependencies] server.

This significantly reduces the dependency footprint for users who only
need the policy client (e.g., via Homebrew), avoiding the need to
compile pydantic-core from Rust source.

To run the example server: pip install devleaps-agent-policies[server]

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the package structure to make server dependencies optional, reducing installation overhead for users who only need the client. The main change moves fastapi, pydantic, and uvicorn from required dependencies to optional [server] extras, while keeping only requests as a core dependency.

Changes:

  • Moved server dependencies (fastapi, pydantic, uvicorn) to optional [server] extras in pyproject.toml
  • Removed the devleaps-policy-example-server script entry point, replacing it with a comment documenting the manual invocation method
Comments suppressed due to low confidence (1)

pyproject.toml:38

  • The dev optional dependencies should include the server extras since the test files import from devleaps.policies.example.main which requires fastapi, pydantic, and uvicorn. Without these dependencies, tests will fail with import errors. Consider either:
  1. Adding the server dependencies to the dev extras (recommended): dev = ["httpx==0.28.1", "pytest==8.4.2", "fastapi==0.118.0", "pydantic==2.12.5", "uvicorn==0.37.0"]
  2. Or referencing the server extra: Update documentation to specify that tests require pip install devleaps-agent-policies[dev,server]
dev = [
    "httpx==0.28.1",
    "pytest==8.4.2",
]

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

[project.scripts]
devleaps-policy-client = "devleaps.policies.client.client:main"
devleaps-policy-example-server = "devleaps.policies.example.main:main"
# To run the example server: pip install devleaps-agent-policies[server] && python -m devleaps.policies.example.main
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README still references the removed devleaps-policy-example-server command in two places (lines 57 and 107). These should be updated to reflect the new installation and running instructions as documented in the comment on line 42 of pyproject.toml. Consider updating them to:

pip install devleaps-agent-policies[server]
python -m devleaps.policies.example.main
Suggested change
# To run the example server: pip install devleaps-agent-policies[server] && python -m devleaps.policies.example.main
# To run the example server:
# pip install devleaps-agent-policies[server]
# python -m devleaps.policies.example.main

Copilot uses AI. Check for mistakes.
@tijmenstor tijmenstor closed this Jan 26, 2026
@tijmenstor tijmenstor deleted the fix/slim-client-dependencies branch January 26, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants