Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Description

This module introduces us to isolated environments, program dependencies and system variables.

Instructions

To verify if the norm is correctly applied in the different files:

flake8

If 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_env

To enter the virtual environment:

source matrix_env/bin/activate

To 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.

Notions

Pip

To install the dependencies present in requirements.txt, use this:

pip install -r requirements.txt

Poetry

To install poetry, use this command:

curl -sSL https://install.python-poetry.org | python3 -

To create a pyproject.toml:

poetry init

Then to install dependencies inside pyproject.toml:

poetry install

The command to run any program with poetry:

poetry run python3 *.py

.env

First, install dotenv dependency:

pip install python-dotenv

Use 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 .env

Use 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

Resources

Notions:

Github: