Skip to content

Make non-core action deps optional via lazy imports#556

Merged
IanButterworth merged 6 commits intomasterfrom
ib/reduce_deps
Apr 11, 2026
Merged

Make non-core action deps optional via lazy imports#556
IanButterworth merged 6 commits intomasterfrom
ib/reduce_deps

Conversation

@IanButterworth
Copy link
Copy Markdown
Member

Move docker, requests, pexpect, python-gnupg, Flask, werkzeug, pylev, click, and pyyaml to optional extras in pyproject.toml. The core action now only requires PyGithub, Jinja2, semver, and toml.

In repo.py, convert top-level imports of docker, requests, pexpect, and gnupg to lazy imports at their call sites so the action runs without them installed. This reduces the mandatory dependency footprint for the GitHub Action while preserving full functionality when extras are installed (e.g. in Docker builds via --extras all).

Move docker, requests, pexpect, python-gnupg, Flask, werkzeug, pylev,
click, and pyyaml to optional extras in pyproject.toml. The core action
now only requires PyGithub, Jinja2, semver, and toml.

In repo.py, convert top-level imports of docker, requests, pexpect, and
gnupg to lazy imports at their call sites so the action runs without
them installed. This reduces the mandatory dependency footprint for the
GitHub Action while preserving full functionality when extras are
installed (e.g. in Docker builds via --extras all).
GPG is now imported locally inside configure_gpg(), so patch
gnupg.GPG directly instead of tagbot.action.repo.GPG.
DEVGUIDE.md and README.md now reflect that non-core deps are
optional and require --all-extras / .[all] to install.
@IanButterworth IanButterworth merged commit baf199e into master Apr 11, 2026
2 checks passed
@IanButterworth IanButterworth deleted the ib/reduce_deps branch April 11, 2026 02:38
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.

1 participant