parse_base_url and parse_repo_name accept SCP-style URLs for any host: the bitbucket.org-only ValueError is removed, SCP-style format validation (colon required, no scheme) retained, Bitbucket behavior unchanged. parse_repo_name's stale copy-pasted docstring corrected. Additionally parse_base_url now returns str as annotated (was Path), eliminating the mypy return-value error. 10 unit tests cover Bitbucket-, Forgejo- and GitHub-shaped URLs, .git suffix handling, str return type, and both rejection cases; 106/106 pass via tox -e unit-py313 with vcs/git.py down to 4 pre-existing baseline mypy errors.
parse_base_url and parse_repo_name hard-rejected any host other
than bitbucket.org — a leftover from when bootstrapping required
the Bitbucket API. With the Forgejo saas wrapper (#18) in place,
downstream consumers feed Forgejo-shaped URLs through these
helpers. Drop the host check; SCP-style format validation stays.
Also corrects parse_repo_name's docstring, which was a stale
copy of parse_base_url's.
parse_base_url and parse_repo_name accept SCP-style URLs for any host (e.g. git@git.code.tiararodney.com:h5p-mirror/foo.git) instead of rejecting everything but bitbucket.org. Non-SCP-style URLs (scheme://, missing colon) are still rejected with ValueError. Behavior for bitbucket.org URLs is unchanged. Unit tests cover Bitbucket- and Forgejo-shaped URLs plus the rejection cases, and pass via tox with no new mypy errors beyond the repo baseline.
byteb4rb1e.utils.saas.forgejo delivered as a thin layer over byteb4rb1e.utils.http.client, mirroring the Bitbucket wrapper against the Forgejo REST API v1: token auth headers, repository existence check, repository creation under the authenticated user (/user/repos) or an organization (/orgs/{org}/repos). No instance URL hardcoded — every operation takes a host parameter via api_url(). Both ssh_clone_url and https_clone_url exposed. 12 unit tests cover all operations; 95/95 pass via tox -e unit-py313 with no mypy errors beyond the repo baseline.
Mirrors the Bitbucket wrapper against the Forgejo REST API v1:
token auth headers, repository existence check, repository
creation under the authenticated user or an organization. No
instance URL is hardcoded — Forgejo is self-hosted, so every
operation takes a host parameter. Exposes both ssh_clone_url
and https_clone_url (HTTPS needed in CI without SSH host keys).
byteb4rb1e.utils.saas.forgejo exists as a thin layer over byteb4rb1e.utils.http.client, mirroring the Bitbucket wrapper's operations against the Forgejo REST API (api/v1): token auth headers, repository existence check, repository creation under the authenticated user or an organization. No instance URL is hardcoded: every operation takes a host parameter. Both SSH and HTTPS clone URL construction are exposed. Unit tests cover all operations and pass via tox; no new mypy errors beyond the repo baseline.
HttpSession (cookie persistence via http.cookiejar, GET with query params, form-encoded POST, default/per-request header merging, HTTPError-to-response conversion) and the HttpResponse frozen-dataclass refactor live on feature/20 as separate refactor and feat commits. 14 new unit tests covering HttpResponse semantics and HttpSession behavior pass via tox -e unit-py313; the test file adds no new mypy errors beyond the repo-wide baseline. develop working tree clean of http/client.py changes.
byteb4rb1e.utils.config (INI loading/writing, per-flag CLI integration, dotted-path --config KEY=VALUE overrides, help formatting) and byteb4rb1e.utils.argparse.actions.KeyValueAction with package export live on feature/19 in five granular commits (production code before tests, module boundaries separate). 46 unit tests pass via tox -e unit-py313. develop working tree clean of these files.
HTTP client that persists cookies across requests via
http.cookiejar, for sites requiring login followed by
cookie-authenticated fetches. Supports GET with query params,
form-encoded POST, default/per-request header merging, and
HTTPError-to-response conversion.
HttpSession and the HttpResponse frozen-dataclass refactor live on branch feature/20 as separate refactor and feat commits; unit tests covering HttpResponse and HttpSession (cookie persistence, header merging, params, form POST, HTTPError handling) added and passing via tox; develop working tree is clean of http/client.py changes.
byteb4rb1e.utils.config and byteb4rb1e.utils.argparse.actions.KeyValueAction (with package export) live on branch feature/19 with spec-compliant commit granularity (production code before tests, module boundaries separate); unit test suites for both pass via tox; develop working tree is clean of these files.
ID: 15
Type: bugfix
Title: modularize module containers
Status: open
Priority: high
Created: 2025-06-28
Description: Even though importlib can find submodules through traversing paths
instead of relying on __init__.py for every ancestor module, this
is not supported by some modules like sphinx.ext.autosummary