Re:You don't really need a virtualenv
by frostming on Thursday February 04, 2021 @08:28AM
(#26025114)
__pypackages__ also has a bin/ directory and you can run the console_scripts with pdm run my_bin or by absolute path: /path/to/__pypackages__/3.8/bin/my_bin
Re:You don't really need a virtualenv
by BiteCode_dev on Thursday February 04, 2021 @07:15AM
(#26024709)
-m is the replacement for console scripts. Well behaved cli should define a _ _ main _ _. Py
Pytest, pylint, black, pip, poetry, mypy all have one.
Jupyter one is buggy.
Regarding nested virtualenvs, last time I checked there was no such thing. When nested, they always linked back to the system level python, and the cloned python had loads of dependencies on the global system. I'm not aware of a valid use case for nesting virtualenvs.
There is one handy feature of virtualenv that I'm not sure __packages__ solves though: console_scripts and entry_points. setuptools will automatically create a console script under /usr/local/bin or similar which hooks in your module under site-packages. virtualenv includes a ./bin directory and adds it to your path so that these console scripts still work locally. Any thoughts on this?