跳转到主要内容

伪Python包,用于测试https://github.com/jedie/cookiecutter_templates cookiecutter模板

项目描述

cookiecutter templates

tests codecov

所有模板都已通过unittest测试!

欢迎提交补丁!

Django项目

  • 使用pip-tools进行需求管理
    • 使用pip-compile冻结/固定需求与哈希值
    • 使用pip-sync安装所有必需的包
  • manage_django_project:
    • 通过调用manage.py自动虚拟环境启动
    • 开发管理命令
  • 使用pyproject.toml进行所有操作

Cookiecutter模板测试在此:managed-django-project/tests.py

与vanilla cookiecutter一起使用,例如。

cookiecutter https://github.com/jedie/cookiecutter_templates/ --directory managed-django-project

manageprojects一起使用,例如。

./cli.py start-project https://github.com/jedie/cookiecutter_templates/ --directory managed-django-project ~/foobar/

基于pipenv的Python包

  • 使用pipenv进行需求管理
  • 具有简单"帮助"菜单的Makefile
  • 使用pyproject.toml进行所有操作
  • 有基本的unittest

Cookiecutter模板测试在此:pipenv-python/tests.py

与vanilla cookiecutter一起使用,例如。

cookiecutter https://github.com/jedie/cookiecutter_templates/ --directory pipenv-python

manageprojects一起使用,例如。

./cli.py start-project https://github.com/jedie/cookiecutter_templates/ --directory pipenv-python ~/foobar/

基于pip-tools的Python包

  • 使用pip-tools进行需求管理
    • 使用pip-compile冻结/固定需求与哈希值
    • 使用pip-sync安装所有必需的包
  • click基于的CLI应用程序和开发模式
  • 只需调用cli.py / dev-cli.py即可自动虚拟环境启动
  • 使用pyproject.toml进行所有操作
  • 有基本的unittest

Cookiecutter模板测试在此:piptools-python/tests.py

与vanilla cookiecutter一起使用,例如。

cookiecutter https://github.com/jedie/cookiecutter_templates/ --directory piptools-python

manageprojects一起使用,例如。

./cli.py start-project https://github.com/jedie/cookiecutter_templates/ --directory piptools-python ~/foobar/

基于Poetry的可重用Django应用

  • 使用Poetry进行需求管理
  • 通过Makefile启动
  • 具有简单"帮助"菜单的Makefile
  • 使用pyproject.toml进行所有操作
  • 有基本的unittest

Cookiecutter模板测试在此:poetry-django-app/tests.py

与vanilla cookiecutter一起使用,例如。

cookiecutter https://github.com/jedie/cookiecutter_templates/ --directory poetry-django-app

manageprojects一起使用,例如。

./cli.py start-project https://github.com/jedie/cookiecutter_templates/ --directory poetry-django-app ~/foobar/

基于Python的诗歌包

  • 使用Poetry进行需求管理
  • 通过Makefile启动
  • 基于Typer的命令行界面(CLI)
  • 使用pyproject.toml进行所有操作
  • 有基本的unittest

Cookiecutter模板测试在此: poetry-python/tests.py

与vanilla cookiecutter一起使用,例如。

cookiecutter https://github.com/jedie/cookiecutter_templates/ --directory poetry-python

manageprojects一起使用,例如。

./cli.py start-project https://github.com/jedie/cookiecutter_templates/ --directory poetry-python ~/foobar/

基本的Django YunoHost应用程序

YunoHost是一个基于Debian的开源自托管解决方案。

此Cookiecutter模板有助于构建一个YunoHost应用程序,用于基于Django的Web应用程序

  • 包含所有YunoHost脚本,用于安装、备份、恢复等操作
  • 使用django_yunohost_integration
  • 使用pip-tools进行需求管理
  • 基于click的CLI
  • 通过调用dev-cli.py自动虚拟环境引导
  • 使用pyproject.toml进行所有操作
  • 项目单元测试与Django集成测试

Cookiecutter模板测试在此: yunohost_django_package/tests.py

与vanilla cookiecutter一起使用,例如。

cookiecutter https://github.com/jedie/cookiecutter_templates/ --directory yunohost_django_package

manageprojects一起使用,例如。

./cli.py start-project https://github.com/jedie/cookiecutter_templates/ --directory yunohost_django_package ~/foobar/

贡献

设置本地测试环境

~$ git clone https://github.com/jedie/cookiecutter_templates.git
~$ cd cookiecutter_templates
~/cookiecutter_templates$ ./cli.py --help

./cli.py --help的输出如下

Usage: ./cli.py [OPTIONS] COMMAND [ARGS]...

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮
│ --help      Show this message and exit.                                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────╮
│ fix-file-content     Unify cookiecutter variables in file content. e.g.: "{{foo}}" -> "{{ foo    │
│                      }}"                                                                         │
│ fix-filesystem       Unify cookiecutter variables in the file/directory paths. e.g.:             │
│                      "/{{foo}}/{{bar}}.txt" -> "/{{ foo }}/{{ bar }}.txt"                        │
│ reverse              Reverse a /generated_templates/<pkg_name>/ back to Cookiecutter template    │
│                      in: ./<pkg_name>/                                                           │
│ templates2generated  Generate all cookiecutter templates                                         │
│ update-template-req  Update requirements of all cookiecutter templates                           │
│ version              Print version and exit                                                      │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

运行测试,例如

~/cookiecutter_templates$ ./cli.py test

# or sub tests:
~/cookiecutter_templates$ ./cli.py test managetemplates/tests/test_piptools_python.py

# It's just a "python3 -m unittest" wrapper cli, see:
~/cookiecutter_templates$ ./cli.py test --help

链接

项目详情


下载文件

下载适合您平台的应用程序文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分发

managetemplates-0.3.0.tar.gz (958.2 kB 查看散列)

上传时间

构建分发

managetemplates-0.3.0-py3-none-any.whl (33.6 kB 查看散列)

上传时间 Python 3

由以下机构支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面