Skip to content

Fix documentation version display#611

Merged
laughingman7743 merged 1 commit intomasterfrom
fix-docs-version-607
Oct 18, 2025
Merged

Fix documentation version display#611
laughingman7743 merged 1 commit intomasterfrom
fix-docs-version-607

Conversation

@laughingman7743
Copy link
Member

Summary

Fixes the documentation version display issue where the docs showed incorrect version strings like v0.1.dev1+gf45815e0 instead of the correct version.

Problem

The documentation was showing PyAthena v0.1.dev1+gf45815e0 because:

  1. GitHub Actions checkout was using shallow clone (no git history/tags)
  2. pyathena/_version.py was not being generated by hatch-vcs during docs build
  3. The version detection in docs/conf.py fell through to "unknown"

Solution

1. Fetch Full Git History

- name: Checkout
  uses: actions/checkout@v4
  with:
    fetch-depth: 0  # Fetch all history for version detection

2. Build Package Before Docs

- run: |
    uv sync --group dev
    uv build  # Generate _version.py with hatch-vcs
    make docs

This allows hatch-vcs to:

  • Read git tags (e.g., v3.18.0)
  • Calculate commits since tag (e.g., 7 commits)
  • Generate proper dev version: v3.18.1.dev7+g8bf8d8582.d20251018

3. Add Furo Theme Options

Added source repository configuration to docs/conf.py for better navigation.

Before vs After

Before: PyAthena v0.1.dev1+gf45815e0 documentation
After: PyAthena v3.18.1.dev7+g8bf8d8582.d20251018 documentation

Testing

Tested locally with:

uv build
make docs

The generated HTML shows the correct version in the title and sidebar.

Related Issues

Fixes #607

Notes

  • Version selector implementation will be addressed in a future PR (requires sphinx-multiversion)
  • The _version.py file is auto-generated during build and not tracked in git

🤖 Generated with Claude Code

- Add fetch-depth: 0 to docs workflow to fetch all git history and tags
- Add uv build step before make docs to generate _version.py with hatch-vcs
- Add Furo theme options for source repository links

This ensures the documentation shows the correct version (e.g., v3.18.1.dev7)
instead of incorrect version strings like v0.1.dev1.

Fixes #607

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@laughingman7743 laughingman7743 marked this pull request as ready for review October 18, 2025 04:43
@laughingman7743 laughingman7743 merged commit 0ddcd52 into master Oct 18, 2025
5 checks passed
@laughingman7743 laughingman7743 deleted the fix-docs-version-607 branch October 18, 2025 05:09
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.

The document version is incorrect

1 participant