Skip to content

Replace dashes in FreeType version - #10406

Merged
hugovk merged 3 commits into
python-pillow:mainfrom
radarhere:freetype
Nov 3, 2026
Merged

hugovk merged 3 commits into
python-pillow:mainfrom
radarhere:freetype

Conversation

@radarhere

Copy link
Copy Markdown
Member

#10396 initially tried updating FreeType to '2-15-0', because that the tag at https://gitlab.freedesktop.org/freetype/freetype/-/tags is 'VER-2-15-0'. For today, I manually updated the PR with '2.15.0'

As for a better long-term solution, my attempts to persuade Renovate to replace dashes with dots were unsuccessful, and judging from renovatebot/renovate#38698, this is an open problem. What if instead, we let Renovate write the dashed version in dependencies.json, and replace the dashes when we extract the version?

@hugovk

hugovk commented Nov 3, 2026

Copy link
Copy Markdown
Member

We'd also need to replace dashes in a third consumer, in generate-sbom.py.


Here's a possible alternative to fix it in the producer, in Renovate, something like this:

diff --git a/.github/renovate.json b/.github/renovate.json
index f26109f29..42e260f7b 100644
--- a/.github/renovate.json
+++ b/.github/renovate.json
@@ -11,6 +11,14 @@
     "schedule": [
         "* * 3 * *"
     ],
+    "customDatasources": {
+        "freetype": {
+            "defaultRegistryUrlTemplate": "https://gitlab.freedesktop.org/api/v4/projects/freetype%2Ffreetype/repository/tags?per_page=100",
+            "transformTemplates": [
+                "{\"releases\": $map($[$match(name, /^VER-\\d+-\\d+-\\d+$/)], function($tag) { {\"version\": $replace($substringAfter($tag.name, \"VER-\"), \"-\", \".\"), \"releaseTimestamp\": $tag.created_at} }), \"sourceUrl\": \"https://gitlab.freedesktop.org/freetype/freetype\"}"
+            ]
+        }
+    },
     "customManagers": [
         {
             "customType": "regex",
@@ -35,11 +43,8 @@
             "managerFilePatterns": ["/^\\.github/dependencies\\.json$/"],
             "matchStrings": ["\"freetype\":\\s*\"(?<currentValue>\\d+[^\"]*)\""],
             "depNameTemplate": "freetype",
-            "packageNameTemplate": "freetype/freetype",
-            "datasourceTemplate": "gitlab-tags",
-            "registryUrlTemplate": "https://gitlab.freedesktop.org",
-            "extractVersionTemplate": "^VER-(?<version>[\\d-]+)$",
-            "versioningTemplate": "regex:^(?<major>\\d+)[.-](?<minor>\\d+)[.-](?<patch>\\d+)$"
+            "datasourceTemplate": "custom.freetype",
+            "versioningTemplate": "semver"
         },
         {
             "customType": "regex",

A benefit would be that dependencies.json has dots not dashes, and any future consumers of it also don't need to replace. But it's not very pretty.


I don't have a strong preference, which would you prefer?

@radarhere

Copy link
Copy Markdown
Member Author

My preference would be for the current strategy - while the changes are more scattered, it's still simpler overall, and doesn't involve a third-party schema anymore than we need to.

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@hugovk
hugovk enabled auto-merge (squash) November 3, 2026 11:59
@hugovk
hugovk merged commit 24e2673 into python-pillow:main Nov 3, 2026
67 of 68 checks passed
@radarhere
radarhere deleted the freetype branch November 3, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants