Architecture Tools for Constructing Projects

notice

  • In sphinx setting, the default setting in sphinx-quickstart would be
> Separate source and build directories (y/n) [n]

Thus, default directory to the built files is _build. If the y is chosen, the directory to the built files is build.

entrance

longling.Architecture.cli.main.cli(skip_top=True, project=None, override=None, tar_dir='./', **kwargs)[源代码]

The main function for arch

components

longling.Architecture.install_file.template_copy(src: (<class 'str'>, <class 'pathlib.PurePath'>), tar: (<class 'str'>, <class 'pathlib.PurePath'>), default_value: (<class 'str'>, <class 'dict'>, None) = '', quotation="'", key_lower=True, **variables)[源代码]

Generate the tar file based on the template file where the variables will be replaced. Usually, the variable is specified like $PROJECT in the template file.

参数:
  • src (template file) --
  • tar (target location) --
  • default_value (the default value) --
  • quotation (the quotation to wrap the variable value) --
  • variables (the real variable values which are used to replace the variable in template file) --
longling.Architecture.install_file.gitignore(atype: str = '', tar_dir: (<class 'str'>, <class 'pathlib.PurePath'>) = './')[源代码]

cli alias: arch gitignore

参数:
  • atype (the gitignore type, currently support docs and python) --
  • tar_dir (target directory) --
longling.Architecture.install_file.pytest(tar_dir: (<class 'str'>, <class 'pathlib.PurePath'>) = './')[源代码]

cli alias: arch pytest

参数:tar_dir --
longling.Architecture.install_file.coverage(tar_dir: (<class 'str'>, <class 'pathlib.PurePath'>) = './', **variables)[源代码]

cli alias: arch coverage

参数:
  • tar_dir --
  • variables --

    These variables should be provided:

    • project
longling.Architecture.install_file.pysetup(tar_dir='./', **variables)[源代码]

cli alias: arch pysetup

参数:
  • tar_dir --
  • variables --
longling.Architecture.install_file.sphinx_conf(tar_dir='./', **variables)[源代码]

cli alias: arch sphinx_conf

参数:
  • tar_dir --
  • variables --
longling.Architecture.install_file.makefile(tar_dir='./', **variables)[源代码]

cli alias: arch makefile

参数:
  • tar_dir --
  • variables --
longling.Architecture.install_file.readthedocs(tar_dir='./')[源代码]

cli alias: arch readthedocs

参数:tar_dir --
longling.Architecture.install_file.travis(tar_dir: (<class 'str'>, <class 'pathlib.PurePath'>) = './')[源代码]

cli alias: arch travis

参数:tar_dir --
longling.Architecture.install_file.nni(tar_dir='./')[源代码]

cli alias: arch nni and install nni

参数:tar_dir --
longling.Architecture.install_file.dockerfile(atype, tar_dir='./', **variables)[源代码]

cli alias: arch dockerfile

参数:
  • atype --
  • tar_dir --
  • variables --
longling.Architecture.install_file.gitlab_ci(private, stages: dict, atype: str = '', tar_dir: (<class 'str'>, <class 'pathlib.PurePath'>) = './', version_in_path=True)[源代码]

cli alias: arch gitlab_ci

参数:
  • private --
  • stages --
  • atype --
  • tar_dir --
  • version_in_path --
longling.Architecture.install_file.chart(tar_dir: (<class 'str'>, <class 'pathlib.PurePath'>) = './')[源代码]

cli alias: arch chart

参数:tar_dir (target directory) --
longling.Architecture.utils.legal_input(__promt: str, __legal_input: set = None, __illegal_input: set = None, is_legal=None, __default_value: str = None)[源代码]

To make sure the input legal, if the input is illegal, the user will be asked to retype the input.

Input being illegal means the input either not in __legal_input or in __illegal_input.

For the case that user do not type in anything, if the __default_value is set, the __default_value will be used. Else, the input will be treated as illegal.

参数:
  • __promt (str) -- tips to be displayed
  • __legal_input (set) -- the input should be in the __legal_input set
  • __illegal_input (set) -- the input should be not in the __illegal_input set
  • is_legal (function) -- the function used to judge whether the input is legal, by default, we use the inner __is_legal function
  • __default_value (str) -- default value when user type in nothing