-
-
Notifications
You must be signed in to change notification settings - Fork 63
change: Reorganize as griffe and griffelib packages with uv workspaces
#434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
cc4c9c5 to
e9221d0
Compare
|
Let's try Copilot here |
|
@copilot We've migrated griffe to 3 packages exposed by Fix any instances of name errors (import griffe, but then griffelib is used, etc.), inconsistencies caused by the migration, and any references broken by the migration script. Make sure that the griffecli's init module is correct. Do complete whatever the migration script missed, making sure the migration is fully complete and backward-compatible. Update the documentation to reflect new changes, if necessary. Document all changes that you've made. |
|
@johnslavik I've opened a new pull request, #435, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@copilot Add missing configuration from pyproject.toml (check CI failures) and make sure that we promote the old way of running things ( |
|
@johnslavik I've opened a new pull request, #436, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@copilot Look at https://github.com/mkdocstrings/griffe/actions/runs/19806731977/job/56741990187?pr=434. Fix all incorrect refs |
|
@johnslavik I've opened a new pull request, #437, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: johnslavik <[email protected]>
Co-authored-by: johnslavik <[email protected]>
Co-authored-by: johnslavik <[email protected]>
Co-authored-by: johnslavik <[email protected]>
…[pypi] Co-authored-by: johnslavik <[email protected]>
Co-authored-by: johnslavik <[email protected]>
Co-authored-by: johnslavik <[email protected]>
| - [`griffecli.main`][]: Run the main program. | ||
| - [`griffecli.check`][]: Check for API breaking changes in two versions of the same package. | ||
| - [`griffecli.dump`][]: Load packages data and dump it as JSON. | ||
| - [`griffecli.get_parser`][]: Get the argument parser for the CLI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see a mix of cross-ref, some using griffe.*, some using griffecli.* or griffelib.*, we should make them consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes -- I'd opt for griffe where possible, as in #434 (comment)
| # Absolute file path probably means temporary worktree. | ||
| # We use our worktree prefix to remove some components | ||
| # of the path on the left (`/tmp/griffe-worktree-*/griffe_*/repo`). | ||
| # of the path on the left (`/tmp/griffelib-worktree-*/griffe_*/repo`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could keep these foders named "griffe" rather than "griffelib", as the distinction is not important in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup
| if _match_pattern(path.name, (*_editable_editables_patterns, *_editable_scikit_build_core_patterns)): | ||
| # Support for how 'editables' write these files: | ||
| # example line: `F.map_module('griffe', '/media/data/dev/griffe/src/griffe/__init__.py')`. | ||
| # example line: `F.map_module('griffelib', '/media/data/dev/griffelib/packages/griffelib/src/griffelib/__init__.py')`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine if we keep the previous version of these comments as they're just examples (and still valid I believe even after the migration).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
| with TemporaryDirectory(prefix=f"{_WORKTREE_PREFIX}{repo_name}-{normref}-") as tmp_dir: | ||
| location = os.path.join(tmp_dir, normref) # noqa: PTH118 | ||
| tmp_branch = f"griffe-{normref}" # Temporary branch name must not already exist. | ||
| tmp_branch = f"griffelib-{normref}" # Temporary branch name must not already exist. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could keep using griffe, see previous comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
| import platformdirs # noqa: PLC0415 | ||
|
|
||
| pypi_cache_dir = Path(platformdirs.user_cache_dir("griffe")) | ||
| pypi_cache_dir = Path(platformdirs.user_cache_dir("griffelib")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, we could keep using griffe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely
| data = python_handler.collect("griffe", options=python_handler.get_options({})) | ||
|
|
||
| with mkdocs_gen_files.open("griffe.json", "w") as fd: | ||
| with mkdocs_gen_files.open("griffelib.json", "w") as fd: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll have to update this somehow, to contain griffe, griffecli and griffelib.
| src = root / "src" | ||
| public_api = src / "griffe" | ||
| print(f"{'#' * heading_level} `griffe.__main__`\n") | ||
| print(f"{'#' * heading_level} `griffelib.__main__`\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably be griffe or griffecli rather than grifflib here.
Continuation of #431, based on #433, closes #408
Migration script: https://gist.github.com/johnslavik/76d556a427033c4de2d236d67aa05b8f