Use a default regex when possible (#205)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user