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:
45
45
required : true
46
46
default : ' 10'
47
47
48
+ exclude_versions :
49
+ description : ' A comma separated list of versions to exclude.'
50
+ required : true
51
+ default : ' '
52
+
48
53
include_prereleases :
49
54
description : ' If set to true prereleases (alpha, beta, rc) will also be built.'
50
55
required : true
68
73
env :
69
74
MAX_VERSIONS : ${{ inputs.max_versions }}
70
75
INCLUDE_PRERELEASE : ${{ inputs.include_prereleases }}
76
+ EXCLUDE_VERSIONS : ${{ inputs.exclude_versions }}
71
77
72
78
- name : Update Python Versions
73
79
shell : bash
90
96
REPOSITORY : ${{ inputs.repository }}
91
97
INCLUDE_PRERELEASE : ${{ inputs.include_prereleases }}
92
98
BUILDER_WORKFLOW_PATH : ${{ inputs.action_path }}
99
+ EXCLUDE_VERSIONS : ${{ inputs.exclude_versions }}
93
100
94
101
- name : " Push"
95
102
shell : bash
Original file line number Diff line number Diff line change 6
6
7
7
PACKAGE = sys .argv [1 ]
8
8
MAX_VERSIONS = sys .argv [2 ] if len (sys .argv ) > 2 else 10
9
+ EXCLUDE_VERSIONS = os .environ .get ("EXCLUDE_VERSIONS" , "" ).split ("," )
9
10
10
11
# Load PyPI website for the package
11
12
fp = urllib .request .urlopen (f"https://pypi.org/simple/{ PACKAGE } /" )
15
16
# Pick a regex- either include prerelease versions or not
16
17
if os .environ .get ("INCLUDE_PRERELEASE" , False ) == 'true' :
17
18
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 ]
19
20
else :
20
21
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 ]
22
23
23
24
unique_versions = list (dict .fromkeys (versions ))
24
25
You can’t perform that action at this time.
0 commit comments