Skip to content

Commit ce85742

Browse files
authored
Use wipac-dev-tools[semvar] (#2)
* rm latest_python3.py * rm max_python3.py * use `wipac-dev-tools[semvar]` * echo * export var
1 parent b0d7a23 commit ce85742

File tree

4 files changed

+15
-78
lines changed

4 files changed

+15
-78
lines changed

action.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,20 @@ runs:
7575
export ACTION_REPOSITORY="WIPACrepo/wipac-dev-py-setup-action"
7676
7777
# get python3 version (max)
78-
SEMVAR_RANGE=$(grep "python_requires =" -h setup.cfg | awk -F 'python_requires =' '{print $2}')
79-
export PACKAGE_MAX_PYTHON_VERSION=$(python3 ${{ github.action_path }}/utils/max_python3.py "$SEMVAR_RANGE")
78+
export SEMVAR_RANGE=$(grep "python_requires =" -h setup.cfg | awk -F 'python_requires =' '{print $2}')
79+
echo $SEMVAR_RANGE
80+
export PACKAGE_MAX_PYTHON_VERSION=$(python -c '
81+
import os
82+
from wipac_dev_tools import semvar_parser_tools
83+
top_python = semvar_parser_tools.get_latest_py3_release()
84+
all_matches = semvar_parser_tools.list_all_majmin_versions(
85+
major=top_python[0],
86+
semvar_range=os.environ["SEMVAR_RANGE"],
87+
max_minor=top_python[1],
88+
)
89+
print(f"{max(all_matches)[0]}.{max(all_matches)[1]}")
90+
')
91+
echo $PACKAGE_MAX_PYTHON_VERSION
8092
8193
# Build
8294
if [ -f ./Dockerfile ]; then

requirements.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
requests
2-
semantic-version
3-
wipac-dev-tools
1+
wipac-dev-tools[semvar]

utils/latest_python3.py

Lines changed: 0 additions & 30 deletions
This file was deleted.

utils/max_python3.py

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)