Compare commits

...
3 Commits
Author SHA1 Message Date
devx-ci-bot f339df3562 release: v0.45.1 [skip ci] 2026-07-14 12:35:27 +00:00
emil db38453a54 DEVX-139: fix: URL-encode package names and versions in clean_images API calls
Post-merge / detect-and-configure (push) Successful in 18s
Post-merge / release-and-maintain (push) Successful in 1m9s
2026-07-14 12:34:35 +00:00
gitea-actions-bot 5d78377152 chore: update badge URLs to commit 5a9243cc [skip ci] 2026-07-14 01:22:38 +00:00
6 changed files with 42 additions and 22 deletions
+6
View File
@@ -2,6 +2,12 @@
All notable changes to this project will be documented in this file.
## [0.45.1] - 2026-07-14
### Bug Fixes
- URL-encode package names and versions in clean_images API calls
## [0.45.0] - 2026-07-14
### Features
+9 -9
View File
@@ -16,12 +16,12 @@ quality badges.
[![CI](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions/workflows/ci.yml/badge.svg)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
[![License: GPL-3.0](https://img.shields.io/badge/license-GPL--3.0-blue)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/src/branch/master/LICENSE)
[![Coverage](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/6ee532d4c43005a77f1e3dd0e62b81fe6262552b/coverage.svg)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
[![Tests](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/6ee532d4c43005a77f1e3dd0e62b81fe6262552b/tests.svg)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
[![Docs](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/6ee532d4c43005a77f1e3dd0e62b81fe6262552b/docs.svg)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/wiki)
[![Code Quality](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/6ee532d4c43005a77f1e3dd0e62b81fe6262552b/quality.svg)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
[![Version](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/6ee532d4c43005a77f1e3dd0e62b81fe6262552b/version.svg)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/releases)
[![Python](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/6ee532d4c43005a77f1e3dd0e62b81fe6262552b/python.svg)](https://www.python.org/downloads/)
[![Coverage](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/5a9243cc071edcccb12a47208a632e903e29adf7/coverage.svg)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
[![Tests](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/5a9243cc071edcccb12a47208a632e903e29adf7/tests.svg)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
[![Docs](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/5a9243cc071edcccb12a47208a632e903e29adf7/docs.svg)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/wiki)
[![Code Quality](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/5a9243cc071edcccb12a47208a632e903e29adf7/quality.svg)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
[![Version](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/5a9243cc071edcccb12a47208a632e903e29adf7/version.svg)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/releases)
[![Python](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/5a9243cc071edcccb12a47208a632e903e29adf7/python.svg)](https://www.python.org/downloads/)
## Why devx?
@@ -87,7 +87,7 @@ extra index and list devx in your dependencies:
```toml
[project]
dependencies = [
"devx>=0.45.0",
"devx>=0.45.1",
]
[tool.pip]
@@ -101,8 +101,8 @@ pip install -e .
```
> **Note:** If your project requires a specific devx version, pin it in
> `dependencies` (for example, `"devx==0.45.0"`) or use a version constraint
> (for example, `"devx>=0.45.0,<0.46"`).
> `dependencies` (for example, `"devx==0.45.1"`) or use a version constraint
> (for example, `"devx>=0.45.1,<0.46"`).
### Optional extras
+8 -8
View File
@@ -12,12 +12,12 @@ project to be reusable across all oblachno-oss repositories.
[![CI](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions/workflows/ci.yml/badge.svg)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
[![License: GPL-3.0](https://img.shields.io/badge/license-GPL--3.0-blue)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/src/branch/master/LICENSE)
[![Coverage](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/6ee532d4c43005a77f1e3dd0e62b81fe6262552b/coverage.svg)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
[![Tests](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/6ee532d4c43005a77f1e3dd0e62b81fe6262552b/tests.svg)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
[![Docs](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/6ee532d4c43005a77f1e3dd0e62b81fe6262552b/docs.svg)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/wiki)
[![Code Quality](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/6ee532d4c43005a77f1e3dd0e62b81fe6262552b/quality.svg)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
[![Version](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/6ee532d4c43005a77f1e3dd0e62b81fe6262552b/version.svg)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/releases)
[![Python](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/6ee532d4c43005a77f1e3dd0e62b81fe6262552b/python.svg)](https://www.python.org/downloads/)
[![Coverage](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/5a9243cc071edcccb12a47208a632e903e29adf7/coverage.svg)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
[![Tests](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/5a9243cc071edcccb12a47208a632e903e29adf7/tests.svg)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
[![Docs](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/5a9243cc071edcccb12a47208a632e903e29adf7/docs.svg)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/wiki)
[![Code Quality](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/5a9243cc071edcccb12a47208a632e903e29adf7/quality.svg)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/actions)
[![Version](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/5a9243cc071edcccb12a47208a632e903e29adf7/version.svg)](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/releases)
[![Python](https://git.oblachno.oblachno.fyi/oblachno-oss/devx/raw/commit/5a9243cc071edcccb12a47208a632e903e29adf7/python.svg)](https://www.python.org/downloads/)
## Overview
@@ -74,14 +74,14 @@ Add devx to your `pyproject.toml` dependencies and configure the registry:
```toml
[project]
dependencies = [
"devx>=0.45.0",
"devx>=0.45.1",
]
[tool.pip]
extra-index-url = "https://git.oblachno.oblachno.fyi/api/packages/oblachno-oss/pypi/simple"
```
Pin a specific version if needed: `"devx==0.45.0"` or `"devx>=0.45.0,<0.46"`.
Pin a specific version if needed: `"devx==0.45.1"` or `"devx>=0.45.1,<0.46"`.
### Optional extras
+2 -2
View File
@@ -48,12 +48,12 @@ Add devx to your `pyproject.toml`:
```toml
[project]
dependencies = [
"devx>=0.45.0",
"devx>=0.45.1",
]
[project.optional-dependencies]
dev = [
"devx>=0.45.0",
"devx>=0.45.1",
]
```
+1 -1
View File
@@ -1,3 +1,3 @@
"""devx — reusable development and CI/CD tools for oblachno-oss projects."""
__version__ = "0.45.0"
__version__ = "0.45.1"
+16 -2
View File
@@ -5,6 +5,13 @@ Queries the Gitea API for all versions of a package (container type) and
deletes all but the most recent N versions. The ``latest`` tag is always
preserved if present.
.. note::
This tool only deletes package versions via the Gitea API. The underlying
blob files on the Gitea server's filesystem are NOT removed by this tool
(Gitea 1.26.x has no built-in garbage collection). The production VM's
daily cleanup script (``cleanup_gitea.py``) handles filesystem blob GC
by querying the database for referenced blobs and removing orphaned files.
Usage::
# Clean up ci-base images, keep last 2 versions
@@ -57,7 +64,10 @@ def list_package_versions(
Returns a list of version dicts, each containing at least ``version``
and ``created_at`` fields.
"""
url = f"{api_url}/packages/{owner}?type=container&name={name}"
from urllib.parse import quote
encoded_name = quote(name, safe="")
url = f"{api_url}/packages/{owner}?type=container&name={encoded_name}"
headers = {"Authorization": f"token {token}"}
all_versions: list[dict[str, Any]] = []
page = 1
@@ -96,7 +106,11 @@ def delete_package_version(
Returns True on success, False on failure.
"""
url = f"{api_url}/packages/{owner}/{package_type}/{name}/{version}"
from urllib.parse import quote
encoded_name = quote(name, safe="")
encoded_version = quote(version, safe="")
url = f"{api_url}/packages/{owner}/{package_type}/{encoded_name}/{encoded_version}"
headers = {"Authorization": f"token {token}"}
for attempt in range(max_retries):
try: