aio-libs / create-aio-app

The boilerplate for aiohttp. Quick setup for your asynchronous web service.
https://create-aio-app.readthedocs.io/
MIT License
308 stars 89 forks source link

Questioning architectural decisions wrt skeleton generator #5

Closed webknjaz closed 6 years ago

webknjaz commented 6 years ago

Hi,

Why have own CLI, when cookiecutter does exactly the same?

I see why you make a dir structure template, but why reinvent the wheel with a renderer?

I suggest using a mainstream thing because otherwise, you end up maintaining yet another template rendering CLI instead of actual useful content (project boilerplate template).

cc @Arfey @jettify @asvetlov

jettify commented 6 years ago

From a user perspective, I do not care about, how we template project, I care about the result. There is very little code that does template anyway, easy to read.

So if you have a strong opinion there I guess you can team up with @Arfey and port to cookiecutter. For me project does what I need...

asvetlov commented 6 years ago

I have no strong opinion too. If cookie-cutter simplifies maintenance -- let's consider to use it. If no -- let's keep everything as is.

webknjaz commented 6 years ago

Cookiecutter: 1) Simplifies maintenance 2) Is possibly already installed on machines of ppl who are already used to be starting with project templates 3) Has testing hooks ecosystem for templates 4) Is a de-facto standard

asvetlov commented 6 years ago

@Arfey is the project maintainer. I think he should decide. My hope is not to touch this repo at all ;)

Arfey commented 6 years ago

@webknjaz I needed flexibility, and own cli are the best thing when u don't know what you want to get 😊 Now, i need:

if cookiecutter doesn't have problem with second, i agree that will be better rewrite to cookiecutter.

webknjaz commented 6 years ago

Yes, there's conditionals available in cookiecutter + you can define hooks. For tests I think the plugin is called pytest-cookies (I can look that up in some of my projects if needed).

jettify commented 6 years ago

I like having pip install create-aio-app is such mode supported by cookiecutter?

webknjaz commented 6 years ago

@Arfey https://github.com/audreyr/cookiecutter/issues/723

webknjaz commented 6 years ago

@jettify it would be pip install cookiecutter and then cookiecutter install <this repo>

webknjaz commented 6 years ago

I guess you could wrap that into a package, but I don't see a point.

asvetlov commented 6 years ago

cookiecutter could be used as a library I guess to keep create-aio-app as an executable script

webknjaz commented 6 years ago

It would be odd though. Your script would be

alias create-aio-app='cookiecutter this-repo'
asvetlov commented 6 years ago

pip install <shell alias>? 8-)

Arfey commented 6 years ago

We can create cookiecutter package and for scripts use same as below

from cookiecutter.main import cookiecutter

cookiecutter('cookiecutter-pypackage/create-aio-app')

and handle params for configuring of cookiecutter