This module introduces us to isolated environments, program dependencies and system variables.
To verify if the norm is correctly applied in the different files:
flake8If there is an issue, the command will send back said issue. Otherwise, nothing will be sent back in the terminal.
To create the virtual environment:
python3 -m venv matrix_envTo enter the virtual environment:
source matrix_env/bin/activateTo execute the program, once in the corresponding file, use:
python3 <name of the program>To exit a virtual environment, use the command deactivate in the terminal.
To install the dependencies present in requirements.txt, use this:
pip install -r requirements.txtTo install poetry, use this command:
curl -sSL https://install.python-poetry.org | python3 -To create a pyproject.toml:
poetry initThen to install dependencies inside pyproject.toml:
poetry installThe command to run any program with poetry:
poetry run python3 *.pyFirst, install dotenv dependency:
pip install python-dotenvUse the .env.example in the folder to create the .env (you can copy it using cp) and put your own values inside to protect your confidential data.
cp .env.example .envUse this to test the priority between the .env file and the console output to overrides some values like this:
MATRIX_MODE=production API_KEY=secret123 python3 oracle.py