Skip to main content

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 include switches to allow-list mode: only listed modules/submodules (and their descendants) are analyzed.
  • exclude is applied after include.
  • 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/exclude do 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. include matching 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_3_10_dredd-1.1.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_3_10_dredd-1.1.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

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

Hashes for python_3_10_dredd-1.1.0.tar.gz
Algorithm Hash digest
SHA256 a6ea18c1e44a8579c888f17de0e09c1149e94736f421e7fcb92426cfd2d5643f
MD5 163ea8fecf2209b43712db33b1ccac60
BLAKE2b-256 9bd5166008a778dc6095b84ac646bbcbd574e6e2bed1c058a1d329a5d2b862e6

See more details on using hashes here.

File details

Details for the file python_3_10_dredd-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python_3_10_dredd-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89e3609933c8c94aeb92e5e4410b648a545fdfa3a733f7fd3932dc23ebc7b019
MD5 dcf2fa42ed101bb0f1095284873c6856
BLAKE2b-256 9a3a8b7b1d345cc186112801452b07de8a0b0d3667df4f1d3eb4e9bc39b551ef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page