Live data from Hacker News

Ask HN: Simple but modern Python dev set-up?

news.ycombinator.com

1–10 of 26 posts

Ask HN: Simple but modern Python dev set-up?

#1
Looking to do Django and Flask dev. I want something between using the system Python and a complex tool that manages many different versions.

I've heard good things about poetry, but what about actual Python? Is the homebrew (macOS) Python 3.x good enough?

Thanks!

Re: Ask HN: Simple but modern Python dev set-up?

#3
Has your current Python development setup failed you yet? Are Python versions preventing you from producing useful software? Are you looking to explore and experiment with setups, or is shipping useful software what counts?

"The Hitchhiker’s Guide to Python"[^1] does a tour of the tools that would be very useful. Virtual environments, testing, frameworks, etc.

[^1]: https://docs.python-guide.org/

Re: Ask HN: Simple but modern Python dev set-up?

#7
Any virtual environment will take precedence over either the system or homebrew Python. Since you want to deal with multiple versions (or Python? Or Django/Flask? Both?) you'll definitely be wanting some kind of isolated environment. It's nice to have Homebrew as a base since it'll be more recent than the system install, but it doesn't make a difference.

Miniconda/conda is pretty good. It's a lot more stable than it used to be. I use a plain old venv to run Django on a production server.

Poetry is good for packaging, I've not tried it as a virtual environment manager. It seems more fiddly to me than just running `conda create -n blah python=3.8; conda activate blah`. Sometimes I just want a system-wide "good" environment and Poetry's more suited to single folder/project configurations that you might eventually want to release as a standalone package (I may be wrong here). For easy publishing to PyPI though, Poetry is great.

Re: Ask HN: Simple but modern Python dev set-up?

#8
Start out with just pyenv. It's not complicated and helps a lot if you don't want system-wide updates to mess with your virtual environments (you don't). Even though pip may not be ideal, it works well enough. So far, more advanced alternatives for me created at least as many problems as they supposedly solved. See for yourself what issues you'll have (if any) and then pick the tools that solve them best. The editor/IDE is a personal thing. PyCharm is popular, but I never felt much chemistry with it. Currently enjoying VSCodium with the Python plugin. It will suggest to install some more packages for things like linting. Consider throwing in mypy. All that should get you pretty far. Better to start lean and build it out later, as needed.

Re: Ask HN: Simple but modern Python dev set-up?

#9
PyCharm, IPython and Jupyter make writing, testing and debugging Python tolerable. Packaging has always been a pain no matter what you use, but just try to avoid pipenv.

Homebrew or XCode updates seemed to nuke my virtualenvs on macOS, whereas I've been able to use the same virtualenvs on Linux for half of a decade.

Post reply on HN