Earlier quoted context omitted.
well, a lot of "system" utilities are implemented in Python and I'm not aware of many in Ruby (they must exist? I just checked to see what on my system depends on Ruby and it seems like the only things are a screenruler utility, some texlive packages I've never heard of and gnome-code-assistance, whatever that is). Pip installing random crap is a great way to completely break some Linux systems.
Running pip as root is a great way to self-compromise. Would you ever run npm as root...?
You don't really need a virtualenv
111–120 of 148 posts
Re: You don't really need a virtualenv
#112Earlier quoted context omitted.
I haven't used Poetry and most of my workplaces have done their own thing with versioning Python packages. So my virtualenv experience has been on my own or with toy projects. I really like writing one-off or sporadically used commandline tools. Loading a virtualenv or navigating to a directory before executing kind of sucks. Generally, I install into my homedir. I haven't read through or tried this out, but it seems…
You can execute the python binary inside the venv's bin/ folder directly. But you still need the full path I guess
Another issue with wrappers is how quickly it executes. It's not a big deal for most executions, but for --help or building up a command pipeline it's really annoying to wait a second or two on each execution. That slow startup time also shows up when you start integrating it into automated processes.
Re: You don't really need a virtualenv
#113Earlier quoted context omitted.
Honestly just use poetry.
This comment would be vastly more valuable (to me at least) if you said why. The parent’s workflow mirrors my own and doesn’t feel onerous. Being completely unfamiliar, their site says: > Poetry either uses your configured virtualenvs or creates its own to always be isolated from your system. So it is just a pretty wrapper? I’m missing the value add.
Re: You don't really need a virtualenv
#114Earlier quoted context omitted.
Honestly just use poetry.
Poetry shell doesn't work on windows, and it doesn't have named venv which matters for some users. Also it's very slow, require to be installed and use proprietary fields in pyproject.toml. It's a great tool but there are reasons you might want something else. Alternative like raw pip, pip tools, or dephell all have various pros and cons.
Re: You don't really need a virtualenv
#115Earlier quoted context omitted.
>Poetry shell doesn't work on windows What do you mean it doesn't work? It works fine on Windows here, unless I am missing something.
I'm being overly critical. Let's say it has problems: - poetry shell didn't start the same shell that you were in: https://github.com/sarugaku/shellingham/issues/42 . Looks like they fixed it 3 days ago though. - It doesn't set the name of the project in the prompt, so you actually don't know you are in the shell. Very annoying if you have many windows.
I agree with you there, it's very annoying and I've fallen for it a few times. Having not used Poetry on other platforms yet (still using Pipenv in a few projects), I wasn't even aware that this was a feature.
Re: You don't really need a virtualenv
#116Earlier quoted context omitted.
He also said virtual envs install their own copy of Python. No need for that either. Coming from other languages the whole virtual env thing seems alien especially the way it messes with your shell.
Activating the venv is completely optional. I never do it, but some people seem to like it.
A basic example of something that would break if the environment is not activated is binaries, like mypy.
You have a script that calls "mypy"? Gotta be in the virtual environment to invoke it, otherwise the executable might not be found, or worse, it might run another executable.
Re: You don't really need a virtualenv
#117> things get tricky when it comes to nested venvs Never had such a requirement. Environments, like the interpreter itself, seem a singleton concept. I have used a Makefile that sources different Bash environment variables kept in files in etc/ within the venv to switch between, say, a Flask and a Gunicorn startup.
Yes you're using nested venvs you're really making it harder on yourself. Way way harder on yourself.
Re: You don't really need a virtualenv
#118Earlier quoted context omitted.
I have the opinion that this is because "Deployment" is not a solved issue (or clearly defined and enforced) for Python. C has shared libraries and static compilation (bundling of dependencies) Java has .jar files which probably contain all your dependencies, go and Rust statically compile to something that has minimal dependencies and python has... no clue. Some packages you have to install via your package manager…
Or to be precise, it is a solved issue -- several times over. After years of meandering, I think it is safe to say that deployment of Python libraries is pretty much resolved in one, general way: we have the wheel/PyPI/pip toolchain, and that's about it. On the other hand, deployment of Python applications is still unresolved, and there is no single standard method to ensure both compatibility with and isolation from…
The candidates for distribution are things like pyinstaller or pex (still not fully mature) but I don't think they are as easy to use as Java jars or Go binaries.
Re: You don't really need a virtualenv
#119My first attempt, and I get "AttributeError: module 'toml.decoder' has no attribute 'TomlPreserveCommentDecoder'" So careful, far from stable. I reported it ( https://github.com/frostming/pdm/issues/247 ) because the project is great and I want it to succeed, but I won't put it in prod any time soon. I prefer my package manager to be stable than fancy. It's also why I don't use poetry and so on in training. There is…
True, bugs can't be exposed by a few users. People have vastly different environment setup for their Python development. System python, in-venv, pyenv, asdf, homebrew, etc. So I post it here to seek for help testing.
The sematic versioning may be a bit misleading, it is just because there was a big breaking change to support PEP 621, and I marked it as "Alpha" stage.
Re: You don't really need a virtualenv
#120> things get tricky when it comes to nested venvs Never had such a requirement. Environments, like the interpreter itself, seem a singleton concept. I have used a Makefile that sources different Bash environment variables kept in files in etc/ within the venv to switch between, say, a Flask and a Gunicorn startup.
I honestly can't even come up with a valid reason for something like nested venvs. At that point it seems more like someone's doing something wrong than 'things get tricky'.