项目生成器cookiecutter是第三方库,可通过以下方法安装
pip install cookiecutter #python环境
# For Mac
brew install cookiecutter
# For Debian/Ubuntu
sudo apt install cookiecutter
生产项目
cookiecutter https://github.com/audreyr/cookiecutter-pypackage.git
cookiecutter hg+ssh://hg@bitbucket.org/audreyr/cookiecutter-pypackage
若项目已经git clone下来,则直接执行:
cookiecutter cookiecutter-pypackage
查看项目结构:
tree -a trycookie
默认情况下,~/.cookiecutterrc就是配置文件。 它实际上是一个YAML文件
# vim: set filetype=yaml:
default_context:
full_name: "Yan QiDong"
email: "yanqd0@outlook.com"
github_username: "yanqd0"
cookiecutters_dir: "~/.cookiecutters/"
abbreviations:
pp: https://github.com/audreyr/cookiecutter-pypackage.git
gh: https://github.com/{0}.git
网友评论