Skip to content

Commit

Permalink
Add a variant of EdgeDB build that does not bundle Postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
elprans committed Jan 9, 2025
1 parent 6449b72 commit 65c528b
Showing 1 changed file with 47 additions and 22 deletions.
69 changes: 47 additions & 22 deletions edgedbpkg/edgedb/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations
from typing import (
Any,
Self,
TYPE_CHECKING,
)

Expand Down Expand Up @@ -37,7 +37,7 @@
)


class EdgeDB(packages.BundledPythonPackage):
class EdgeDBNoPostgres(packages.BundledPythonPackage):
title = "EdgeDB"
ident = "edgedb-server"
description = "Next generation graph-relational database"
Expand All @@ -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",
],
}

Expand All @@ -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",
],
}

Expand All @@ -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"),
]
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 65c528b

Please sign in to comment.