ebresie / python4nb

This is a Python Plugin for Netbeans.
Apache License 2.0
13 stars 1 forks source link

Provide an Interface for Virtual Environments #22

Open ebresie opened 2 years ago

ebresie commented 2 years ago

This feature would be to provide a user interface to interface with Virtual Environments. This may be a sub-case of Python Platform functionality.

It may need to account for basic python virtual environments as well as anaconda-based environments

References

ebresie commented 2 years ago

From https://medium.com/@dbrailo/virtual-environments-in-python-2773ac8dd9ae

As of Python 3.3 can create vend with

python3 -m venv name-of-venv

May need to have a New..venv option used within the project folder and an activate/deactivate option

Avoid checking in venv folders (i.e. add to gitignore)

"Pip list in the environment will list its modules/packages"

New requirements.txt may be an option or used when adding dependencies indirectly

"To install the requirements.txt, run:

"pip3 install -r requirements.txt"

"to create the requirements.txt to have all the dependencies you have installed for that project, you can easily run:

"pip3 freeze > requirements.txt And you will have the .txt with all the dependencies and its versions inside."

"basic process of using a venv is to create it → activate it → install the libraries we need / installing the requirements.txt → deactivate"

Maybe can also use when setting up LSP server

ebresie commented 1 year ago

Based on Python Virtual Environment Primer

Have to accommodate multiple flavors of "venv" (i.e. standard python venv module, conda and virtualenv. May need a "virutal environment interface" with implementation for each of the above flavors.

ebresie commented 1 year ago

Need to decide if should include venv within the list of platforms or keep them separately. The benefits of coming is for all practical purposes a venv is another "instance" of a python platform with specific pre-included dependencies and could be treated as such but the draw back is the baseline pythons and the venv could provide excessive configurations which may get confusing as more environments are setup. Maybe a combination is to have a check box to include venvs

ebresie commented 1 year ago

May want to leverage a "venv" with the LSP modules included for use in plugin functionality.

ebresie commented 1 year ago

May need to consider egg/wheel packaging. See https://packaging.python.org/en/latest/discussions/wheel-vs-egg/ but this may be separate from virtual environments.