stubber.utils.config

stubber configuration

Attributes

FALLBACK_VERSIONS

CONFIG

stubber configuration singleton

Classes

StubberConfig

Base class for all configuration objects

Functions

readconfig([location, filename, prefix, must_exist])

read the configuration from the pyproject.toml file

Module Contents

stubber.utils.config.FALLBACK_VERSIONS = ['1.17', '1.18', '1.19', '1.19.1', '1.20.0', '1.20.1', '1.21.0', '1.22.0', '1.22.1', '1.22.2',...
class stubber.utils.config.StubberConfig(section_name: str | None = None, sources: List[typedconfig.source.ConfigSource] | None = None, provider: typedconfig.provider.ConfigProvider | None = None)

Bases: typedconfig.config.Config

Base class for all configuration objects

Parameters:
  • section_name (Optional[str])

  • sources (Optional[List[typedconfig.source.ConfigSource]])

  • provider (Optional[typedconfig.provider.ConfigProvider])

_config_path = None

stubber configuration class

fallback_path: pathlib.Path = None

a Path to the fallback stubs directory

repo_path: pathlib.Path = None

a Path to the repo directory

mpy_path: pathlib.Path = None

a Path to the micropython folder in the repos directory

mpy_lib_path: pathlib.Path = None

a Path to the micropython-lib folder in the repos directory

mpy_stubs_path: pathlib.Path = None

a Path to the micropython-stubs folder in the repos directory (or current directory)

stable_version: str = None

last published stable

preview_version: str = None

current preview version

all_versions = None

list of recent versions

BLOCKED_PORTS = ['minimal', 'bare-arm']

ports that should be ignored as a source of stubs

property repos: List[pathlib.Path]

return the repo paths

Return type:

List[pathlib.Path]

property stub_path: pathlib.Path

return the stubs path in the microypthon-stubs repo

Return type:

pathlib.Path

property publish_path: pathlib.Path

return the stubs path in the microypthon-stubs repo

Return type:

pathlib.Path

property template_path: pathlib.Path

return the stubs path in the microypthon-stubs repo

Return type:

pathlib.Path

property config_path: pathlib.Path

return the config path

Return type:

pathlib.Path

post_read_hook() dict

This method can be overridden to modify config values after read() is called. :rtype: A dict of key-value pairs containing new configuration values for key() items in this Config class

Return type:

dict

stubber.utils.config.readconfig(location: pathlib.Path | None = None, filename: str = 'pyproject.toml', prefix: str = 'tool.', must_exist: bool = True)

read the configuration from the pyproject.toml file

Parameters:
stubber.utils.config.CONFIG

stubber configuration singleton