Skip to content

Conversation

@johnslavik
Copy link
Member

@johnslavik johnslavik commented Nov 18, 2025

I've started with this incomplete migration script (make sure to not have a dirty env, I personally run git clean -dxfe migrate.py -e .venv -e .venvs -e uv.lock && git reset --hard main): https://gist.github.com/johnslavik/76d556a427033c4de2d236d67aa05b8f

Will carry out the remaining details manually.

Closes #408

@johnslavik
Copy link
Member Author

johnslavik commented Nov 18, 2025

Left to do next:

  • add pyproject.toml files to packages
  • set up workspaces (almost got them working)
  • set up dynamic versioning
  • get test suite to work

@pawamoy
Copy link
Member

pawamoy commented Nov 18, 2025

Looks like there's an issue with the script, seeing the filesystem tree:

packages/griffe
└── src
    └── griffe
        └── griffe
            ├── __init__.py
            ├── _internal
            ├── __main__.py
            └── py.typed

Should be

packages/griffe
└── src
    └── griffe
        ├── __init__.py
        ├── _internal
        ├── __main__.py
        └── py.typed

And

packages/griffelib
└── packages
    └── griffelib
        └── packages
            └── griffelib
                └── src
                    └── griffelib
                        └── griffelib
                            ├── __init__.py
                            ├── _internal
                            └── py.typed

Should be

packages/griffelib
└── src
    └── griffelib
        ├── __init__.py
        ├── _internal
        └── py.typed

@johnslavik
Copy link
Member Author

It's good now

@johnslavik
Copy link
Member Author

johnslavik commented Nov 21, 2025

Given how workspaces and packaging work, we'll do it a little different:

Put griffelib in the root (code under src/) and griffe in packages/griffe/.

@johnslavik
Copy link
Member Author

johnslavik commented Nov 21, 2025

New iteration:

  • packages/griffelib/src/griffelib that implements the lib
  • packages/griffe-cli/src/griffe_cli that implements cli and depends on griffelib
  • src/griffe that reexports * and __all__s from griffe_cli and griffelib and depends on griffe-cli and griffelib

Libraries that implement fancy things will do their stuff scoped to their directories.

In short:
3 packages

  • griffe -- remains our public API, depends on griffecli and griffelib, re-exports symbols (and packaging extras) from both griffecli and griffelib
  • griffecli -- implements the CLI only, depends on griffecli
  • griffelib -- implements the library only, depends on nothing

all three will be released with identical version numbers

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.

change: Split griffe to griffe and griffelib packages

3 participants