Live data from Hacker News

My Python Development Environment, 2018 Edition

jacobian.org

131–140 of 224 posts

Re: My Python Development Environment, 2018 Edition

#131
post #113

I'm a big fan of using Docker because for real world web app development, your app is often more than just getting Python and a virtualenv set up. Earlier this week I wrote about the pains of setting up a Python development experience without Docker, and then compared it to Docker as well. If anyone is curious, that's located at https://nickjanetakis.com/blog/setting-up-a-python-developme... . By the way, I would say…

My problem with using Docker (only) is that it doesn't translate well to editors. Like, using jedi-vim[1] with a virtualenv constructed by a Docker container doesn't work at all. Unless I actually run vim itself inside said container.

So unless your dependences build on macOS (like in my case), everything goes out the door.

[1] https://github.com/davidhalter/jedi-vim

Re: My Python Development Environment, 2018 Edition

#132

Earlier quoted context omitted.

> ... and also makes it much easier to install packages based on C/C++ libraries I hear this often, though I cannot remember ever running into a pip package where this was an issue. Out of curiosity, could someone point me to a pip package and its conda equivalent where this is the case?

Install scipy on Windows and include the Intel linear matrix libraries.

The numpy+mkl wheel is available on Gohlke's site.

Re: My Python Development Environment, 2018 Edition

#133
post #52
post #30

Earlier quoted context omitted.

How does it compare to PyCharm?

It's on par, as long as you don't do too many refactors on nasty codebases. Now, PyCharm chokes on those nasty refactors too, guessing the right stuff only 70% the stuff in a way that sometimes feels purely random, but at least its find and refactor preview UIs save the day sort of... One thing that annoys me on VSC is that some operations (jump to defnition etc.) have delays on larger projects, because it does not c…

just for curiosity, how you type an equivalent of a ts union?

Re: My Python Development Environment, 2018 Edition

#134

>Why? pipenv handles dependency- and virtual-environment-management in a way that’s very intuitive (to me), and fits perfectly with my desired workflow. Why specifically do you use it instead of virtualenv (+virtualenvwrapper)?

Pipenv combines package management and virtualenv managment in one tool. You can create a new project as simple as this:

    $ mkdir myproj
    $ cd myproj
    $ pipenv --python 3.6         # This creates a virtualenv with Python 3.6 for you project.
    $ pipenv install flask        # This installs flask in your virtualenv.
    $ pipenv run flask            # This runs flask in your virtualenv.
    $ pipenv run python           # This runs a REPL with the interpreter of your venv.
    $ pipenv shell                # This opens a shell in your venv.
Pipenv replaces requirements.txt with Pipfile and Pipfile.lock. (Similar to what you get from npm or yarn in the JS world, and cargo in Rust)

If you use pipenv for a project, you no longer need to care about pip, requirements.txt or virtualenv.

Pipenv/Pipfile is the new standard recommended by Python.org/PyPA:

https://packaging.python.org/tutorials/managing-dependencies...

https://github.com/pypa/pipenv

https://github.com/pypa/pipfile

Re: My Python Development Environment, 2018 Edition

#135

Earlier quoted context omitted.

I've used pyinstaller on Wine in order to make Windows executables from Linux. Haven't figured out yet how to cross-compile for OSX yet, but that at least reduces it from requiring three major OSes to build to two.

Have you had a chance to evaluate https://pybee.org ? src: https://news.ycombinator.com/item?id=16419628#16420689

Other than promoting Python and "diversity", what exactly does PyBee/BeeWare do? It sounds like an SDK, but it appears to just point to a bunch of random GitHub projects. It's not very clear to me.

Re: My Python Development Environment, 2018 Edition

#136

Earlier quoted context omitted.

I've used pyinstaller on Wine in order to make Windows executables from Linux. Haven't figured out yet how to cross-compile for OSX yet, but that at least reduces it from requiring three major OSes to build to two.

Have you had a chance to evaluate https://pybee.org ? src: https://news.ycombinator.com/item?id=16419628#16420689

After some digging I've still no idea if it solves my core problem of needing a Mac to build Mac binaries.

Re: My Python Development Environment, 2018 Edition

#137

Virtulenv + Pycharm, 3 years, happy as ever. For ML/DL stuff, Conda is also highly recommended.

same here. Also I'm quite happy about the level of integration between pycharm and frontend things (eslint, babel, react...) I never have to switch editors again. I trend to have a bash script for sourcing node versions... setting the correct path for node binaries, activate the env... and a makefile for building dockers, I try to mantain all the tooling reproductable on the project source.

Re: My Python Development Environment, 2018 Edition

#139
I want a GUI for polyglot local development for cloud-native apps with a variety of backing services that's as braindead and easy as *AMP apps were in the bad old days when you'd be slinging PHP, (plaintext) FTPing up to a shared host, working with guys for whom "server stuff" was pulling teeth and only having one version of Apache, PHP and MySQL to worry about (old terrible ones).

This seems within reach finally due to where were are getting with containers and orchestration. A bloated electron app plus kube in a VM maybe? Even that much RAM is still cheaper than my time.

Dropdowns for picking out what runtime, what language, what database, what cache, etc. picking where my code lives, then it boots everything up, solves a local hosts entry + ssl cert and keeps my code synced.

I should be able to huck my macbook in a wood chipper to protect my private keys from terrorists, unbox a new one, install my Jetbrains Toolbox, install this thing, and be back up and running fixing responsive text wrapping "bugs" on my marketing landing pages in minutes.

I should be able to hand my git repo to a potato whose wish to become human was granted by a fairy yesterday owing to their exemplary potato-like behavior and expect they can get the thing booted up and start blowing up my test suite and arguing with me about indentation in minutes.

I should be able to receive news of a cool new framework in a cool new language with a cool new runtime and a cool new database written by angels, etched into crystal tablets discovered in the martian polar ice accompanied with proofs that they are both feature complete and error-free then get going on using these gifts bestowed unto mankind in a brand new repo to write a microservice for filling people's inboxes with unsolicited promotions for male enhancement supplements in minutes.

Re: My Python Development Environment, 2018 Edition

#140
post #13

there are way too many python dep/env managers/things pipenv pyenv mkvirtualenv virtualenv pipsi venv pew conda virtualenvwrapper i'm sure i'm forgetting like 5. this is like https://xkcd.com/927/ for the record i use pyenv and virtualenv (although playing with ML i'm using conda)

As a Python developer, I just stay with pip and virtualenv, but I share the smh/wtf sentiment here. The data science folks enjoy conda but I don't see that being useful to me anywhere else. I feel like every other year someone will invent a new pip env . pyvenv (see comment section, edited) is now deprecated and venv is recommended (shipped as part of Python 3.6 installation) is another confusion. Lest not forget the…

python3.6 -m venv . && source bin/activate (this builds around the idea every project is a python package itself). pip install -e .
Post reply on HN