Repository to play with streamlit, loosely following the 30 days challenge at https://30days.streamlit.app/
In my previous projects (open and closed source ones), I've been playing with virtual environments using pip and some custom designed bash scripts to run pip install and also to freeze the dependencies (especially the indirect or transitive ones) in requirements.txt files with the following hierarchy:
requirements.in
: manually edited, with the package that is required for some new functionalityrequirements.txt
: after compilation ofrequirements.in
using the following commandpip-compile --generate-hashes --rebuild --no-strip-extras --emit-find-links ./../../requirements.in
requirements.txt
is generated and then used afterwards to run all necessarypip install
instancesrequirementsALL.txt
: installation of dependencies is done usingpython -m pip install -r ./../../requirements.txt
python -m pip freeze --all > ./../../requirementsALL.txt
All these steps are performed after the virtual environment is created so that dependencies are properly installed in virtual environment rather than on global Python environment. The detailed configuration can be seen in my sample-python-repo (setup.sh)
While this process works well, I decided to understand the Poetry tool and the following resources were indeed useful:
- Gerenciando pacotes e ambientes com Poetry - Live de Python #179 - por Eduardo Mendes
- Python Poetry in 8 Minutes by ArjanCodes
- How to Create and Use Virtual Environments in Python With Poetry by ArjanCodes
So this repository represents my first experience with Poetry.
There are at least two ways to install Poetry: using pip to install in global Python environment or using PowerShell to install it (in Windows) using the following command:
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -
For more details, see official documentation: Python-Poetry website
To start using Poetry, it is enough to run (https://python-poetry.org/docs/basic-usage/#project-setup)
poetry new [name_of-the-project]
This command will prepare a folder structure for the project and also to create tests and also create a pyproject.toml
file with project's metadata and its requirements.