moremoban / yehua

Make a project in 1 minute from a project template but keep updating it forever
http://yehua.readthedocs.io/
Other
22 stars 5 forks source link

Add cookiecutter support #37

Closed jayvdb closed 4 years ago

jayvdb commented 4 years ago

I think to increase the userbase it would be useful to implement cookiecutter support in yehua, even just detecting cookiecutter template and then importing and using cookiecutter library to get the job done.

There are soo many cookiecutter templates out there. Trying to complete against that is not helpful. If you cant beat them, join them ;-)

cookiecutter features can then be gradually re-implemented as native moban/yehua features.

chfw commented 4 years ago

With file system 2 interface, we can in theory create new project using a git repo url, which is a signature use case of cookie-cutter.

jayvdb commented 4 years ago

There are a lot of features of cookiecutter than yehua/moban doesnt support, including the prompts, etc.

Rather than try to build al those immediately, we can re-use cookiecutter's library in order to get compatibility in yehua immediately.

If you want to avoid that, we need to itemise all the features needed to make a typical cookiecutter template work, prioritise, and then (re)design and build them.

chfw commented 4 years ago

On the way to provide Cookiecutter support and what’s more: keep the update link via moban so that Cookiecutter template updates so does its offsprings.

chfw commented 4 years ago

here's the moban's ticket for supporting continuous updates: https://github.com/moremoban/moban/issues/85

chfw commented 4 years ago

In 2018, someone in Europython said the same to me: compatibility with Cookiecutter templates are important. It is not important which tool actually does it.

chfw commented 4 years ago

Here is the auto-generated yehua.yml, by parsing cookiecutter-pypackage:

configuration:
  static_path: '{{cookiecutter.project_slug}}'
  template_path: '{{cookiecutter.project_slug}}'
introduction: '

  Yehua will walk you through creating a blank python package.

  Press ^C to quit at any time.

  '
layout:
- tests
- docs
- <cookiecutter<cookiecutter.project_slug>cookiecutter>
- .github
questions:
- full_name: full_name
- email: email
- github_username: github_username
- project_name: project_name
- project_slug: project_slug
- project_short_description: project_short_description
- pypi_username: pypi_username
- version: version
- use_pytest: use_pytest
- use_pypi_deployment_with_travis: use_pypi_deployment_with_travis
- add_pyup_badge: add_pyup_badge
- command_line_interface: command_line_interface
- create_author_file: create_author_file
- open_source_license: open_source_license
templates:
- LICENSE: LICENSE
- CONTRIBUTING.rst: CONTRIBUTING.rst
- Makefile: Makefile
- tests/test_<cookiecutter<cookiecutter.project_slug>cookiecutter>.py: tests/test_{{cookiecutter.project_slug}}.py
- tests/__init__.py: tests/__init__.py
- MANIFEST.in: MANIFEST.in
- docs/index.rst: docs/index.rst
- docs/contributing.rst: docs/contributing.rst
- docs/Makefile: docs/Makefile
- docs/conf.py: docs/conf.py
- docs/usage.rst: docs/usage.rst
- docs/make.bat: docs/make.bat
- docs/history.rst: docs/history.rst
- docs/installation.rst: docs/installation.rst
- docs/authors.rst: docs/authors.rst
- docs/readme.rst: docs/readme.rst
- .editorconfig: .editorconfig
- setup.py: setup.py
- .gitignore: .gitignore
- HISTORY.rst: HISTORY.rst
- <cookiecutter<cookiecutter.project_slug>cookiecutter>/__init__.py: '{{cookiecutter.project_slug}}/__init__.py'
- <cookiecutter<cookiecutter.project_slug>cookiecutter>/cli.py: '{{cookiecutter.project_slug}}/cli.py'
- <cookiecutter<cookiecutter.project_slug>cookiecutter>/<cookiecutter<cookiecutter.project_slug>cookiecutter>.py: '{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}.py'
- .github/ISSUE_TEMPLATE.md: .github/ISSUE_TEMPLATE.md
- tox.ini: tox.ini
- AUTHORS.rst: AUTHORS.rst
- setup.cfg: setup.cfg
- README.rst: README.rst
- .travis.yml: .travis.yml
- requirements_dev.txt: requirements_dev.txt
chfw commented 4 years ago

it now works with a cloned cookiecutter-pypackage locally. next mile stone is to pass the git url directly and get it work.

chfw commented 4 years ago

remaining known issues: #45 . #46