First i have to precise that i am not developper and didn't get the luck to work in team on informatic project. So it is quite hard to get good coding practices (i try to learn from what i see on the web but it is quite messy/confused in my head).
Triying to do my best, here is my old code structure (i will explain later the problems i am encountering working back with this code):
.
├── .env
├── .git
├── .gitignore
├── README.md
├── config.py
├── data
│ ├── input
│ ├── interim_input
│ └── output
├── requirements.txt
├── tests
│ ├── batch.py
│ ├── data
│ ├── mytest.py
│ └── test_upload_twb.py
├── mypackage
│ ├── __init__.py
│ ├── generate_trad_file_2.py
│ ├── generate_twb_file_4.py
│ ├── parse_twb.py
│ ├── twb_mysql.py
│ ├── upload_trad_file_3.py
│ └── upload_twb_1.py
└── venv
Some precisions:
- All sensible information (Mysql login/pwd for example) will be loaded as environnement variable with the help of .env file and pyton-dotenv package
- The config.py file let me upload the needed configurations (mainly from environnement variable)
Here are my current problems:
Trying to run my old code i noticed that after making a virtual env (with python -m venv venv) i failed to pip install the dependancies with my current python version Python 3.8.3 (pip install -r requirements.txt). In fact python version is not indicated anywhere and i was wondering how you work ? Do you specify Python version in Readme.md or is there another trick (we can't specify python version in venv) ?
Is it safe to let a .env file with sensible information (i do not commit it but i was wondering how does it work in compagnies to prevent all devellopers who access the code to see all the sensible informations
I am trying to run my code and i will have to test the different function (which will break since i have to recreate the database, etc...). I was thinking to try to run them separately from command line, but it seems a best idea to persist thoses commands for next time. Since i want to run the different functions (one by .py since they achieve really different thing but correspond to ordered step in a pipeline) i was thinking of writing differents test_file. I can feel that i do not get the right approach again, so if you could advice me....
Thanks a lot in advance for your kindness.