diff --git a/README.md b/README.md index d8a4a917b..8ff430548 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ The required dependencies are: - astropy >= 5.0.4 - cartopy >=0.20 - numpy >= 1.19 -- psycopg2 >= 2.9 +- psycopg>=3.2.2 - pyuvdata >= 2.2.9 - pyyaml >= 5.1 - redis-py >= 4.3.4 (Note that this is called "redis" on pypi and "redis-py" on conda) diff --git a/ci/min_deps.yaml b/ci/min_deps.yaml index 26aa137a8..30da075c6 100644 --- a/ci/min_deps.yaml +++ b/ci/min_deps.yaml @@ -7,7 +7,7 @@ dependencies: - cartopy>=0.20.0 - coverage - numpy>=1.19.* - - psycopg2>=2.9 + - psycopg>=3.2.2 - pytest>=6.2.0 - pytest-cov - pyuvdata>=2.2.9 diff --git a/ci/min_versions.yaml b/ci/min_versions.yaml index 7b6c7ef47..42dacd31a 100644 --- a/ci/min_versions.yaml +++ b/ci/min_versions.yaml @@ -12,7 +12,7 @@ dependencies: - pandas==1.4.0 - pip - psutil==5.9.0 - - psycopg2==2.9 + - psycopg==3.2.2 - pytest==6.2.0 - pytest-cov - python-dateutil==2.8.2 diff --git a/ci/publish.yml b/ci/publish.yml index 8d61dfc18..d02c3eeaa 100644 --- a/ci/publish.yml +++ b/ci/publish.yml @@ -6,7 +6,7 @@ dependencies: - astropy>=5.0.4 - cartopy>=0.20.0 - numpy>=1.19.* - - psycopg2>=2.9 + - psycopg>=3.2.2 - pyuvdata>=2.2.9 - pyyaml>=5.1 - redis-py>=4.3.4 diff --git a/ci/tests.yaml b/ci/tests.yaml index 7f3e044fa..197f2ea5c 100644 --- a/ci/tests.yaml +++ b/ci/tests.yaml @@ -12,7 +12,7 @@ dependencies: - pandas>=1.4.0 - pip - psutil>=5.9.0 - - psycopg2>=2.9 + - psycopg>=3.2.2 - pytest>=6.2.0 - pytest-cov - python-dateutil>=2.8.2 diff --git a/environment.yaml b/environment.yaml index 3b64be714..30a9c1c98 100644 --- a/environment.yaml +++ b/environment.yaml @@ -12,7 +12,7 @@ dependencies: - pandas>=1.4.0 - pip - psutil>=5.9.0 - - psycopg2>=2.9 + - psycopg>=3.2.2 - pytest>=6.2.0 - pytest-cov - python-dateutil>=2.8.2 diff --git a/hera_mc/mc.py b/hera_mc/mc.py index a42014645..cbdfc70ef 100644 --- a/hera_mc/mc.py +++ b/hera_mc/mc.py @@ -40,6 +40,8 @@ class DB(object, metaclass=ABCMeta): sqlalchemy_base = None def __init__(self, sqlalchemy_base, db_url): # noqa + if "postgresql" in db_url and "postgresql+psycopg" not in db_url: + db_url = db_url.replace("postgresql", "postgresql+psycopg") self.sqlalchemy_base = MCDeclarativeBase self.engine = create_engine(db_url) self.sessionmaker.configure(bind=self.engine) diff --git a/setup.py b/setup.py index 182b81281..649bdead0 100755 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ "astropy>=5.0.4", "cartopy>=0.20", "numpy>=1.19", - "psycopg2>=2.9", + "psycopg>=3.2.2", "pyuvdata>=2.2.9", "pyyaml>=5.1", "redis>=4.3.4", # Note that this gets redis-py, which is named "redis" on pypi