Browse Source

Updated readmes and Python requirements

kora 1 year ago
parent
commit
fe90cf9e0c
4 changed files with 21 additions and 4 deletions
  1. 17 0
      flask_be/do_requirements.md
  2. 1 1
      flask_be/requirements.txt
  3. 1 1
      flask_be/requirements_freezed.txt
  4. 2 2
      readme.md

+ 17 - 0
flask_be/do_requirements.md

@@ -0,0 +1,17 @@
+I plan to mantain **two** different requirements files:
+
+1. Using freeze from the activated venv:
+    pip freeze > requirements_freezed.txt
+
+2. Using pipreqs, pointing to the flask_be folder:
+    pipreqs {gitDir}/flask_be
+
+The reasons:
+
+- pip freeze saves the packages that are installed with pip install in your environment, while pipreqs saves the packages that are **imported** in the workspace
+- pip freeze saves **all** packages in the environment (global or venv) including those that you don’t use in your current project and doesn't save packages which are **not** installed even if the project does need them
+- pip freeze saves the EXACT (==) version of the packages installed; this is sometimes annoying, but makes for better reproducibility. pipreqs will deduce the dependencies from the imported packages, which typically implies they will >= a given version.
+
+Both files should be able to set the app running.
+
+I recommend registering the version of Python, pip and pipreqs in the requirements files too.

+ 1 - 1
flask_be/requirements.txt

@@ -1,4 +1,4 @@
-dtale==2.13.0
+dtale==2.14.1
 Flask==2.2.3
 Flask_Cors==3.0.10
 pandas==1.5.3

+ 1 - 1
flask_be/requirements_freezed.txt

@@ -1,4 +1,4 @@
-# obtained with Python version: 3.10.6
+# Created with: Python 3.10.6, pip 22.0.2
 
 certifi==2022.12.7
 charset-normalizer==3.1.0

+ 2 - 2
readme.md

@@ -10,11 +10,11 @@ To get flask running (use Python 3, any version should do!):
 	- Executing: **python** (or python3 or py depending on your system) **-m venv [virtual_environment_name]**
 	- Executing: **source [virtual_environment_name]/bin/activate**
 
-2. Install requirements: pip install -r requirements.txt OR pip install -r requirements_freezed.txt
+2. Install requirements: **pip** (or pip3) **install -r requirements.txt** OR **pip** (pip3) **install -r requirements_freezed.txt**
 
 3. [Optional] Activate Debug Mode by setting the environment variable:
 
-	- FLASK_ENV=development (for instance by executing **export FLASK_ENV=development** in bash)
+	- FLASK_DEBUG=true (for instance by executing **export FLASK_ENV=development** in bash)
 
 4. Start the app by executing: