prometa.codemeta package

Submodules

prometa.codemeta.codemeta module

CodeMeta functions.

class prometa.codemeta.codemeta.CodeMeta(project)[source]

Bases: object

Read and update CodeMeta files.

__init__(project)[source]
Parameters:

project – The project object.

property data[source]

The CodeMeta data.

load()[source]

Load the data from the CodeMeta file.

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.

property name[source]

The project name.

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.

update_file()[source]

Update the CodeMeta file with the currently loaded data. If the file already exists, a temporary file will be created and the merge tool will be used to update the existing file.

exception prometa.codemeta.codemeta.CodeMetaError[source]

Bases: PrometaException

Custom exception raised when working with CodeMeta files.

prometa.codemeta.pyproject module

CodeMeta functions.

class prometa.codemeta.pyproject.PyprojectCodeMeta(*args, **kwargs)[source]

Bases: CodeMeta

Update CodeMeta files from pyproject.toml files.

__init__(*args, **kwargs)[source]
Parameters:

project – The project object.

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.

Module contents

Package stub.