Here's a typical workflow when working with virtual environments:
1) Create virtual envinronment:
python3 -m venv venv
2) Activate it:
source venv/bin/activate
3) Install needed requirements:
(venv): pip install ...
4) (Write the code of the Package)
5) Freeze the code/Create the Package dependencies.
At the last point selected python tool wraps up all the packages from my virtual environment installed at point 3).
And here's my problem. What if some requirements installed at point 3) are just private packages used only by me for development purposes? For example, in order to have Spyder editor working in different virtual environments I need to install spyder-kernels. They are not needed for my Package, and they are not needed for other developers if they don't use this editor. However, when I
(venv): pip freeze > requirements.txt
I get requirements.txt with spyder-kernels package included in it, and then
(venv2): pip install -r requirements.txt
installs all the packages from requirements.txt unless I manually delete unwanted lines.
Is there any flag for pip install that could tell pip to install some packages as hidden/private for freezing/packaging process? Or any other automatic workaround that could achieve my goal? The perfect scenario would be something like this:
python3 -m venv venv
source venv/bin/activate
(venv): pip install important_packages
(venv): pip install -privateFLAG spyder-kernels
(venv): pip freeze > requirements.txt # (stores important_packages)
(venv): pip freeze -privateFLAG > private_requirements.txt
and then one can choose to recreate the environment depenedencies with: '''pip install -r requirements.txt''' or '''pip install -r requirements.txt private_requirements.txt''' if he needs whatever in private_requirements.txt is.
Can we do some similar trick for freezing code?