Environment Isolation and Dependency Management
Information on development environment and dependency:
Environment Isolation:
- System installed
pythonshould 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
pipfor 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
setuptoolsandsetup.pyas well for requirements handling throughrequires. They must be used for install-able modules. requirements.txtstyle should be avoided although you may come across this style a lot.