Skip to content

Commit 8e9ab6d

Browse files
gerrod3cursoragent
andcommitted
Fix python_version parsing for workers with hyphens in their hostname
(cherry picked from commit 6ba5940) Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent bd621f8 commit 8e9ab6d

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

CHANGES/+py-version-parsing.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed a bug where the `python_version` field was not parsed correctly when Pulp workers had hyphens in their name.

pulp_python/app/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
import os
23
import re
34
import shutil
45
import tempfile
@@ -173,7 +174,7 @@ def get_project_metadata_from_artifact(filename, artifact):
173174
else:
174175
pyver = ""
175176
regex = DIST_REGEXES[extensions[pkg_type_index]]
176-
if bdist_name := regex.match(filename):
177+
if bdist_name := regex.match(os.path.basename(filename)):
177178
pyver = bdist_name.group("pyver") or ""
178179
metadata.python_version = pyver
179180
return metadata

0 commit comments

Comments
 (0)