From 73103940e7cbc8c0f51cb5cb226658936317e208 Mon Sep 17 00:00:00 2001 From: Jason Little Date: Tue, 25 Nov 2025 20:35:14 -0600 Subject: [PATCH 1/4] Adjust to provide for a generic database engine type Provide a new key in the database config of "driver" to be specific of the driver to use, which allows "name" to be a more generic "postgres" allowing swaping of the driver transparently to admins. Default to "psycopg2", if "name" is set to "postgres". Allow for "name" to remain "psycopg2" for backwards compatibility. --- synapse/config/database.py | 12 +++++++++++- synapse/storage/database.py | 2 +- synapse/storage/engines/__init__.py | 10 +++++----- tests/metrics/test_phone_home_stats.py | 2 +- tests/server.py | 4 +++- tests/storage/test_base.py | 6 +++--- tests/utils.py | 4 ++-- 7 files changed, 26 insertions(+), 14 deletions(-) diff --git a/synapse/config/database.py b/synapse/config/database.py index 929b382d3e9..c501b6e5759 100644 --- a/synapse/config/database.py +++ b/synapse/config/database.py @@ -57,14 +57,24 @@ class DatabaseConnectionConfig: def __init__(self, name: str, db_config: dict): db_engine = db_config.get("name", "sqlite3") - if db_engine not in ("sqlite3", "psycopg2", "psycopg"): + if db_engine not in ("sqlite3", "psycopg2", "postgres"): raise ConfigError("Unsupported database type %r" % (db_engine,)) if db_engine == "sqlite3": + db_config["driver"] = "sqlite3" db_config.setdefault("args", {}).update( {"cp_min": 1, "cp_max": 1, "check_same_thread": False} ) + # Allow for a generic "postgres". Then, can specify a driver directly to + # override. For backwards compatibility, allow this to remain "psycopg2" for + # now. Setting the driver below is the important detail. + elif db_engine in ("postgres", "psycopg2"): + # Default to "psycopg2" + db_driver = db_config.setdefault("driver", "psycopg2") + if db_driver not in ("psycopg2", "psycopg"): + raise ConfigError("Unsupported database driver %r" % (db_driver,)) + data_stores = db_config.get("data_stores") if data_stores is None: data_stores = ["main", "state"] diff --git a/synapse/storage/database.py b/synapse/storage/database.py index cdf2110f630..e211f7eb914 100644 --- a/synapse/storage/database.py +++ b/synapse/storage/database.py @@ -159,7 +159,7 @@ def _on_new_connection(conn: Connection) -> None: ) connection_pool = adbapi.ConnectionPool( - db_config.config["name"], + db_config.config["driver"], cp_reactor=reactor, cp_openfun=_on_new_connection, **db_args, diff --git a/synapse/storage/engines/__init__.py b/synapse/storage/engines/__init__.py index 4a5bae35e16..8f4ddb9492b 100644 --- a/synapse/storage/engines/__init__.py +++ b/synapse/storage/engines/__init__.py @@ -62,18 +62,18 @@ def __new__(cls, *args: object, **kwargs: object) -> NoReturn: def create_engine(database_config: Mapping[str, Any]) -> BaseDatabaseEngine: - name = database_config["name"] + driver = database_config["driver"] - if name == "sqlite3": + if driver == "sqlite3": return Sqlite3Engine(database_config) - if name == "psycopg2": + if driver == "psycopg2": return Psycopg2Engine(database_config) - if name == "psycopg": + if driver == "psycopg": return PsycopgEngine(database_config) - raise RuntimeError("Unsupported database engine '%s'" % (name,)) + raise RuntimeError("Unsupported database engine '%s'" % (driver,)) __all__ = [ diff --git a/tests/metrics/test_phone_home_stats.py b/tests/metrics/test_phone_home_stats.py index 4462385dae0..e0f09a2151e 100644 --- a/tests/metrics/test_phone_home_stats.py +++ b/tests/metrics/test_phone_home_stats.py @@ -251,7 +251,7 @@ def test_phone_home_stats(self) -> None: ) self.assertEqual( phone_home_stats["database_engine"], - self.hs.config.database.databases[0].config["name"], + self.hs.config.database.databases[0].config["driver"], ) self.assertEqual( phone_home_stats["database_server_version"], diff --git a/tests/server.py b/tests/server.py index 5cf0166705c..bb4b51d0997 100644 --- a/tests/server.py +++ b/tests/server.py @@ -1118,7 +1118,8 @@ def setup_test_homeserver( db_type = "psycopg2" database_config: JsonDict = { - "name": db_type, + "name": "postgres", + "driver": db_type, "args": { "dbname": test_db, "host": POSTGRES_HOST, @@ -1146,6 +1147,7 @@ def setup_test_homeserver( database_config = { "name": "sqlite3", + "driver": "sqlite3", "args": {"database": test_db_location, "cp_min": 1, "cp_max": 1}, } diff --git a/tests/storage/test_base.py b/tests/storage/test_base.py index c19c8c7591c..5fbbb3072e0 100644 --- a/tests/storage/test_base.py +++ b/tests/storage/test_base.py @@ -100,11 +100,11 @@ def runWithConnection(func, *args, **kwargs): # type: ignore[no-untyped-def] hs = TestHomeServer("test", config=config) if USE_POSTGRES_FOR_TESTS == "psycopg": - db_config = {"name": "psycopg", "args": {}} + db_config = {"driver": "psycopg", "args": {}} elif USE_POSTGRES_FOR_TESTS: - db_config = {"name": "psycopg2", "args": {}} + db_config = {"driver": "psycopg2", "args": {}} else: - db_config = {"name": "sqlite3"} + db_config = {"driver": "sqlite3"} engine = create_engine(db_config) fake_engine = Mock(wraps=engine) diff --git a/tests/utils.py b/tests/utils.py index 05e4a8d689a..13705961d20 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -75,9 +75,9 @@ def setupdb() -> None: if USE_POSTGRES_FOR_TESTS: # create a PostgresEngine if USE_POSTGRES_FOR_TESTS == "psycopg": - db_engine = create_engine({"name": "psycopg", "args": {}}) + db_engine = create_engine({"driver": "psycopg", "args": {}}) else: - db_engine = create_engine({"name": "psycopg2", "args": {}}) + db_engine = create_engine({"driver": "psycopg2", "args": {}}) # connect to postgres to create the base database. db_conn = db_engine.module.connect( user=POSTGRES_USER, From 90af5cba788a21cd55f8a14617e2e771a8cc24d2 Mon Sep 17 00:00:00 2001 From: Jason Little Date: Thu, 27 Nov 2025 06:14:10 -0600 Subject: [PATCH 2/4] Attempt at docs adjustment --- ...nning_synapse_on_single_board_computers.md | 4 +- docs/postgres.md | 4 +- .../reporting_homeserver_usage_statistics.md | 4 +- .../configuration/config_documentation.md | 24 ++++++++++-- schema/synapse-config.schema.yaml | 37 +++++++++++++++---- 5 files changed, 56 insertions(+), 17 deletions(-) diff --git a/docs/other/running_synapse_on_single_board_computers.md b/docs/other/running_synapse_on_single_board_computers.md index f06563bee31..3acc9ca5232 100644 --- a/docs/other/running_synapse_on_single_board_computers.md +++ b/docs/other/running_synapse_on_single_board_computers.md @@ -47,7 +47,7 @@ limit_remote_rooms: # Database configuration database: # Use postgres for the best performance - name: psycopg2 + name: postgres args: user: matrix-synapse # Generate a long, secure password using a password manager @@ -72,4 +72,4 @@ admin@homeserver:~$ sudo --user postgres psql matrix-synapse --command 'select c #irc:matrix.org | 461 | 3751 #decentralizedweb-general:matrix.org | 997 | 1509 #whatsapp:maunium.net | 554 | 854 -``` \ No newline at end of file +``` diff --git a/docs/postgres.md b/docs/postgres.md index d51f54c7223..440ed8f3636 100644 --- a/docs/postgres.md +++ b/docs/postgres.md @@ -62,7 +62,7 @@ section in your config file to match the following lines: ```yaml database: - name: psycopg2 + name: postgres args: user: password: @@ -72,7 +72,7 @@ database: cp_max: 10 ``` -All key, values in `args` are passed to the `psycopg2.connect(..)` +All key, values in `args` are passed to the appropriate modules `connect()` function, except keys beginning with `cp_`, which are consumed by the twisted adbapi connection pool. See the [libpq documentation](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS) diff --git a/docs/usage/administration/monitoring/reporting_homeserver_usage_statistics.md b/docs/usage/administration/monitoring/reporting_homeserver_usage_statistics.md index a8a717e2a2b..b9fb13753bd 100644 --- a/docs/usage/administration/monitoring/reporting_homeserver_usage_statistics.md +++ b/docs/usage/administration/monitoring/reporting_homeserver_usage_statistics.md @@ -30,7 +30,7 @@ The following statistics are sent to the configured reporting endpoint: | `python_version` | string | The Python version number in use (e.g "3.7.1"). Taken from `sys.version_info`. | | `total_users` | int | The number of registered users on the homeserver. | | `total_nonbridged_users` | int | The number of users, excluding those created by an Application Service. | -| `daily_user_type_native` | int | The number of native, non-guest users created in the last 24 hours. | +| `daily_user_type_native` | int | The number of native, non-guest users created in the last 24 hours. | | `daily_user_type_guest` | int | The number of guest users created in the last 24 hours. | | `daily_user_type_bridged` | int | The number of users created by Application Services in the last 24 hours. | | `total_room_count` | int | The total number of rooms present on the homeserver. | @@ -49,7 +49,7 @@ The following statistics are sent to the configured reporting endpoint: | `r30v2_users_web` | int | The number of 30 day retained users, as defined above. Filtered only to clients with "mozilla" or "gecko" (case-insensitive) in the user agent string. | | `cache_factor` | int | The configured [`global factor`](../../configuration/config_documentation.md#caching) value for caching. | | `event_cache_size` | int | The configured [`event_cache_size`](../../configuration/config_documentation.md#caching) value for caching. | -| `database_engine` | string | The database engine that is in use. Either "psycopg2" meaning PostgreSQL is in use, or "sqlite3" for SQLite3. | +| `database_engine` | string | The database engine that is in use. Either "psycopg2" or "psycopg" meaning PostgreSQL is in use, or "sqlite3" for SQLite3. | | `database_server_version` | string | The version of the database server. Examples being "10.10" for PostgreSQL server version 10.0, and "3.38.5" for SQLite 3.38.5 installed on the system. | | `log_level` | string | The log level in use. Examples are "INFO", "WARNING", "ERROR", "DEBUG", etc. | diff --git a/docs/usage/configuration/config_documentation.md b/docs/usage/configuration/config_documentation.md index 2946dbe45fe..3a213299de2 100644 --- a/docs/usage/configuration/config_documentation.md +++ b/docs/usage/configuration/config_documentation.md @@ -1466,7 +1466,9 @@ For more information on using Synapse with Postgres, see [here](../../postgres.m This setting has the following sub-options: -* `name` (string): This option specifies the database engine to use: either `sqlite3` (for SQLite) or `psycopg2` (for PostgreSQL). `psycopg` references the experimental psycopg3 driver, which may be used as a drop in replacement for `psycopg2`. If no name is specified Synapse will default to SQLite. Defaults to `"sqlite3"`. +* `name` (string): This option specifies the database engine to use: either `sqlite3` (for SQLite) or `postgres` (for PostgreSQL). `psycopg2` can be used for backwards compatibility for a specific driver. See the 'driver' section for more information. If no name is specified Synapse will default to SQLite. Defaults to `"sqlite3"`. + +* `driver` (string): The specific database library "driver" to use. The default for the SQLite based system is `sqlite3`. The default for the PostgreSQL based system is `psycopg2`. `psycopg` references the experimental psycopg3 driver, which may be used as a drop in replacement for `psycopg2`. This setting is not required as the `name` setting guides its default. Only set and change this if you know what you are doing! * `txn_limit` (integer): Gives the maximum number of transactions to run per connection before reconnecting. 0 means no limit. Defaults to `0`. @@ -1487,7 +1489,7 @@ database: ```yaml database: - name: psycopg2 + name: postgres txn_limit: 10000 args: user: synapse_user @@ -1498,6 +1500,20 @@ database: cp_min: 5 cp_max: 10 ``` + +```yaml +database: + name: postgres + driver: psycopg + args: + user: synapse_user + password: secretpassword + dbname: synapse + host: localhost + port: 5432 + cp_min: 5 + cp_max: 10 +``` --- ### `databases` @@ -1550,7 +1566,7 @@ Example configuration: ```yaml databases: basement_box: - name: psycopg2 + name: postgres txn_limit: 10000 data_stores: - main @@ -1563,7 +1579,7 @@ databases: cp_min: 5 cp_max: 10 my_other_database: - name: psycopg2 + name: postgres txn_limit: 10000 data_stores: - state diff --git a/schema/synapse-config.schema.yaml b/schema/synapse-config.schema.yaml index d625467e97a..c3c101cc32a 100644 --- a/schema/synapse-config.schema.yaml +++ b/schema/synapse-config.schema.yaml @@ -1818,7 +1818,7 @@ properties: - name: sqlite3 args: database: /path/to/homeserver.db - - name: psycopg2 + - name: postgres txn_limit: 10000 args: user: synapse_user @@ -1828,6 +1828,16 @@ properties: port: 5432 cp_min: 5 cp_max: 10 + - name: postgres + driver: psycopg + args: + user: synapse_user + password: secretpassword + dbname: synapse + host: localhost + port: 5432 + cp_min: 5 + cp_max: 10 databases: type: object description: >- @@ -1922,7 +1932,7 @@ properties: default: {} examples: - basement_box: - name: psycopg2 + name: postgres txn_limit: 10000 data_stores: - main @@ -1935,7 +1945,7 @@ properties: cp_min: 5 cp_max: 10 my_other_database: - name: psycopg2 + name: postgres txn_limit: 10000 data_stores: - state @@ -5880,13 +5890,26 @@ $defs: enum: - sqlite3 - psycopg2 - - psycopg + - postgres description: >- This option specifies the database engine to use: either `sqlite3` - (for SQLite) or `psycopg2` (for PostgreSQL). `psycopg` references the - experimental psycopg3 driver, which may be used as a drop in replacement - for `psycopg2`. If no name is specified Synapse will default to SQLite. + (for SQLite) or `postgres` (for PostgreSQL). `psycopg2` can be used for + backwards compatibility for a specific driver. See the 'driver' section for + more information. If no name is specified Synapse will default to SQLite. default: sqlite3 + driver: + type: string + enum: + - sqlite3 + - psycopg2 + - psycopg + description: >- + The specific database library "driver" to use. The default for the SQLite + based system is `sqlite3`. The default for the PostgreSQL based system is + `psycopg2`. `psycopg` references the experimental psycopg3 driver, which may + be used as a drop in replacement for `psycopg2`. This setting is not required + as the `name` setting guides its default. Only set and change this if you + know what you are doing! txn_limit: type: integer description: >- From 274e7cc4c8cfa59dda91b95a594bdafa27a63417 Mon Sep 17 00:00:00 2001 From: Jason Little Date: Thu, 27 Nov 2025 07:29:27 -0600 Subject: [PATCH 3/4] Fix up for Complement. Caught an issue where worker mode would have only used psycopg2, fixed --- .github/workflows/tests.yml | 10 +++++----- docker/complement/conf/start_for_complement.sh | 2 +- docker/conf/homeserver.yaml | 3 ++- scripts-dev/complement.sh | 11 ++++++++--- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fcfa0bb4a32..e6cb690ac4d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -684,16 +684,16 @@ jobs: matrix: include: - arrangement: monolith - database: SQLite + database: sqlite - arrangement: monolith - database: Postgres + database: postgres - arrangement: workers - database: Postgres + database: postgres - arrangement: workers - database: Psycopg + database: psycopg steps: - name: Checkout synapse codebase @@ -721,7 +721,7 @@ jobs: COMPLEMENT_DIR=`pwd`/complement synapse/scripts-dev/complement.sh -p 1 -json 2>&1 | synapse/.ci/scripts/gotestfmt shell: bash env: - POSTGRES: ${{ (matrix.database == 'Postgres' || matrix.database == 'Psycopg') && matrix.database || '' }} + POSTGRES: ${{ (matrix.database == 'postgres' || matrix.database == 'psycopg') && matrix.database || '' }} WORKERS: ${{ (matrix.arrangement == 'workers') && 1 || '' }} name: Run Complement Tests diff --git a/docker/complement/conf/start_for_complement.sh b/docker/complement/conf/start_for_complement.sh index 7f40e7de5d3..f4cfecfa3d7 100755 --- a/docker/complement/conf/start_for_complement.sh +++ b/docker/complement/conf/start_for_complement.sh @@ -21,7 +21,7 @@ export SYNAPSE_REPORT_STATS=no case "$SYNAPSE_COMPLEMENT_DATABASE" in - postgres) + psycopg2) # Set postgres authentication details which will be placed in the homeserver config file export POSTGRES_DRIVER=psycopg2 export POSTGRES_PASSWORD=somesecret diff --git a/docker/conf/homeserver.yaml b/docker/conf/homeserver.yaml index 931586c990d..5ac3a2332d7 100644 --- a/docker/conf/homeserver.yaml +++ b/docker/conf/homeserver.yaml @@ -57,7 +57,8 @@ listeners: {% if POSTGRES_PASSWORD %} database: - name: "{{ POSTGRES_DRIVER or "psycopg2" }}" + name: "postgres" + driver: "{{ POSTGRES_DRIVER or "psycopg2" }}" args: user: "{{ POSTGRES_USER or "synapse" }}" password: "{{ POSTGRES_PASSWORD }}" diff --git a/scripts-dev/complement.sh b/scripts-dev/complement.sh index 7c646683de1..88c2bb09d6e 100755 --- a/scripts-dev/complement.sh +++ b/scripts-dev/complement.sh @@ -270,8 +270,13 @@ main() { # Pass through the workers defined. If none, it will be an empty string export PASS_SYNAPSE_WORKER_TYPES="$WORKER_TYPES" - # Workers can only use Postgres as a database. - export PASS_SYNAPSE_COMPLEMENT_DATABASE=postgres + # Workers can only use Postgres as a database. If a specific driver is + # not requested, fallback to psycopg2 as a default + if [[ "$POSTGRES" = "psycopg" ]]; then + export PASS_SYNAPSE_COMPLEMENT_DATABASE=psycopg + else + export PASS_SYNAPSE_COMPLEMENT_DATABASE=psycopg2 + fi # And provide some more configuration to complement. @@ -284,7 +289,7 @@ main() { if [[ "$POSTGRES" = "psycopg" ]]; then export PASS_SYNAPSE_COMPLEMENT_DATABASE=psycopg elif [[ -n "$POSTGRES" ]]; then - export PASS_SYNAPSE_COMPLEMENT_DATABASE=postgres + export PASS_SYNAPSE_COMPLEMENT_DATABASE=psycopg2 else export PASS_SYNAPSE_COMPLEMENT_DATABASE=sqlite fi From 009b4d3e2d18c77bbfc5448c0e3623adbbea22e5 Mon Sep 17 00:00:00 2001 From: Jason Little Date: Wed, 3 Dec 2025 21:18:25 -0600 Subject: [PATCH 4/4] Experiment to try and make the module load --- poetry.lock | 37 +++++++++++++++++++++++++------------ pyproject.toml | 4 ++-- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/poetry.lock b/poetry.lock index 18088d4f927..11227353e63 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1719,28 +1719,41 @@ twisted = ["twisted"] [[package]] name = "psycopg" -version = "3.2.10" +version = "3.3.1" description = "PostgreSQL database adapter for Python" optional = true -python-versions = ">=3.8" +python-versions = ">=3.10" groups = ["main"] -markers = "extra == \"psycopg\" or extra == \"all\"" +markers = "extra == \"all\" or extra == \"psycopg-dev\"" files = [ - {file = "psycopg-3.2.10-py3-none-any.whl", hash = "sha256:ab5caf09a9ec42e314a21f5216dbcceac528e0e05142e42eea83a3b28b320ac3"}, - {file = "psycopg-3.2.10.tar.gz", hash = "sha256:0bce99269d16ed18401683a8569b2c5abd94f72f8364856d56c0389bcd50972a"}, + {file = "psycopg-3.3.1-py3-none-any.whl", hash = "sha256:e44d8eae209752efe46318f36dd0fdf5863e928009338d736843bb1084f6435c"}, + {file = "psycopg-3.3.1.tar.gz", hash = "sha256:ccfa30b75874eef809c0fbbb176554a2640cc1735a612accc2e2396a92442fc6"}, ] [package.dependencies] +psycopg-c = {version = "3.3.1", optional = true, markers = "implementation_name != \"pypy\" and extra == \"c\""} typing-extensions = {version = ">=4.6", markers = "python_version < \"3.13\""} tzdata = {version = "*", markers = "sys_platform == \"win32\""} [package.extras] -binary = ["psycopg-binary (==3.2.10) ; implementation_name != \"pypy\""] -c = ["psycopg-c (==3.2.10) ; implementation_name != \"pypy\""] -dev = ["ast-comments (>=1.1.2)", "black (>=24.1.0)", "codespell (>=2.2)", "dnspython (>=2.1)", "flake8 (>=4.0)", "isort-psycopg", "isort[colors] (>=6.0)", "mypy (>=1.14)", "pre-commit (>=4.0.1)", "types-setuptools (>=57.4)", "types-shapely (>=2.0)", "wheel (>=0.37)"] +binary = ["psycopg-binary (==3.3.1) ; implementation_name != \"pypy\""] +c = ["psycopg-c (==3.3.1) ; implementation_name != \"pypy\""] +dev = ["ast-comments (>=1.1.2)", "black (>=24.1.0)", "codespell (>=2.2)", "cython-lint (>=0.16)", "dnspython (>=2.1)", "flake8 (>=4.0)", "isort-psycopg", "isort[colors] (>=6.0)", "mypy (>=1.19.0)", "pre-commit (>=4.0.1)", "types-setuptools (>=57.4)", "types-shapely (>=2.0)", "wheel (>=0.37)"] docs = ["Sphinx (>=5.0)", "furo (==2022.6.21)", "sphinx-autobuild (>=2021.3.14)", "sphinx-autodoc-typehints (>=1.12)"] pool = ["psycopg-pool"] -test = ["anyio (>=4.0)", "mypy (>=1.14)", "pproxy (>=2.7)", "pytest (>=6.2.5)", "pytest-cov (>=3.0)", "pytest-randomly (>=3.5)"] +test = ["anyio (>=4.0)", "mypy (>=1.19.0) ; implementation_name != \"pypy\"", "pproxy (>=2.7)", "pytest (>=6.2.5)", "pytest-cov (>=3.0)", "pytest-randomly (>=3.5)"] + +[[package]] +name = "psycopg-c" +version = "3.3.1" +description = "PostgreSQL database adapter for Python -- C optimisation distribution" +optional = true +python-versions = ">=3.10" +groups = ["main"] +markers = "(extra == \"all\" or extra == \"psycopg-dev\") and implementation_name != \"pypy\"" +files = [ + {file = "psycopg_c-3.3.1.tar.gz", hash = "sha256:0c49958297578e5dbf9a7e7dabe7a03cac0290b70dd612ece5fa9f10ae6a0dea"}, +] [[package]] name = "psycopg2" @@ -3201,7 +3214,7 @@ description = "Provider of IANA time zone data" optional = true python-versions = ">=2" groups = ["main"] -markers = "(extra == \"psycopg\" or extra == \"all\") and sys_platform == \"win32\"" +markers = "(extra == \"all\" or extra == \"psycopg-dev\") and sys_platform == \"win32\"" files = [ {file = "tzdata-2025.2-py2.py3-none-any.whl", hash = "sha256:1a403fada01ff9221ca8044d701868fa132215d84beb92242d9acd2147f667a8"}, {file = "tzdata-2025.2.tar.gz", hash = "sha256:b60a638fcc0daffadf82fe0f57e53d06bdec2f36c4df66280ae79bce6bd6f2b9"}, @@ -3381,7 +3394,7 @@ matrix-synapse-ldap3 = ["matrix-synapse-ldap3"] oidc = ["authlib"] opentracing = ["jaeger-client", "opentracing"] postgres = ["psycopg2", "psycopg2cffi", "psycopg2cffi-compat"] -psycopg = ["psycopg"] +psycopg-dev = ["psycopg"] redis = ["hiredis", "txredisapi"] saml2 = ["pysaml2"] sentry = ["sentry-sdk"] @@ -3392,4 +3405,4 @@ url-preview = ["lxml"] [metadata] lock-version = "2.1" python-versions = ">=3.10.0,<4.0.0" -content-hash = "d87721ecb99cd667b7bfd583e9aeccf8821fc8d1186575b43e7e8278e635ae8f" +content-hash = "8fba447b865d2b079949f9e0869733ee161f7c50cd93089783a79d65cb181de9" diff --git a/pyproject.toml b/pyproject.toml index 0dbb805acfe..4dfec4d0dcd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -104,7 +104,7 @@ postgres = [ "psycopg2cffi>=2.8;platform_python_implementation == 'PyPy'", "psycopg2cffi-compat==1.1;platform_python_implementation == 'PyPy'", ] -psycopg = ["psycopg>=3.1"] +psycopg-dev = ["psycopg[c] (>=3.1)"] saml2 = ["pysaml2>=4.5.0"] oidc = ["authlib>=0.15.1"] # systemd-python is necessary for logging to the systemd journal via @@ -140,7 +140,7 @@ all = [ "psycopg2cffi>=2.8;platform_python_implementation == 'PyPy'", "psycopg2cffi-compat==1.1;platform_python_implementation == 'PyPy'", # experimental psycopg for postgres - "psycopg>=3.1", + "psycopg[c] (>=3.1)", # saml2 "pysaml2>=4.5.0", # oidc and jwt