Environment Isolation and Dependency Management
Information on development environment and dependency:
Environment Isolation:
- System installed
python
should never be used for development. Isolate your development. - Any of the following can be used for python isolation:
- pyenv. Recommended as this supports local python install and multiple python versions.
- virtualenv. Third Party
- venv. Inbuilt
python -m venv
- Use
pip
for installing packages if not usingpoetry
.
info
Docker based containerized python can be used as well. Official images here. It is better to use virtualenvs in docker as well rather than root based user.
Dependency Management:
- poetry is recommended as it handles dependency as well as build system.
- You can use
setuptools
andsetup.py
as well for requirements handling throughrequires
. They must be used for install-able modules. requirements.txt
style should be avoided although you may come across this style a lot.