Skip to content

Conversation

Copy link

Copilot AI commented Nov 30, 2025

For reviewers

  • I did not use AI
  • I used AI and thoroughly reviewed every code/docs change

Description of the change

Fixes package separation issues from the migration script. The three packages now have correct dependencies with 1:1 version matching using {{version}} interpolation:

  • griffelib: Library package with no CLI dependencies, includes the [pypi] extra for PyPI loading functionality
  • griffecli: CLI package depending on griffelib=={{version}}
  • griffe: Backward-compatible wrapper depending on both griffelib=={{version}} and griffecli=={{version}}, with [pypi] extra re-exporting griffelib[pypi]=={{version}}

Key fixes:

  • Removed incorrect griffecli imports from griffelib/__init__.py (library must not depend on CLI)
  • Added proper CLI exports to griffecli/__init__.py (main, check, dump, get_parser, DEFAULT_LOG_LEVEL)
  • Removed deprecated git functions from exports (assert_git_repo, get_latest_tag, get_repo_root, tmp_worktree)
  • Fixed logger name to remain "griffe" for backward compatibility
  • Updated all pyproject.toml files with uv-dynamic-versioning using double brackets {{version}} for version-locked dependencies
  • Updated root griffe [pypi] extra to re-export griffelib[pypi]=={{version}}
  • Updated ruff.toml paths for new package structure
  • Fixed test imports for new package locations
# All three import patterns now work correctly:
import griffe           # Backward-compatible, re-exports everything
import griffelib        # Library-only (216 exports)
import griffecli        # CLI-only (5 exports)

# Logger name preserved for existing configurations
import logging
logging.getLogger("griffe")  # Still works

# Public interface usage (recommended):
# griffe check ...
# python -m griffe ...

Relevant resources


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@johnslavik
Copy link
Member

johnslavik commented Nov 30, 2025

@copilot Remember that griffe is supposed to be a backward-compatible package depending on both griffelib and griffecli that match the version 1:1, with all the previous packaging and runtime behaviors in regular use as before the migration.

Copilot AI and others added 3 commits November 30, 2025 20:41
Co-authored-by: johnslavik <64036239+johnslavik@users.noreply.github.com>
Co-authored-by: johnslavik <64036239+johnslavik@users.noreply.github.com>
Co-authored-by: johnslavik <64036239+johnslavik@users.noreply.github.com>
Copilot AI changed the title [WIP] Reorganize as griffe and griffelib packages with uv workspaces change: Reorganize as griffe and griffelib packages with uv workspaces Nov 30, 2025
Copilot AI requested a review from johnslavik November 30, 2025 20:56
Co-authored-by: johnslavik <64036239+johnslavik@users.noreply.github.com>
Copy link
Author

Copilot AI commented Nov 30, 2025

@copilot Remember that griffe is supposed to be a backward-compatible package depending on both griffelib and griffecli that match the version 1:1, with all the previous packaging and runtime b...

Updated the root griffe package to use uv-dynamic-versioning with version-locked dependencies: griffelib=={version} and griffecli=={version}. This ensures all three packages always have 1:1 version matching. Commit af6489c adds this configuration. The griffe package now properly depends on exact versions of both sub-packages while maintaining full backward compatibility.

Copy link
Member

@johnslavik johnslavik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to promote public interface usage (griffe check, python -m griffe ...) instead of griffecli directly.

pyproject.toml Outdated
[tool.hatch.metadata.hooks.uv-dynamic-versioning.optional-dependencies]
# The 'pypi' extra provides dependencies needed for the load_pypi functionality
# to download and inspect packages from PyPI.
pypi = ["pip>=24.0", "platformdirs>=4.2", "wheel>=0.42"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this out to griffelib configuration and here do:

Suggested change
pypi = ["pip>=24.0", "platformdirs>=4.2", "wheel>=0.42"]
pypi = ["griffelib[pypi]=={{version}}"]

And use double brackets for version interpolation with uv dynamic versioning everywhere

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in commit 1ef3a63. Changed pypi optional dependency in root griffe to re-export griffelib[pypi]=={{version}} and updated all version interpolations to use double brackets {{version}}.

…[pypi]

Co-authored-by: johnslavik <64036239+johnslavik@users.noreply.github.com>
Copilot AI requested a review from johnslavik November 30, 2025 21:08
@johnslavik johnslavik marked this pull request as ready for review November 30, 2025 21:11
@johnslavik johnslavik merged commit a2e13bf into b/migrate Nov 30, 2025
1 check passed
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.

2 participants