File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 77import tempfile
88import shutil
99import subprocess
10+ import re
11+
1012from packaging import Package , Mapping
1113
14+ SEMVER_PREFIX = re .compile (r"^\d+.\d+.\d+" )
1215
1316class NugetPackage (Package ):
1417 """ All platforms, archs, et.al, are bundled into one set of
@@ -253,9 +256,9 @@ class NugetPackage (Package):
253256 def __init__ (self , version , arts ):
254257 if version .startswith ('v' ):
255258 version = version [1 :] # Strip v prefix
256- # PR-only workaround: if version doesn't start with a digit ,
257- # turn it into a prerelease of 0.0.0 so NuGet accepts it.
258- if not version [ 0 ]. isdigit ( ):
259+ # PR-only workaround: if it's not a normal semver like 1.2.3... ,
260+ # wrap it as 0.0.0-<tag>
261+ if not SEMVER_PREFIX . match ( version ):
259262 version = f"0.0.0-{ version } "
260263 super (NugetPackage , self ).__init__ (version , arts )
261264
You can’t perform that action at this time.
0 commit comments