prometa.package.python package
Submodules
prometa.package.python.codemeta module
CodeMeta functions.
- class prometa.package.python.codemeta.PyprojectCodeMeta(project)[source]
Bases:
CodeMeta
Update CodeMeta files from pyproject.toml files.
- modify_codemeta_data(codemeta_data)[source]
Modify the CodeMeta data. Override this method is a subclass to apply custom modifications.
- Parameters:
codemeta_data – The input CodeMeta data.
- Returns:
The possibly modified CodeMeta data.
- update(version=None, cwd=None, venv=None)[source]
Update the CodeMeta file.
- Parameters:
version – The version to set. This is sometimes necessary to force a version due to SCM incrementing the version for unclean directories.
cwd – The directory in which to run the codemeta command. If None, it will default to the parent directory of the target codemeta.json path.
venv – An instance of VirtualEnvironment with the context currently open. If None, a new instance will be created.
prometa.package.python.package module
Functionality for Python packages.
- class prometa.package.python.package.PythonPackage(*args, **kwargs)[source]
Bases:
Package
Functionality for Python packages.
- get_tool_configuration(tool)[source]
Attempt to get a tool’s configuration from the pyproject.tom file.
- Parameters:
tool – The name of the tool, e.g. “black” or “isort”.
- Returns:
The tool’s configuration if found, else None.
- get_version()[source]
Get the version of a project from its directory.
This will create a temporary virtual environment and install the project in it to get the version. This ensures that VCS-versions are correctly handled.
This should not be necessary but at the time or writing the current version of CodeMetaPy fails to detect versions.
- property links[source]
An iterable of name-URL pairs to create relevant package links in the README.
Module contents
Package stub.