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()
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 = {
"uuid": "12345678-1234-5678-1234-567812345678",
"organisation": "InterDiode",
@@ -97,12 +97,12 @@ def test_apply_escapes_non_bmp_characters_as_valid_toml(tmp_path) -> None:
PythonModule().apply(context)
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
# UTF-16 surrogate pair (😀), which is valid JSON but not
# valid TOML (TOML's \uXXXX must be a Unicode scalar value on its own).
assert '"demo 😀"' in uv_toml
# The emoji isn't a plain identifier character, so sanitize_repository_name
# replaces it (and the space before it) with "_", same as every other
# non-ASCII or syntax-breaking character.
assert '"demo__"' in 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:
Generated
+1 -1
View File
@@ -424,7 +424,7 @@ dependencies = [
]
name = "id-configurator"
source = {editable = "."}
version = "2026.10.6"
version = "2026.10.9"
[package.dev-dependencies]
dev = [