Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate Custom Kaggle Wheels Builds #10

Open
ShawnGeorge03 opened this issue Feb 16, 2024 · 0 comments
Open

Automate Custom Kaggle Wheels Builds #10

ShawnGeorge03 opened this issue Feb 16, 2024 · 0 comments

Comments

@ShawnGeorge03
Copy link
Contributor

ShawnGeorge03 commented Feb 16, 2024

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

  1. Collect the filename and releaseURL

    filename=$(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)
  2. Check if $(basename $filename .tar.gz)-py3-none-any.whl exists in wheels

    • If file exists, then send a message stating: Latest Version Exists and STOP
    • If file does not exist, STEP 3
  3. Download and unzip the latest release

    curl -L $releaseURL > release.tar.gz
    
    tar -xvzf release.tar.gz
  4. Check if a specific line of code exists at a specific line number in kaggle/api/kaggle_api_extended.py

    sed -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 release and STOP
    • If it does exist, then STEP 5
  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"
  6. Build the Python Wheel

    python -m build --wheel
  7. Create a new branch that includes the new wheel file

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant