Skip to content

Commit 2013a0d

Browse files
committed
ci: pull supported python versions from classifiers
1 parent e9da498 commit 2013a0d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ jobs:
5151
if [[ -n "${{ inputs.python-version }}" ]]; then
5252
echo "python-version=$(jq 'split(",")' -Rc <(echo '${{ inputs.python-version }}'))" >> $GITHUB_OUTPUT
5353
else
54-
min_ver=$(sed -rn '/^requires-python\s*=/ s/^.*=\s*">=([0-9](\.[0-9])*)(.*)/\1/p' pyproject.toml)
55-
if [[ -n ${min_ver} ]]; then
56-
echo "python-version=['${min_ver}', '3.x']" >> $GITHUB_OUTPUT
54+
# pull supported python versions from classifiers
55+
readarray -t vers < <(sed -rn '/Programming Language :: Python :: / s/.*([0-9]\.[0-9]+).*/\1/p' pyproject.toml)
56+
if [[ ${#vers[@]} -ge 2 ]]; then
57+
echo "python-version=['${vers[0]}', '${vers[-1]}']" >> $GITHUB_OUTPUT
5758
else
5859
exit 1
5960
fi

0 commit comments

Comments
 (0)