Codebase list python-faraday / 2556f7c debian / patches / Add-vendor-in-path.patch
2556f7c

Tree @2556f7c (Download .tar.gz)

Add-vendor-in-path.patch @2556f7craw · history · blame

From: Sophie Brun <[email protected]>
Date: Mon, 6 Dec 2021 17:30:46 +0100
Subject: Add usr/lib/python3/dist-packages/faraday/vendor in import path


Last-Update: 2021-12-07
Add usr/lib/python3/dist-packages/faraday/vendor in PYTHONPATH to use
the embedded version instead of the packages version of SQLalchemy.
---
 faraday/manage.py            | 2 ++
 faraday/searcher/searcher.py | 2 ++
 faraday/start_server.py      | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/faraday/manage.py b/faraday/manage.py
index c3458aa..05c8ddc 100755
--- a/faraday/manage.py
+++ b/faraday/manage.py
@@ -29,6 +29,8 @@ if platform.system() == "Linux":
     except KeyError:
         pass
 
+sys.path.insert(1, '/usr/lib/python3/dist-packages/faraday/vendor')
+
 # pgcli is not installed like a Python module in Debian. Add pgcli path in
 # python path
 sys.path.append("/usr/share/pgcli")
diff --git a/faraday/searcher/searcher.py b/faraday/searcher/searcher.py
index 4ebcef8..f88dc58 100755
--- a/faraday/searcher/searcher.py
+++ b/faraday/searcher/searcher.py
@@ -23,6 +23,8 @@ from pathlib import Path
 import click
 import requests
 
+sys.path.insert(1, '/usr/lib/python3/dist-packages/faraday/vendor')
+
 from faraday.searcher.api import Api
 from faraday.searcher.validator import validate_rules
 from faraday.server.models import Service, Host
diff --git a/faraday/start_server.py b/faraday/start_server.py
index 4ab2c68..a29b855 100644
--- a/faraday/start_server.py
+++ b/faraday/start_server.py
@@ -7,6 +7,8 @@ import socket
 import argparse
 import logging
 
+sys.path.insert(1, '/usr/lib/python3/dist-packages/faraday/vendor')
+
 import psycopg2
 from alembic.runtime.migration import MigrationContext