Skip to content

Cleanup: post-merge follow-ups from PR #87 (upstream v0.13.0 sync) #88

Description

@satwareAG-ironMike

Follow-up cleanup items spotted during review of #87 (merge 5ddf6a3, upstream v0.13.0 sync). Both are non-blocking; filing as one issue since they are tiny and share the same origin.

1. _require_https should reuse the hostname local

File: src/specify_cli/commands/bundle/__init__.py:829

After the ValueError guard was added, the final host-check re-accesses parsed.hostname instead of reusing the hostname local captured in the try block:

try:
    parsed = urlparse(url)
    hostname = parsed.hostname
except ValueError:
    raise BundlerError(...) from None
is_localhost = hostname in ("localhost", "127.0.0.1", "::1")
...
if not parsed.hostname:                       # <- should be `not hostname`
    raise BundlerError(f"Refusing to download {label} from URL with no host: {url}")

Not a bug (ParseResult is immutable for a given URL, so a successful first access won't raise on re-access), but inconsistent with the sibling fix in src/specify_cli/presets/__init__.py:2093, which uses the hostname local consistently. Mirror that pattern here to prevent drift in future refactors.

Fix: one-line change - if not parsed.hostname: -> if not hostname:.

2. Markdown blank lines in new extensions section

File: docs/reference/extensions.md

The new "Project Extension and Hook Configuration" section runs paragraphs directly into closing code fences and table rows:

  • Line 180-181: closing ``` immediately followed by paragraph text
  • Line 227-228: closing table row immediately followed by paragraph text

Most renderers tolerate this, but CommonMark may treat the run-together text as a block continuation in some cases. Add a blank line in both spots.

Acceptance

  • src/specify_cli/commands/bundle/__init__.py:829 uses hostname local
  • docs/reference/extensions.md has blank lines after the closing fence (line 180) and after the hook-fields table (line 227)
  • Existing bundle tests still pass: uv sync --extra test && .venv/bin/python -m pytest tests/commands/bundle/ tests/test_workflows.py -q

Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions