wads.populate

wads.populate.cd(newdir, verbose=True)[source]

Change your working directory, do stuff, and change back to the original

wads.populate.get_github_project_description(repo: str, default_factory=<function _mk_default_project_description>)[source]

Get project description from github repository, or default if not found

wads.populate.populate_pkg_dir(pkg_dir, version: str = '0.0.1', description: str = 'There is a bit of an air of mystery around this project...', root_url: str | None = None, author: str | None = None, license: str = 'mit', description_file: str = 'README.md', keywords: List | None = [], install_requires: List | None = [], long_description='file:README.md', long_description_content_type='text/markdown', include_pip_install_instruction_in_readme=True, verbose: bool = True, overwrite: List = (), defaults_from: str | None = None, skip_docsrc_gen=False, skip_ci_def_gen=False, version_control_system=None, ci_def_path=None, ci_tpl_path=None, project_type='lib', **configs)[source]

Populate project directory root with useful packaging files, if they’re missing.

>>> from wads.populate import populate_pkg_dir
>>> import os  
>>> name = 'wads'  
>>> pkg_dir = f'/D/Dropbox/dev/p3/proj/i/{name}'  
>>> populate_pkg_dir(pkg_dir,  
...                  description='Tools for packaging',
...                  root_url=f'https://github.com/i2mint',
...                  author='OtoSense')
Parameters:
  • pkg_dir (str, optional) – The relative or absolute path of the working directory. Defaults to ‘.’.

  • version – The desired version

  • description – Short description of project

  • root_url – Root url of the code repository (not the url of the project, but one level up that!)

  • author – Author of the package

  • license – License name for the package (should be recognized by pypi). Default is ‘mit’

  • description_file – File name containing a description of the project. Default is ‘README.md’

  • keywords – Keywords to include in pypi publication

  • install_requires – The (pip install) names of of the packages required to install the package we’re generating

  • long_description – Text of the long description. Default is “file:README.md” (takes contents of README.md)

  • long_description_content_type – How to parse the long_description. Default is “text/markdown”

  • verbose (bool, optional: Whether to print a lot of stuff as project is being populated.) – Set to True if you want to log extra information during the process. Defaults to False.

  • default_from – Name of field to look up in wads_configs to get defaults from, or ‘user_input’ to get it from user input.

  • skip_docsrc_gen – Skip the generation of documentation stuff

  • skip_ci_def_gen – Skip the generation of the CI stuff

  • version_control_system – ‘github’ or ‘gitlab’ (will TRY to be resolved from root url if not given)

  • ci_def_path – Path of the CI definition

  • ci_tpl_path – Pater of the template definition

  • configs – Extra configurations

Returns:

wads.populate.populate_proj_from_url(url, proj_rootdir=None, description=None, license='mit', **kwargs)[source]

git clone a repository and set the resulting folder up for packaging.

wads.populate.update_pack_and_setup_py(target_pkg_dir, copy_files=('setup.py', 'wads/data/MANIFEST.in'))[source]

Just copy over setup.py and pack.py (moving the original to be prefixed by ‘_’