#3507·pr-agent

Every install requires every provider SDK

Author: IsmaelMartinezCreated Sep 19, 2026Updated Sep 24, 2026
Labelshelp wantedRefactoringdependenciesHigh Effort Issue

Every install pulls every provider's SDK. Someone running GitLab only still installs Azure DevOps, AWS, Google Cloud, Bitbucket, Gitea and the A2A server stack.

Verified on main at 275d1386: 42 runtime dependencies resolving to 186 locked packages. The provider-specific ones are atlassian-python-api, azure-devops, azure-identity, msrest, boto3, google-cloud-aiplatform, google-cloud-storage, protobuf, PyGithub, python-gitlab, giteapy and a2a-sdk[http-server]. google-cloud-aiplatform alone is one of the largest wheels in the tree.

The blocker is not the dependency list, it is that pr_agent/git_providers/__init__.py imports all ten provider modules at the top of the file to build _GIT_PROVIDERS, so every SDK must be importable before any provider can be selected.

Suggested shape

Two steps, and they could be two PRs.

  1. Make provider resolution lazy. register_git_provider() already exists in that module, so the registry is halfway to being pluggable; map each provider id to a module path and import it on first use, raising a clear "install pr-agent[azure]" error when the SDK is missing.
  2. Move the provider SDKs into optional extras in pyproject.toml, keep an all extra, and update the Docker targets in docker/ so the published images keep the providers they ship today.

Please do not change what a published image contains, only what a plain pip install pr-agent contains. Flag it explicitly in the PR if you find that impossible.

Reproduce

bash
python3 -c "
import tomllib
d = tomllib.load(open('pyproject.toml','rb'))
print(len(d['project']['dependencies']), 'runtime deps')"
grep -c '^name = ' uv.lock
head -20 pr_agent/git_providers/__init__.py

Before you start

Re-check the dependency list and the eager imports against current main first; both move.