Skip to content

Commit

Permalink
[requirements] Use a hierarchical requirements structure for the Pyth…
Browse files Browse the repository at this point in the history
…on dependencies
  • Loading branch information
drcpu-github committed Mar 14, 2024
1 parent 2aecdb1 commit 11d7fc5
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black flake8 flake8-bugbear flake8-implicit-str-concat isort
pip install -r requirements/formatting.txt
- name: Run code checks
run: |
make lint-check
4 changes: 3 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ jobs:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get install libmemcached-dev
python -m pip install --upgrade pip
pip install cbor flask==2.3.2 flask_smorest==0.42.0 marshmallow Pillow psycopg[pool] pylibmc pytest toml
pip install -r requirements/api.txt
pip install -r requirements/tests.txt
- name: Run pytest
run: |
python -m pytest
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ sudo make install

## Python3 dependencies - virtual environment

It is advised to start the explorer from within a virtual environment. You can install all dependencies using the `requirements.txt` file:
It is advised to start the explorer from within a virtual environment. You can install all dependencies using the `requirements/all.txt` file:
```
virtualenv env
source env/bin/activate
pip install -r requirements.txt
pip install -r requirements/all.txt
```

## Install and configure memcached
Expand Down
22 changes: 0 additions & 22 deletions requirements.txt

This file was deleted.

8 changes: 8 additions & 0 deletions requirements/all.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
matplotlib==3.5.3
numpy==1.24.4
prometheus_client==0.15.0
psutil==5.8.0

-r requirements/api.txt
-r requirements/formatting.txt
-r requirements/tests.txt
11 changes: 11 additions & 0 deletions requirements/api.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cbor==1.0.0
Flask==2.3.2
flask_smorest==0.42.0
gevent==23.7.0
gunicorn==21.2.0
marshmallow==3.20.1
Pillow==10.0.0
psycopg==3.1.12
psycopg-pool==3.1.8
pylibmc==1.6.1
toml==0.10.2
6 changes: 6 additions & 0 deletions requirements/formatting.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
black==23.7.0
flake8==6.0.0
flake8-bugbear==23.9.16
flake8-implicit-str-concat==0.4.0
isort==5.10.1
pre-commit==3.3.3
1 change: 1 addition & 0 deletions requirements/tests.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==7.4.0

0 comments on commit 11d7fc5

Please sign in to comment.