Applications (CLI)

micc

Micc command line interface.

All commands that change the state of the project produce some output that is send to the console (taking verbosity into account). It is also sent to a logfile et_micc.log in the project directory. All output is always appended to the logfile. If you think the file has gotten too big, or you are no more interested in the history of your project, you can specify the --clear-log flag to clear the logfile before any command is executed. In this way the command you execute is logged to an empty logfile.

See below for (sub)commands.

micc [OPTIONS] COMMAND [ARGS]...

Options

-v, --verbosity

The verbosity of the program output.

-p, --project-path <project_path>

The path to the project directory. The default is the current working directory.

--clear-log

If specified clears the project’s et_micc.log file.

--version

Show the version and exit.

add

Add a module or CLI to the projcect.

param str name:name of the CLI or module added.

If app==True: (add CLI application)

  • app_name is also the name of the executable when the package is installed.
  • The source code of the app resides in <project_name>/<package_name>/cli_<name>.py.

If py==True: (add Python module)

  • Python source in <name>.py*`or :file:`<name>/__init__.py, depending on the package flag.

If f90==True: (add f90 module)

  • Fortran source in f90_<name>/<name>.f90 for f90 binary extension modules.

If cpp==True: (add cpp module)

  • C++ source in cpp_<name>/<name>.cpp for cpp binary extension modules.
micc add [OPTIONS] NAME

Options

--app

Add a CLI .

--group

Add a CLI with a group of sub-commands rather than a single command CLI.

--py

Add a Python module.

--package

Add a Python module with a package structure rather than a module structure:

  • module structure = <module_name>.py
  • package structure = <module_name>/__init__.py

Default = module structure.

--f90

Add a f90 binary extionsion module (Fortran).

--cpp

Add a cpp binary extionsion module (C++).

-T, --templates <templates>

Ordered list of Cookiecutter templates, or a single Cookiecutter template.

--overwrite

Overwrite pre-existing files (without backup).

--backup

Make backup files (.bak) before overwriting any pre-existing files.

Arguments

NAME

Required argument

convert-to-package

Convert a Python module project to a package.

A Python module project has only a <package_name>.py file, whereas a Python package project has <package_name>/__init__.py and can contain submodules, such as Python modules, packages and applications, as well as binary extension modules.

This command also expands the package-general-docs template in this project, which adds a AUTHORS.rst, HISTORY.rst and installation.rst to the documentation structure.

micc convert-to-package [OPTIONS]

Options

--overwrite

Overwrite pre-existing files (without backup).

--backup

Make backup files (.bak) before overwriting any pre-existing files.

create

Create a new project skeleton.

The project name is taken to be the last directory of the project_path. If this directory does not yet exist, it is created. If it does exist already, it must be empty.

The package name is the derived from the project name, taking the PEP8 module naming rules into account:

  • all lowercase.
  • dashes '-' and spaces ' ' replaced with underscores '_'.
  • in case the project name has a leading number, an underscore is prepended '_'.

If project_path is a subdirectory of a micc project, micc refuses to continu, unless --allow-nesting is soecified.

micc create [OPTIONS] [NAME]

Options

--publish

If specified, verifies that the package name is available on PyPI. If the result is False or inconclusive the project is NOT created.

-p, --package

Create a Python project with a package structure rather than a module structure:

  • package structure = <module_name>/__init__.py
  • module structure = <module_name>.py
--micc-file <micc_file>

The file containing the descriptions of the template parameters usedin the Cookiecutter templates.

--python <python>

minimal python version for your project.

-d, --description <description>

Short description of your project.

-l, --lic <lic>

License identifier.

-T, --template <template>

Ordered list of Cookiecutter templates, or a single Cookiecutter template.

-n, --allow-nesting

If specified allows to nest a project inside another project.

--module-name <module_name>

use this name for the module, rather than deriving it from the project name.

Arguments

NAME

Optional argument

info

Show project info.

  • file location
  • name
  • version number
  • structure (with -v)
  • contents (with -vv)

Use verbosity to produce more detailed info.

micc info [OPTIONS]

Options

--name

print the project name.

--version

print the project version.

mv

Rename or remove a component, i.e an app (CLI) or a submodule.

param cur_name:name of component to be removed or renamed.
param new_name:new name of the component. If empty, the component will be removed.
micc mv [OPTIONS] CUR_NAME [NEW_NAME]

Options

--silent

Do not ask for confirmation on deleting a component.

--entire-package

Replace all occurences of <cur_name> in the entire package and in the tests directory.

--entire-project

Replace all occurences of <cur_name> in the entire project.

Arguments

CUR_NAME

Required argument

NEW_NAME

Optional argument

tag

Create a git tag for the current version and push it to the remote repo.

micc tag [OPTIONS]

version

Modify or show the project’s version number.

micc version [OPTIONS]

Options

-M, --major

Increment the major version number component and set minor and patch components to 0.

-m, --minor

Increment the minor version number component and set minor and patch component to 0.

-p, --patch

Increment the patch version number component.

-r, --rule <rule>

Any semver 2.0 version string.

-t, --tag

Create a git tag for the new version, and push it to the remote repo.

-s, --short

Print the version on stdout.

-d, --dry-run

bumpversion –dry-run.