-
Couldn't load subscription status.
- Fork 8
Open
Labels
part:mkdocsAffects the configuration of mkdocsAffects the configuration of mkdocspart:only-apiAffects the configuration of a api repoAffects the configuration of a api repopart:protobufAffects the protobuf toolsAffects the protobuf toolstype:tech-debtImproves the project without visible changes for usersImproves the project without visible changes for users
Milestone
Description
What's needed?
Move all protobuf-related functionality into a single repository named frequenz-protobufutil-python that provides a small stdlib-only core (config + helpers) and optional extras for build and docs.
Proposed solution
Files to move
src/frequenz/repo/config/protobuf.py—ProtobufConfig(single source of truth for proto paths/globs/include_paths)src/frequenz/repo/config/setuptools/grpc_tools.py— the setuptools command to compile.proto→ Python (CompileProtoor equivalent)src/frequenz/repo/config/mkdocs/api_pages.py— the functions that generate protobuf API docs- Any helper modules used exclusively by the above (e.g., utils that touch proto compilation or doc generation).
Suggested new repository layout
frequenz.protobufutil(package)__init__.py(re-exportProtobufConfigat top-level)config.py(move/rename fromprotobuf.py)setuptools.pymkdocs.py
Packaging & extras
- Default/core: only stdlib; exposes
ProtobufConfigand tiny helpers. No heavyweight imports at module-import time. [setuptools]extra:grpcio-tools,mypy-protobuf,setuptools-related packages. Declares the setuptools entry point forCompileProto.[mkdocs]extra:mkdocs-gen-files,mkdocstrings(if needed); keep mkdocs imports lazy.
Entry points
- Provide a distutils/setuptools entry point only when
[setuptools]extra is installed. The package should register e.g.distutils.commandsor another suitable entry point that downstream projects can call. Keep heavy imports inside the command implementation so importing the package doesn't pull build deps.
Downstream usage examples
Build-time
Compilation of .proto files during build.
[build-system]
requires = [
"setuptools == ...",
"setuptools_scm[toml] == ...",
"frequenz-protobuf[setuptools] == ...",
]
build-backend = "setuptools.build_meta"Documentation generation
Add to docs/dev or docs extra:
[project.optional-dependencies]
mkdocs = [
"frequenz-protobuf[mkdocs] == ...",
]and in the mkdocs script:
from frequenz.protobufutils.mkdocs import generate_protobuf_api_pages
generate_protobuf_api_pages()Metadata
Metadata
Assignees
Labels
part:mkdocsAffects the configuration of mkdocsAffects the configuration of mkdocspart:only-apiAffects the configuration of a api repoAffects the configuration of a api repopart:protobufAffects the protobuf toolsAffects the protobuf toolstype:tech-debtImproves the project without visible changes for usersImproves the project without visible changes for users