module documentation

Helpers to build python projects.

The functions provided typically use external programs from the python ecosystem. If they are not installed, there will be errors like

[Errno 2] No such file or directory: 'foo' (ERROR)

for functions using external program foo.

Function doMypy Runs mypy
Function doRuffCheck Runs ruff check
Function doRuffFormat Runs ruff format
def doMypy(target: Path, mypyIni: Path, *filesAndDirs: Path):

Runs mypy

The function is intended to be used as the cmd parameter of a Target. The first dependency of the target must be a mypy configuration file. All other dependencies must be directory or file paths to be checked.

The target itself should be a Path which is used to record that the target was created. See pbutil.touch for why this is useful.

Parameters
target:Pathstamp file recording the fact when this function was actually invoked
mypyIni:Pathruff configuration file
*filesAndDirs:Pathto be checked by ruff
def doRuffCheck(target: Path, tomlFile: Path, *filesAndDirs: Path):

Runs ruff check

The function is intended to be used as the cmd parameter of a Target. The first dependency of the target must be a ruff configuration file. All other dependencies must be directory or file paths to be checked.

The target itself should be a Path which is used to record that the target was created. See pbutil.touch for why this is useful.

Parameters
target:Pathstamp file recording the fact when this function was actually invoked
tomlFile:Pathruff configuration file
*filesAndDirs:Pathto be checked by ruff
def doRuffFormat(target: Path, tomlFile: Path, *filesAndDirs: Path):

Runs ruff format

The function is intended to be used as the cmd parameter of a Target. The first dependency of the target must be a ruff configuration file. All other dependencies must be directory or file paths to be formatted.

The target itself should be a Path which is used to record that the target was created. See pbutil.touch for why this is useful.

NOTE: Use with care. If auto-formatting your code for the first time, be sure to commit any pending functional changes first to not mix them with mere formatting changes in one commit.
Parameters
target:Pathstamp file recording the fact when this function was actually invoked
tomlFile:Pathruff configuration file
*filesAndDirs:Pathto be formatted by ruff