Show HN: Develop your Python applications easily in clean Docker environments
github.com
github.com
* venv is lighter and more or less fairly standardized
* `docker-compose` is more general and language agnostic
So something like `cage` is somewhere between...it's neat, no doubt, but not sure where I would use it personally.
You can indeed run all the commands easily just with Docker. Cage aims to port all the functionalities from virtualenv to use Docker. After this is achieved I can start working on extending those functionalities.
I am using virtualenv, but wondering what else I should be doing to make it easier. Previously I used cloud9 (cloud IDE) for rails development. In both cases, I am pretty much a hobbiest, but don't mind spending some money to make things easier since I'd rather spend my time doing the fun part, rather than developer ops.
At my previous company we used Vagrant for most projects, and it provided a nice abstraction layer that made things work reasonably well across all platforms (macOS, Windows, and Linux). Vagrant on Windows definitely had its challenges, though, but projects themselves ran well once that was sorted out.
I've heard the company has since moved to Docker, in search of those same benefits but with smaller overhead (specifically in terms of time spent managing the abstraction layer), and I gather the Windows folks are happier with it than they ever were with Vagrant.
My own (macOS-only) experience with both has been mixed, but certainly not worse than just running things locally via virtualenv. Vagrant introduces a full VM into the stack and Docker seems to have a lot of stability issues (at least on macOS 10.12 Sierra), so my next plan is to try combining the two, and running Docker on a Fedora VM. I'm hoping that any Docker nightmares will then at least be confined to the guest system, leaving my main machine mostly out of it, and using Docker to set up the actual project stuff may mean less Linux administration of the VM itself.
My experiences with docker range from disastrous to annoying; I try to just not use it. It's not installed on any of my systems. If I have to use it, I do that in a VM.
(I developed for some eight years on Windows, mostly C/C++, but last two years a lot of Python. At the time I wasn't aware of PyCharm, so Sublime Text "is also an editor" it was, but obviously just an editor; for development PyCharm is infinitely superior.)
I guess what I am asking is... what does everyone use for their DevOps stack (if that makes sense?)
Right now I am using:
CMD/bash
vitualenv
Sublime text
Ruby
Django
I haven't installed a database yet, but was going to use Postgres.
The way I understand Pycharm, I could use it to replace Sublime text and CMD/Bash right?
Obviously not infallible, but it catches time-wasters not infrequently.
There are "IDE guys" and "text editor guys". You can just determine who you are and be productive there!
Best text editors are sublime, vim, emacs; Best IDE is probably PyCharm.
It's much less of a choice when you code in Java for example: way better to use IDEs.
Also, being built on the IDEA platform PyCharm has superb support for language injections, eg. CSS in HTML in a template language is not a problem and handled correctly (highlighting, completion, annotation etc.).
Another advantage is that the IDEA IDEs are all very similar in general usage, so if one is also working with another IDEA IDE (for me that's mainly Java and CLion) then no time learning a whole different set of shortcuts or something like that is lost.
I couldn't replace a shell with an IDE, but they do have tasks and stuff like that, might be good enough.
Regarding database, when you're using the ORM it does matter far less for development; I almost always just use SQLite. Some projects do require advanced features of postgres, and would not work with SQLite. In those cases I just start a postgres instance ad-hoc.
Personally I find the various CLI tools typically found on a BSD or Linux rather enticing for development, but many people do without that.
Apart from that I'm not sure what you could mean / what your issues are. Specify?
If you find Windows some sort of hindrance, you can just use a Ubuntu VM, or reformat entirely to Ubuntu. I only use Ubuntu for over 2yrs now, and barely miss Windows, not much wrong with it though, esp. Windows10 w/ bash now.
I use PyCharm (love jetbrains) + Vagrant and it's working great so far. I'd highly recommend spending the time learning Vagrant - it can be incredibly frustrating at times (on both mac and windows), but once you get it working right it's really rewarding. Being able to re-instantiate a VM when something gets really botched is a great feeling. I don't have to worry about my host machine getting messed up, so I'm free to tinker around in the VM and that speeds up my learning.
The one downside I've encountered so far is how many different "terminal" style apps I need to run to get everything working. Currently I need powershell (as admin) for spinning up the VM, putty to SSH into it, and git bash for source control. I can probably simplify them all into powershell but for now it works.
For example, getting psycopg2 running under Cygwin was an odyssey, whereas it's trivial to install on Linux. And there are plenty of Python packages that assume you have gcc and unix headers installed, which makes chasing dependencies painful.
If the price tag is too high, or you're just doing personal projects, I'd recommend VMWare Player [2] -- it's a free version with slightly fewer features. Last time I used it I think it didn't have snapshots, which can be useful in some cases, but aren't a deal-breaker.
Having said that, a few colleagues used VirtualBox and found it to be OK; it seemed to stabilize a bit a year or two after I had problems with it (in 2015).
[1]: http://www.vmware.com/products/workstation.html [2]: http://www.vmware.com/products/player/playerpro-evaluation.h...
VirtualBox does have a nice feature that automates the installer, as well.
I've never bothered with the whole Vagrant thing for personal dev machines, given the low cost of spinning up a new machine, it's not worth learning a new toolchain for me. But if I was spending more than a few hours every couple years on building new VMs, it would be worth it.
The ultimate dream of the end user using a desktop comprising only of containers seems to be still a bit far off yet...
https://github.com/bschwind/api-starter-kit/blob/master/help...
What's funny is I don't currently use docker in production, but I love it for dev environments.
I work on Guix; it provides a 'guix environment' command, which is sort of a generic 'virtualenv', and IMO is a simple lightweight alternative: https://gnu.org/s/guix/manual/html_node/Invoking-guix-enviro... .
This would be a shortcut that bypasses the need for venvs entirely. I'm not sure I would use it, but that's the difference I see.
[0]: https://github.com/kennethreitz/autoenv [1]: https://github.com/dgholz/detect_virtualenv
It might be worth looking at pipfile.
Great project though!
Also, I don't personally see what's wrong with having a compiler on production systems. Granted, if you don't need it and want to reduce bloat but treating it as a security hole is misguided imho. If the actor can't run gcc, then the could still upload their pre-compiled version, otherwise how would they get the source on to compile in the first place. Just seems a pointless measure
But seriously. If there's demand it'll get there. I've been using py3.5 on freebsd, openbsd and Archlinux for months. If enough software is written using the new hotness like Async, there will be pressure and motivation to get it packaged into stable.
I hope.
For people on RHEL, the IUS repository[0] guys do a great job.
[0] https://ius.io/