Use a default regex when possible (#205)

This commit is contained in:
Marc Wrobel
2023-12-01 21:08:11 +01:00
parent e97e261946
commit 750faaa64f
10 changed files with 20 additions and 35 deletions

View File

@@ -5,10 +5,6 @@ from common import dates
from common import endoflife
METHOD = "pypi"
DEFAULT_TAG_TEMPLATE = ( # Same as used in Ruby (update.rb)
"{{major}}{% if minor %}.{{minor}}{% if patch %}.{{patch}}{%endif%}{%endif%}"
)
REGEX = r"^(?:(\d+\.(?:\d+\.)*\d+))$"
def fetch_releases(pypi_id, regex):
@@ -38,7 +34,7 @@ def update_product(product_name, configs):
versions = {}
for config in configs:
config = {"regex": REGEX} | config
config = {"regex": endoflife.DEFAULT_VERSION_REGEX} | config
versions = versions | fetch_releases(config[METHOD], config["regex"])
endoflife.write_releases(product_name, versions)