From 65c528b29c0c3aa9b8e40b742d9030c619a45ec9 Mon Sep 17 00:00:00 2001 From: Elvis Pranskevichus Date: Thu, 9 Jan 2025 14:01:18 -0800 Subject: [PATCH] Add a variant of EdgeDB build that does not bundle Postgres --- edgedbpkg/edgedb/__init__.py | 69 ++++++++++++++++++++++++------------ 1 file changed, 47 insertions(+), 22 deletions(-) diff --git a/edgedbpkg/edgedb/__init__.py b/edgedbpkg/edgedb/__init__.py index e7e2c02..773edb0 100644 --- a/edgedbpkg/edgedb/__init__.py +++ b/edgedbpkg/edgedb/__init__.py @@ -1,6 +1,6 @@ from __future__ import annotations from typing import ( - Any, + Self, TYPE_CHECKING, ) @@ -37,7 +37,7 @@ ) -class EdgeDB(packages.BundledPythonPackage): +class EdgeDBNoPostgres(packages.BundledPythonPackage): title = "EdgeDB" ident = "edgedb-server" description = "Next generation graph-relational database" @@ -60,34 +60,22 @@ class EdgeDB(packages.BundledPythonPackage): artifact_requirements = { ">=2.0,<3.0.rc1": [ - "postgresql-edgedb (~= 14.0)", "python-edgedb (~= 3.10.0)", ], ">=3.0rc1,<4.0.dev1": [ - "postgresql-edgedb (~= 14.0)", "python-edgedb (~= 3.11.0)", - "pgext-pgvector (~= 0.4.0)", ], ">=4.0.dev1,<5.0.dev1": [ - "postgresql-edgedb (~= 15.0)", "python-edgedb (~= 3.11.0)", - "pgext-pgvector (~= 0.4.0)", ], ">=5.0.dev1,<6.0.dev8898": [ - "postgresql-edgedb (~= 16.0)", "python-edgedb (~= 3.12.0)", - "pgext-pgvector (~= 0.6.0)", ], ">=6.0.dev8898,<6.0.dev9001": [ - "postgresql-edgedb (~= 17.0)", "python-edgedb (~= 3.12.0)", - "pgext-pgvector (~= 0.7.0)", ], ">=6.0.dev9001": [ - "postgresql-edgedb (~= 17.0)", "python-edgedb (~= 3.12.0)", - "pgext-pgvector (~= 0.7.0)", - "pgext-edb-stat-statements", ], } @@ -101,31 +89,28 @@ class EdgeDB(packages.BundledPythonPackage): ">=3.0rc1,<4.0.dev1": [ "postgresql-edgedb (~= 14.0)", "python-edgedb (~= 3.11.0)", - "pgext-pgvector (~= 0.4.0)", "pyentrypoint (>=1.0.0)", "pypkg-setuptools (<70.2.0)", ], ">=4.0.dev1,<5.0.dev1": [ "postgresql-edgedb (~= 15.0)", "python-edgedb (~= 3.11.0)", - "pgext-pgvector (~= 0.4.0)", "pyentrypoint (>=1.0.0)", "pypkg-setuptools (<70.2.0)", ], ">=5.0.dev1,<6.0.dev8898": [ "postgresql-edgedb (~= 16.0)", "python-edgedb (~= 3.12.0)", - "pgext-pgvector (~= 0.6.0)", "pyentrypoint (>=1.0.0)", "pypkg-setuptools (<70.2.0)", ], ">=6.0.dev8898": [ "postgresql-edgedb (~= 17.0)", "python-edgedb (~= 3.12.0)", - "pgext-pgvector (~= 0.7.0)", "pyentrypoint (>=1.0.0)", "pypkg-setuptools (<70.2.0)", "libprotobuf-c-dev (>=1.5.0)", # for libpg_query + "pgext-edb-stat-statements", ], } @@ -138,9 +123,6 @@ class EdgeDB(packages.BundledPythonPackage): python_bundle.Python(version="3.11.8"), python_bundle.Python(version="3.12.2"), pyentrypoint.PyEntryPoint(version="1.0.0"), - pgvector.PgVector("v0.4.2"), - pgvector.PgVector("v0.6.0"), - pgvector.PgVector("v0.7.4"), libprotobuf_c.LibProtoBufC("1.5.0"), edb_stat_statements.StatStatements("v6.0b1"), ] @@ -183,7 +165,7 @@ def resolve( is_release: bool = False, target: targets.Target, requires: list[poetry_dep.Dependency] | None = None, - ) -> EdgeDB: + ) -> Self: os.environ["EDGEDB_BUILD_OFFICIAL"] = "yes" os.environ["EDGEDB_BUILD_TARGET"] = ( base64.b32encode(target.triple.encode()) @@ -649,6 +631,49 @@ def get_provided_packages( return [("edgedb-server-catalog", catver)] +class EdgeDB(EdgeDBNoPostgres): + _artifact_requirements = { + ">=2.0,<3.0.rc1": [ + "postgresql-edgedb (~= 14.0)", + ], + ">=3.0rc1,<4.0.dev1": [ + "postgresql-edgedb (~= 14.0)", + "pgext-pgvector (~= 0.4.0)", + ], + ">=4.0.dev1,<5.0.dev1": [ + "postgresql-edgedb (~= 15.0)", + "pgext-pgvector (~= 0.4.0)", + ], + ">=5.0.dev1,<6.0.dev8898": [ + "postgresql-edgedb (~= 16.0)", + "pgext-pgvector (~= 0.6.0)", + ], + ">=6.0.dev8898,<6.0.dev9001": [ + "postgresql-edgedb (~= 17.0)", + "pgext-pgvector (~= 0.7.0)", + ], + ">=6.0.dev9001": [ + "postgresql-edgedb (~= 17.0)", + "pgext-pgvector (~= 0.7.0)", + "pgext-edb-stat-statements", + ], + } + artifact_requirements = { + k: v + EdgeDBNoPostgres.artifact_requirements[k] + for k, v in _artifact_requirements.items() + } + + bundle_deps = EdgeDBNoPostgres.bundle_deps + [ + postgresql.PostgreSQL(version="14.11"), + postgresql.PostgreSQL(version="15.6"), + postgresql.PostgreSQL(version="16.4"), + postgresql.PostgreSQL(version="17.0"), + pgvector.PgVector("v0.4.2"), + pgvector.PgVector("v0.6.0"), + pgvector.PgVector("v0.7.4"), + ] + + class Cryptography(packages.PythonPackage): def sh_get_build_wheel_env( self, build: targets.Build, *, site_packages: str, wd: str