Python 3.10+ language plugin for semver-dredd
Project description
python-3.10-dredd
Python 3.10+ language plugin for semver-dredd.
Installation
# Install via the core package extra
pip install "semver-dredd[python]"
# Or install the plugin distribution directly
pip install python-3.10-dredd
Or install from local path (development):
pip install ./plugins/python-3.10-dredd
Usage
Once installed, the plugin is automatically discovered by semver-dredd:
# List plugins to verify installation
semver-dredd plugin list
semver-dredd plugin info python
# Generate a snapshot for an importable module/package
semver-dredd snapshot --plugin python --path mypackage --version 1.0.0
# Use with init/status/bake commands
semver-dredd init mypackage --plugin python --version 1.0.0
semver-dredd status mypackage --plugin python
semver-dredd bake mypackage --plugin python
For the Python plugin, --path/positional source values are importable module
or package names (for example mypackage or mypackage.api), not filesystem
globs.
If .semver.yaml already records plugin: python and source.path, follow-up
commands can often omit the explicit path/plugin:
semver-dredd status --details
semver-dredd bake
How it works
This plugin uses Python's inspect module to introspect Python modules and extract:
- Public functions and their signatures
- Public classes, their methods, and fields
- Support for dataclasses, namedtuples, Pydantic models, and
__slots__
Scope: include / exclude
include and exclude items are module/package dotted names (not filesystem
globs), matched recursively (an item matches itself and any of its
dotted-prefix descendants):
include: [mypackage.api]
exclude: [mypackage.api.internal]
- Empty
include(or omitted) analyzes the whole configured module's API surface, exactly as without scope. - A non-empty
includeswitches to allow-list mode: only listed modules/submodules (and their descendants) are analyzed. excludeis applied afterinclude.- If the root module defines
__all__, scope recursion is skipped entirely — only the names listed in__all__are analyzed, matching plain Python visibility rules.include/excludedo not apply in this mode. - If
__all__is absent, the plugin recursively discovers public (non_-prefixed) submodules and merges their public members into the snapshot.includematching nothing produces an empty snapshot API (logged as a warning) rather than falling back to no-scope behavior.
Requirements
- Python 3.10+
- semver-dredd >= 1.0.20260704001
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_3_10_dredd-1.1.0.tar.gz.
File metadata
- Download URL: python_3_10_dredd-1.1.0.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6ea18c1e44a8579c888f17de0e09c1149e94736f421e7fcb92426cfd2d5643f
|
|
| MD5 |
163ea8fecf2209b43712db33b1ccac60
|
|
| BLAKE2b-256 |
9bd5166008a778dc6095b84ac646bbcbd574e6e2bed1c058a1d329a5d2b862e6
|
File details
Details for the file python_3_10_dredd-1.1.0-py3-none-any.whl.
File metadata
- Download URL: python_3_10_dredd-1.1.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89e3609933c8c94aeb92e5e4410b648a545fdfa3a733f7fd3932dc23ebc7b019
|
|
| MD5 |
dcf2fa42ed101bb0f1095284873c6856
|
|
| BLAKE2b-256 |
9a3a8b7b1d345cc186112801452b07de8a0b0d3667df4f1d3eb4e9bc39b551ef
|