File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,11 @@ inputs:
4545 required : true
4646 default : ' 10'
4747
48+ exclude_versions :
49+ description : ' A comma separated list of versions to exclude.'
50+ required : true
51+ default : ' '
52+
4853 include_prereleases :
4954 description : ' If set to true prereleases (alpha, beta, rc) will also be built.'
5055 required : true
6873 env :
6974 MAX_VERSIONS : ${{ inputs.max_versions }}
7075 INCLUDE_PRERELEASE : ${{ inputs.include_prereleases }}
76+ EXCLUDE_VERSIONS : ${{ inputs.exclude_versions }}
7177
7278 - name : Update Python Versions
7379 shell : bash
9096 REPOSITORY : ${{ inputs.repository }}
9197 INCLUDE_PRERELEASE : ${{ inputs.include_prereleases }}
9298 BUILDER_WORKFLOW_PATH : ${{ inputs.action_path }}
99+ EXCLUDE_VERSIONS : ${{ inputs.exclude_versions }}
93100
94101 - name : " Push"
95102 shell : bash
Original file line number Diff line number Diff line change 66
77PACKAGE = sys .argv [1 ]
88MAX_VERSIONS = sys .argv [2 ] if len (sys .argv ) > 2 else 10
9+ EXCLUDE_VERSIONS = os .environ .get ("EXCLUDE_VERSIONS" , "" ).split ("," )
910
1011# Load PyPI website for the package
1112fp = urllib .request .urlopen (f"https://pypi.org/simple/{ PACKAGE } /" )
1516# Pick a regex- either include prerelease versions or not
1617if os .environ .get ("INCLUDE_PRERELEASE" , False ) == 'true' :
1718 version_regex = re .compile (r'-(\d+\.\d+\.\d+(a|b|rc)?\d?).+[\.whl|\.tar\.gz]' )
18- versions = [x [0 ] for x in version_regex .findall (html_string )]
19+ versions = [x [0 ] for x in version_regex .findall (html_string ) if x [ 0 ] not in EXCLUDE_VERSIONS ]
1920else :
2021 version_regex = re .compile (r'-(\d+\.\d+\.\d+).+[\.whl|\.tar\.gz]' )
21- versions = version_regex .findall (html_string )
22+ versions = [ x for x in version_regex .findall (html_string ) if x not in EXCLUDE_VERSIONS ]
2223
2324unique_versions = list (dict .fromkeys (versions ))
2425
You can’t perform that action at this time.
0 commit comments