-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Is your feature request related to a problem? Please describe
The current process of updating the Kaggle Wheel that is used for the Public Leaderboard, requires one of the member to manually create the custom wheel each time an update is released. This is takes quite a bit of time and we might miss it from time to time as new updates come out.
Describe the solution you'd like
Creating a GitHub Actions that goes through and creates the custom wheel and setup a PR for it similar to Dependabot.
For all this to work, we will make use of the pypi.org api to pull the latest release
-
Collect the
filenameandreleaseURLfilename=$(curl -s https://pypi.org/simple/kaggle/ | sed -n 's/.*<a[^>]*>\(.*\)<\/a>.*/\1/p' | tail -n 1) releaseURL=$(curl -s https://pypi.org/simple/kaggle/ | grep -oP '(?<=<a href=").*?(?=" >)' | tail -n 1)
-
Check if
$(basename $filename .tar.gz)-py3-none-any.whlexists inwheels- If file exists, then send a message stating:
Latest Version Existsand STOP - If file does not exist, STEP 3
- If file exists, then send a message stating:
-
Download and unzip the latest release
curl -L $releaseURL > release.tar.gz tar -xvzf release.tar.gz
-
Check if a specific line of code exists at a specific line number in
kaggle/api/kaggle_api_extended.pysed -n "1837p" "$(basename $filename .tar.gz)/kaggle/api/kaggle_api_extended.py" | grep -Fxq " remote_date = datetime.strptime(response.headers['Last-Modified']," && echo "Found" || echo "Not found"
- We are trying to verify if the line causing the bug has been resolved or not.
- If it does not exist then send a message stating:
Verify new changes in this releaseand STOP - If it does exist, then STEP 5
-
Make the line change
sed -i "1837s/.*/ remote_date = datetime.strptime(response.headers['Date'],/" "$(basename $filename .tar.gz)/kaggle/api/kaggle_api_extended.py"
-
Build the Python Wheel
python -m build --wheel
-
Create a new branch that includes the new wheel file