Skip to main content

Core functionPlug-In Foundation Service Collection)

Project description

Plug-In Foundation Services Collection

The Python Development Master offers various extension points.

You can either add plug-ins or signals. Some parts are not very intuitive for the experienced python developer who are used to work with python standard libraries like logging or is hard to test as there are some points that are not that easy to test.

This collection offers a set of services helping to write better plug-ins.

abstractions

This module provides three protocols, that will abstract PDM core and PDM project classes, so that they can easily mocked in unit tests.

actions

Actions are a collection of actions to run. This can be useful, if you want to add different verbal commands.

Each of this action can add options to the parser. They all can be registered in an ActionRegistry. This provides an instance method called register which can be used to decorate implementations of ActionBase.

config

The configuration section is unstable.

hook

Hooks surround actions by hooks - an action can provide an implementation of the HookGenerator protocol, that must emit instances of HookInfo, a dataclass that gives information about the HookBase class to instantiate and run before and after the action is executed itself.

logging

The logging module provides a logger based on the python standard logging facilities.

The TermUIHandler uses pdm.core.ui.echo to write data to a log. The TracingLogger is created to add a log-level called TRACE to the logging, which is later used by traced_function.

The default instance for the logging is added in the logger variable. It's default value can be set using setup_logger. The value passed is identical to the verbose level of the pdm invocation arguments.

The decorator traced_function can be used to decorate a function for tracing the sequence of events - just like set -x does in POSIX scripts.

proc

The CliRunnerMixin allows you to run child-processes from your plug-in or signal. It offers a class-var called run_process, that has the same signature like subprocess.run from the python standard library, but can be overwritten for your tests.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pdm_pfsc-0.11.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file pdm_pfsc-0.11.0-py3-none-any.whl.

File metadata

  • Download URL: pdm_pfsc-0.11.0-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for pdm_pfsc-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4766ee5ff6d5c212e2be2434c2c8d0112e0080fa6ea6303485a676ac88364562
MD5 f8c9642fecbc1819b39e36221a5962e3
BLAKE2b-256 d8c0ba544042f78f24a8c98f91b1af8c496ec0c22565d4cf26bdb21e9ae9a0c3

See more details on using hashes here.

Supported by

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