this post was submitted on 29 Jun 2023
406 points (97.9% liked)

Programmer Humor

19623 readers
60 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 7 points 1 year ago (4 children)

Honestly, at this point I'm running all my python environments in different docker containers. Much easier to maintain.

[–] [email protected] 7 points 1 year ago (3 children)

Wait, you guys don't have a vm for each project and just use ssh to work on them?

[–] [email protected] 1 points 1 year ago

Nah why dont you guys just have a separate VPS for each individual project and just sudo install every python package?

[–] [email protected] 1 points 1 year ago

I wish I could do that, but my employer switches me around so much that I'd be out of disk space in no time.

[–] [email protected] 1 points 1 year ago (2 children)

How does the workflow works in practice? You just use the containers to compile your code, or do you actually have a whole dev environment with IDE and everything and work directly in the container? I can't imagine how does the workflow looks. Or is it possible to set up i.e. a JetBrains Rider to always spin up a container to compile the code in it? But then, if all the requirements and libraries are only on the container, how would it be able to do syntax highlithing and Intelisense (or what's the correct work for code completion), if it doesn't have the libraries on the host?

I'm probably missing something, but all the solutions I can figure out with my limited experience have issues - working on IDE in a VM sounds like a nightmare with moving files between VM and host, and the whole "spin up a VM, which takes time and it usually runs slower on the shitty company laptop, just to make a quick edit in one project". And I feel like setting up an IDE to use environment that's in a VM, but the IDE runs on a host sounds like a lot of work with linking and mounting folders. But maybe the IDEs do support it and it's actually easy and automated? If that's the case, then I'll definitely check it out!

[–] freo3579 3 points 1 year ago (2 children)

Check out dev container in VSCode. Even better with Codespaces from Github. You can define the entire environment in code, including extensions, settings, and startup scripts along with a Docker container. Then it's just one button click and 5 min wait until it's built and running. Once you have built it you can start it up and suspend it in seconds, toss it out when you don't need it, or spin up multiple at once and work on multiple branches simultaneously.

[–] [email protected] 2 points 1 year ago

Hmm, I wonder if this would be applicable for game development, which is my main field of work. But I do some projects here and there that don't require an actual engine, so I'll definitely check it out! It does sound pretty easy to set up. Thank you.

[–] [email protected] 1 points 1 year ago

VS Code SSH extension (with errorlens and shellcheck/pylance) literally changed my life. I cannot praise that shit enough.

[–] [email protected] 1 points 1 year ago

Part of that was a joke, but i do sometimes use a windows vm when i am working with a windows build, só i just have the vm openned on my second monitor and emacs open on my main machine, than i ssh within emacs into the vm and build and debug the code there, this way i don't need a whole dev enviroment, just git and the build tools

[–] [email protected] 6 points 1 year ago (1 children)

I've been trying to sell this idea to my team for a year now. I've even done all the legwork in my free time with a personal project and I've offered the patterns to the team. But alas, we still commit to masochism.

[–] entropicshart 2 points 1 year ago* (last edited 1 year ago)

If you haven’t yet, check out PDM; very simple dependency management in virtual environments, with an easy pdm export -o requirements.txt for docker installation.

Makes spinning up a test env for a mock up much easier and then if it grows to something needing docker, it has great dependency management for it.

[–] [email protected] 1 points 1 year ago (1 children)

Agreed! That's the way we do work projects. For personal stuff, I also like using pyenv. But yeah, that's it, keep it nice and simple.

[–] [email protected] 3 points 1 year ago

phew, glad to hear I'm not a total idiot. 👍