Development environments (slightly Python-centric)

  • Thread starter Deleted member 43669
  • Start date
D

Deleted member 43669

Guest
Hi,

What's your preferred way to do development environments? Assume you want to be friendly to Linux, Windows and Mac users, and that developing on a laptop should be friendly.

(My primary concern is that we are being pushed to stop using Linux on laptops. I am studying if Windows is a viable option in addition to OS X- we have developers on OS X which are happy, but we've never had devs on Windows)

We are mostly using a few techniques currently at $WORK for Python dev:

  • Locally installed Python + virtualenvs. This is a bit annoying because Linux distros tend to have a single major version of Python available (Debian Stable has Python 3.5, Ubuntu 18.04 and CentOS 7 have Python 3.6), so you can have some issues. However, this is perhaps the simplest and quickest- with virtualenvs you can have isolated environments and it's extremely lightweight
  • Docker + bind mounts. This way you can run specific Python versions if needed easily. Using bind mounts turnaround is very quick. However, I'm concerned this will be an issue on Windows- I'm not sure if this will interact very well with WSL, for instance
  • Docker for dependencies such as databases, etc. I think this is good everywhere; spinning up a PostgreSQL server is damn simple on Docker, you don't need to touch your base install, you can use any required version, etc.

I'm slightly concerned because I'm an Eclipse user (yes, for Python!) and it's damn handy to be able to configure my virtualenvs there and get code completion, code navigation to libraries, etc. So if I'm running Eclipse on Windows and my virtualenv is on a Docker container this can get hairy...

I'm pondering just standardizing on having a Linux VM somewhere, use sshfs-like solutions to edit locally... which has other advantages (easier to switch laptops, you can snapshot/clone/etc. your dev environment, etc.).

Thoughts, ideas?
 

Ben_H

Ars Scholae Palatinae
1,059
I'm not working using python right now, but I use it a lot for personal projects. On a clean install of whatever OS, I basically install python3, install virtualenv, and then I have a bash script that creates a virtual environment with all of the common modules I use. It takes me all of 10 minutes to be fully up and running on any machine I've tested it on so far (though on Windows I'm using the Linux subsystem). I then use Visual Studio Code with several python-centric plugins (the default Microsoft-made python extension and the Python Extension Pack usually unless I need something specific. Also CSV plugins are nice too). The autocomplete and quick-view documentation stuff in VSC is quite impressive. My virtual environment also installs Jupyter since I use notebooks a lot.

I also use PyCharm from time to time, but honestly, I usually just stick with Visual Studio Code now. It's just as helpful with autocomplete and the like, and it's much lighter weight. I can see using IDEs being more useful for bigger projects than I am working on though.
 

KallDrexx

Ars Tribunus Militum
2,040
FWIW we are a 100% windows shop (.net Framework, not even .net core). We heavily use docker for development environments, with several docker compose files containing dev related resources like mssql, mysql, mongo, and redis. The compose file specifically has mssql run mounting a subfolder into the container for persistence of the database and so mssql can access database backup files. Since it's just a normal windows directory, modifying that from within WSL and having changes seen by the docker container should be fine.

The only issue we have with Windows docker is every other reboot when I try to spin everything up Docker for windows gives me an input/output error, which is fixed by me restarting docker. It's annoying but bearable.
 
I run a python shop and we use docker to run postgres, elasticsearch, redis, django, and webpack in individual containers. I use PyCharms and autocomplete, etc. still work (even on the community edition). The folks on my team who do not use tools with docker integrations typically maintain a local virtualenv with the containers. The datastores for postgres and elasticsearch are kept as external volumes. I can't speak to how well docker plays with WSL, as we're pretty mostly mac and linux for almost every dev uses macs (1 full linux user). HMR works pretty reliably for webpack, as does django's autodetection of changes. We haven't setup local hooks to rebuild containers on package.json/requirements.txt changes *yet*, and honestly, reminding people to rebuild after checking out a new branch with package changes is about all the 'troubleshooting' we have left to live with at this point. Things just work, and our development environment is a lot more representative of production.
 
D

Deleted member 43669

Guest
FWIW we are a 100% windows shop (.net Framework, not even .net core). We heavily use docker for development environments, with several docker compose files containing dev related resources like mssql, mysql, mongo, and redis. The compose file specifically has mssql run mounting a subfolder into the container for persistence of the database and so mssql can access database backup files. Since it's just a normal windows directory, modifying that from within WSL and having changes seen by the docker container should be fine.

The only issue we have with Windows docker is every other reboot when I try to spin everything up Docker for windows gives me an input/output error, which is fixed by me restarting docker. It's annoying but bearable.

Those are Linux containers? Esp. the mssql container?
 

KallDrexx

Ars Tribunus Militum
2,040
FWIW we are a 100% windows shop (.net Framework, not even .net core). We heavily use docker for development environments, with several docker compose files containing dev related resources like mssql, mysql, mongo, and redis. The compose file specifically has mssql run mounting a subfolder into the container for persistence of the database and so mssql can access database backup files. Since it's just a normal windows directory, modifying that from within WSL and having changes seen by the docker container should be fine.

The only issue we have with Windows docker is every other reboot when I try to spin everything up Docker for windows gives me an input/output error, which is fixed by me restarting docker. It's annoying but bearable.

Those are Linux containers? Esp. the mssql container?

Yep we only use Linux containers (including sql server).