Skip to content

Commit

Permalink
server: Record package metadata tags in indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
elprans committed Oct 14, 2024
1 parent 4bf20ca commit 35e9971
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ dependencies = ["metapkg@git+https://github.com/edgedb/metapkg.git"]
requires = ["setuptools>=64", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"

[project.optional-dependencies]
dev = ['black', 'ruff', 'mypy']
server = [
"boto3-stubs[boto3,s3] ~= 1.35.40",
"python-debian ~= 0.1.49",
"semver ~= 3.0.2",
]

[tool.setuptools]
packages = { find = { include = ["edgedbpkg", "edgedbpkg.*"] } }
zip-safe = false
Expand Down
6 changes: 5 additions & 1 deletion server/process_incoming.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class Package(TypedDict):
architecture: str # x86_64
revision: str # 2020091300~nightly
build_date: str # 2023-12-14T21:30:16+00:00
tags: dict[str, str] # {extension: postgis}
installrefs: list[InstallRef]
installref: str

Expand Down Expand Up @@ -382,7 +383,7 @@ def append_artifact(
metadata["revision"],
)
version_details = metadata["version_details"]

tags = metadata.get("tags", {})
index_key = (metadata["name"], version_key, metadata["architecture"])
prev_pkg = packages.get(index_key)
if prev_pkg is not None:
Expand All @@ -404,6 +405,7 @@ def append_artifact(
"build_date",
"1970-01-01T00:00:00+00:00",
),
tags=tags,
architecture=metadata["architecture"],
installref=installref["ref"],
installrefs=[installref],
Expand All @@ -425,6 +427,8 @@ def load_index(idxfile: pathlib.Path) -> PackageIndex:
pkg["version_key"],
pkg["architecture"],
)
if "tags" not in pkg:
pkg["tags"] = {}
index[index_key] = Package(**pkg) # type: ignore

return index
Expand Down

0 comments on commit 35e9971

Please sign in to comment.