6 ms·
When I'm just learning a new programming language or framework, I prefer to have something like create-react-app [0], django-admin startproject [1], cargo new [
by zomglings 7y ago
When I'm just learning a new programming language or framework, I prefer to have something like create-react-app [0], django-admin startproject [1], cargo new [2], or lein new [3].
Guides like these are just full of (the wrong type of) rabbit holes. Just give new people something that lets them work productively as soon as possible and refer them to language documentation to understand how features of the language or the runtime work - in case they want to dig deeper.
Most people will not want to dig deeper, anyway. They will be happier to just have boilerplate that works and that they can iterate upon.
Look at the golang version of this guide: https://github.com/golang-standards/project-layout https://github.com/golang-standards/project-layout
How many programmers new to go are going to want to wade through all of that? Especially when they're probably starting out with projects for which most of those conventions don't even apply!
It's surprising to me that Python, as focused as its philosophy is on providing canonical solutions to problems, doesn't have a "python -m newproject". There must be a good reason. Will try making one in my free time to find out.
[0] https://github.com/facebook/create-react-app https://github.com/facebook/create-react-app
[1] https://docs.djangoproject.com/en/2.2/ref/django-admin/#startproject https://docs.djangoproject.com/en/2.2/ref/django-admin/#star...
[2] https://doc.rust-lang.org/cargo/guide/creating-a-new-project.html https://doc.rust-lang.org/cargo/guide/creating-a-new-project...
[3] https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#creating-a-project https://github.com/technomancy/leiningen/blob/master/doc/TUT...
- Datenstrom 7y ago`poetry new`[0] is what you are looking for, previously I have used pyscaffold[1] but I like the pyproject.toml from PEP 518[2] better than all the old stuff. Unfortunately poetry does not set up docs like pyscaffold does though. [0]: https://poetry.eustace.io/ https://poetry.eustace.io/ [1]: https://pyscaffold.org/en/latest/ https://pyscaffold.org/en/latest/ [2]: https://www.python.org/dev/peps/pep-0518/ https://www.python.org/dev/peps/pep-0518/
- zomglings 7y agoNice, thank you! Will definitely check out poetry now - have been avoiding it for reasons of inertia so far. :)
- j88439h84 7y agopoetry new --src projectname is my preference these days.
- theHamsta 7y agoPsyscaffold has a --pyproject option (or at least an add-on linked in the readme, don't remember)
- ptx 7y agoI never tried Poetry because of this somewhat worrying part of installation instructions: "The installer installs the poetry tool to Poetry's bin directory ... located at $HOME/.poetry/bin ...This directory will be in your $PATH environment variable". The directory will be in my PATH? That makes me wonder what else it might take the liberty to reconfigure on my system. But, reading the installer script, it seems like it at least prompts you for confirmation first, so perhaps I'll try it.
- JulianWasTaken 7y agoGiven Python's history, there are just too many "one way"s to do things. The space of packaging has changed hugely in the last 5 years, and probably will again in the next 5 (both in good ways). Maybe then we get a standard templater. Though sure, if poetry is your thing, it does this. (Me, FWIW, given that I still generally stick to setuptools for better or worse, I have my own templater that I use [0]) [0] https://github.com/Julian/mkpkg https://github.com/Julian/mkpkg
- lifeisstillgood 7y agoTooting my own horn try: https://github.com/mikadosoftware/mkrepo https://github.com/mikadosoftware/mkrepo mkrepo reponame . will get a fairly decent skeleton created (been using a lot for my own stuff recently)
- dragonwriter 7y ago> It's surprising to me that Python, as focused as its philosophy is on providing canonical solutions to problems, doesn't have a "python -m newproject". There must be a good reason. The reason is probably related to the perennial python packaging problem; many of the projects offering solutions to that problem have their own project generator bundled.