From 5a50496ecaf5b2363e30d49724e5d56ab20dba59 Mon Sep 17 00:00:00 2001
From: Maciej Urbanski <maciej.rooter.urbanski@reef.pl>
Date: Sat, 1 Jun 2024 11:19:46 +0200
Subject: [PATCH 1/4] configure github dependabot to check for security updates

---
 .github/dependabot.yml | 8 ++++++++
 1 file changed, 8 insertions(+)
 create mode 100644 .github/dependabot.yml

diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000000..adff4d0aab
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,8 @@
+version: 2
+updates:
+  - package-ecosystem: "pip"
+    directory: ""
+    file: "requirements/prod.txt"
+    schedule:
+      interval: "daily"
+    open-pull-requests-limit: 0  # Only security updates will be opened as PRs

From a71fb4e88e14ea35dc145eb117f90403692c5960 Mon Sep 17 00:00:00 2001
From: Maciej Urbanski <maciej.rooter.urbanski@reef.pl>
Date: Sat, 1 Jun 2024 11:31:18 +0200
Subject: [PATCH 2/4] make production dependencies less restrictive

---
 requirements/dev.txt  |  2 ++
 requirements/prod.txt | 31 ++++++++++++++-----------------
 2 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/requirements/dev.txt b/requirements/dev.txt
index 2fe7007484..f6cd2aef9d 100644
--- a/requirements/dev.txt
+++ b/requirements/dev.txt
@@ -1,4 +1,6 @@
+black==23.7.0
 pytest==7.2.0
+pytest-asyncio
 pytest-mock==3.12.0
 pytest-split==0.8.0
 pytest-xdist==3.0.2
diff --git a/requirements/prod.txt b/requirements/prod.txt
index d5bbf44b87..2d9ecabab5 100644
--- a/requirements/prod.txt
+++ b/requirements/prod.txt
@@ -1,19 +1,18 @@
-aiohttp==3.9.0b0
-ansible==6.7.0
-ansible_vault==2.1.0
+aiohttp~=3.9
+ansible~=6.7
+ansible_vault~=2.1
 backoff
-black==23.7.0
-certifi==2024.2.2
-colorama==0.4.6
-cryptography==42.0.5
-ddt==1.6.0
+certifi~=2024.2.2
+colorama~=0.4.6
+cryptography~=42.0.5
+ddt~=1.6.0
 eth-utils<2.3.0
 fuzzywuzzy>=0.18.0
-fastapi==0.110.1
-munch==2.5.0
+fastapi~=0.110.1
+munch~=2.5.0
 netaddr
 numpy
-msgpack-numpy-opentensor==0.5.0
+msgpack-numpy-opentensor~=0.5.0
 nest_asyncio
 packaging
 pycryptodome>=3.18.0,<4.0.0
@@ -21,17 +20,15 @@ pyyaml
 password_strength
 pydantic>=2.3, <3
 PyNaCl>=1.3.0,<=1.5.0
-pytest-asyncio
 python-Levenshtein
-python-statemachine==2.1.2
-pytest
+python-statemachine~=2.1.2
 retry
 requests
 rich
 scalecodec==1.2.7  # scalecodec should not be changed unless first verifying compatibility with the subtensor's monkeypatching of scalecodec.RuntimeConfiguration.get_decoder_class
-shtab==1.6.5
-substrate-interface==1.7.5
+shtab~=1.6.5
+substrate-interface~=1.7.5
 termcolor
 tqdm
-uvicorn==0.22.0
+uvicorn<=0.30
 wheel

From 48fdee70682d82e9b48b75fb321cda0deb3d7bb3 Mon Sep 17 00:00:00 2001
From: Maciej Urbanski <maciej.rooter.urbanski@reef.pl>
Date: Sat, 1 Jun 2024 14:49:58 +0200
Subject: [PATCH 3/4] fix check_compatibility.sh understanding of ~=

---
 scripts/check_compatibility.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/check_compatibility.sh b/scripts/check_compatibility.sh
index 5f48f4cbb0..b9c89c24dd 100755
--- a/scripts/check_compatibility.sh
+++ b/scripts/check_compatibility.sh
@@ -22,7 +22,7 @@ check_compatibility() {
             continue
         fi
 
-        package_name=$(echo "$requirement" | awk -F'[!=<>]' '{print $1}' | awk -F'[' '{print $1}') # Strip off brackets
+        package_name=$(echo "$requirement" | awk -F'[!=<>~]' '{print $1}' | awk -F'[' '{print $1}') # Strip off brackets
         echo -n "Checking $package_name... "
 
         url="https://pypi.org/pypi/$package_name/json"

From 672839e9ce82906d717b0a171895710326c8550b Mon Sep 17 00:00:00 2001
From: Maciej Urbanski <maciej.rooter.urbanski@reef.pl>
Date: Sat, 1 Jun 2024 14:43:54 +0200
Subject: [PATCH 4/4] explicitly install pytest in E2E tests

---
 .github/workflows/e2e-subtensor-tests.yaml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/.github/workflows/e2e-subtensor-tests.yaml b/.github/workflows/e2e-subtensor-tests.yaml
index 896d2142f9..bea776f620 100644
--- a/.github/workflows/e2e-subtensor-tests.yaml
+++ b/.github/workflows/e2e-subtensor-tests.yaml
@@ -80,6 +80,5 @@ jobs:
 
       - name: Run tests
         run: |
-          python3 -m pip install -e .
-          python3 -m pip install torch
+          python3 -m pip install -e .[torch] pytest
           LOCALNET_SH_PATH="./subtensor/scripts/localnet.sh" pytest tests/e2e_tests/ -s