feat: update repository names to support special characters in configuration files

Signed-off-by: d9pouces <github@19pouces.net>
This commit is contained in:
d9pouces
2026-10-09 20:22:26 +02:00
parent e58820ac98
commit 0f019ac6ea
2 changed files with 7 additions and 7 deletions
+6 -6
View File
@@ -78,7 +78,7 @@ def test_apply_single_repository(tmp_path) -> None:
assert not (dst / "usr/lib").exists() assert not (dst / "usr/lib").exists()
def test_apply_escapes_non_bmp_characters_as_valid_toml(tmp_path) -> None: def test_apply_sanitizes_uv_index_name_with_non_bmp_characters(tmp_path) -> None:
data = { data = {
"uuid": "12345678-1234-5678-1234-567812345678", "uuid": "12345678-1234-5678-1234-567812345678",
"organisation": "InterDiode", "organisation": "InterDiode",
@@ -97,12 +97,12 @@ def test_apply_escapes_non_bmp_characters_as_valid_toml(tmp_path) -> None:
PythonModule().apply(context) PythonModule().apply(context)
uv_toml = (dst / "etc/uv/uv.toml").read_text(encoding="utf-8") uv_toml = (dst / "etc/uv/uv.toml").read_text(encoding="utf-8")
# json.dumps's default ensure_ascii=True would encode the emoji as a # The emoji isn't a plain identifier character, so sanitize_repository_name
# UTF-16 surrogate pair (😀), which is valid JSON but not # replaces it (and the space before it) with "_", same as every other
# valid TOML (TOML's \uXXXX must be a Unicode scalar value on its own). # non-ASCII or syntax-breaking character.
assert '"demo 😀"' in uv_toml assert '"demo__"' in uv_toml
parsed = tomllib.loads(uv_toml) parsed = tomllib.loads(uv_toml)
assert parsed["index"][0]["name"] == "demo 😀" assert parsed["index"][0]["name"] == "demo__"
def test_apply_adds_trusted_host_for_non_https_repository(tmp_path) -> None: def test_apply_adds_trusted_host_for_non_https_repository(tmp_path) -> None:
Generated
+1 -1
View File
@@ -424,7 +424,7 @@ dependencies = [
] ]
name = "id-configurator" name = "id-configurator"
source = {editable = "."} source = {editable = "."}
version = "2026.10.6" version = "2026.10.9"
[package.dev-dependencies] [package.dev-dependencies]
dev = [ dev = [