Skip to content
Snippets Groups Projects
Commit 7524d281 authored by Philip Elson's avatar Philip Elson :snake:
Browse files

Merge branch 'stubgen-docs' into 'master'

document stubgen functionality in readme

See merge request !73
parents 3e4b71cb 759c9b84
No related branches found
No related tags found
1 merge request!73document stubgen functionality in readme
Pipeline #2548498 failed
......@@ -92,6 +92,29 @@ shell command:
$ python -m cmmnbuild_dep_manager resolve
```
### Stub generation
The extra package `cmmnbuild_dep_manager[stubgen]` provides support for generating python type stubs (`pyi` files per PEP-484) from Java packages using [stubgenj].
Python packages registered in `cmmnbuild_dep_manager` can set the variable `__stubgen_packages__` in their `__init__.py` file. The value must contain a list of java packages to generate stubs for, as strings. Any sub-packages are automatically included, e.g.
```python
__stubgen_packages__ = [
"java",
"cern.lsa",
"cern.accsoft.commons"
]
```
would instruct `cmmnbuild_dep_manager` to generate stubs for the Java packages `java`, `cern.lsa` and `cern.accsoft.commons`, including all of their sub-packages.
The actual stub (re-)generation is triggered via the command line interface:
```bash
$ python -m cmmnbuild_dep_manager stubgen
```
By default stubs are placed where `cmmnbuild_dep_manager` is installed (e.g. in the active venv).
[stubgenj]: https://gitlab.cern.ch/scripting-tools/stubgenj
### Jar inspection helper functions
Helper functions are provided to inspect the classes in the downloaded jars.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment