NFDI4BIOIMAGE / training

https://nfdi4bioimage.github.io/training
Creative Commons Attribution 4.0 International
10 stars 7 forks source link

python version setting: @V2 to @ V4 #291

Open SeverusYixin opened 4 days ago

SeverusYixin commented 4 days ago

Hi @haesleinhuepf,

seems to be the python version setting (@v2) in https://github.com/NFDI4BIOIMAGE/training/blob/2f3578e05b40c6a6aaf942003118a43bc12eaf1a/.github/workflows/auto-add-download-statistics.yml#L15

and here https://github.com/NFDI4BIOIMAGE/training/blob/2f3578e05b40c6a6aaf942003118a43bc12eaf1a/.github/workflows/auto-add-zenodo-entries.yml#L21

and here https://github.com/NFDI4BIOIMAGE/training/blob/2f3578e05b40c6a6aaf942003118a43bc12eaf1a/.github/workflows/git-bob.yml#L36

all of these are "actions/setup-python@v2", should i update all of them to "actions/setup-python@v4"?

Because currently the git run as 0s Run actions/setup-python@v2 Successfully setup CPython (3.12.7)

Best, Yixin

SeverusYixin commented 4 days ago

Can you give us some advice on the code: "# Install dependencies

and

" # Install dependencies

which is the better version of the V2 and the V4?

git-bob comment

github-actions[bot] commented 4 days ago

This message was generated by git-bob (version: 0.9.1, model: github_models:gpt-4o, log), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.

To update to version 4, change the Python setup lines in each of the relevant files as follows:

.github/workflows/auto-add-download-statistics.yml

- name: Set up Python
  uses: actions/setup-python@v4
  with:
    python-version: 3.x

.github/workflows/auto-add-zenodo-entries.yml

- name: Set up Python
  uses: actions/setup-python@v4
  with:
    python-version: 3.x

.github/workflows/git-bob.yml


- name: Set up Python
  uses: actions/setup-python@v4
  with:
    python-version: 3.x
SeverusYixin commented 4 days ago

It doesn't seem very smart, or am I using it the wrong way? But still interesting XD

haesleinhuepf commented 4 days ago

I may not know "which is the better version of the V2 and the V4?" And how do you define "better"? Also you should write more well-written sentences to ask what it should do.

git-bob comment on these aspect:

github-actions[bot] commented 4 days ago

This message was generated by git-bob (version: 0.9.1, model: github_models:gpt-4o, log), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.

To address the issue of updating the Python version in the GitHub Actions workflows, you can replace actions/setup-python@ v2 with actions/setup-python@ v4 in the specified files. Here's a proposal for the updated code in each file:

.github/workflows/auto-add-download-statistics.yml

- name: Set up Python
  uses: actions/setup-python@v4
  with:
    python-version: 3.x

.github/workflows/auto-add-zenodo-entries.yml

- name: Set up Python
  uses: actions/setup-python@v4
  with:
    python-version: 3.x

.github/workflows/git-bob.yml

- name: Set up Python
  uses: actions/setup-python@v4
  with:
    python-version: 3.x

Answers to Questions:

  1. What does actions/setup-python@ v4 in a GitHub workflow do?

    • It sets up the Python environment for use in GitHub Actions, allowing you to specify the version of Python you want to use.
  2. Do you know what makes it different compared to actions/setup-python@ v2?

  3. Which version is newer, V2 or V4?

    • V4 is newer than V2.
haesleinhuepf commented 4 days ago

These answers seem reasonable to me @SeverusYixin . I should maybe update git-bob to not answer stuff that has been answered before already.

SeverusYixin commented 4 days ago

These answers seem reasonable to me @SeverusYixin . I should maybe update git-bob to not answer stuff that has been answered before already.

So, should I update the relevant code ?

haesleinhuepf commented 4 days ago

It was already done. Let's test see if it works:

git-bob comment on:

github-actions[bot] commented 4 days ago

This message was generated by git-bob (version: 0.9.2, model: github_models:gpt-4o, log), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.

I'm unable to review or analyze the Python scripts in the scripts folder as per the request. Could you please tag @haesleinhuepf for insight on the specific functionalities and potential reorganization strategies for these scripts?

SeverusYixin commented 4 days ago

hmm, but it was still "uses: actions/setup-python@v2" in the script

haesleinhuepf commented 4 days ago

Ah sure. Go ahead. Thanks for working on this!

SeverusYixin commented 4 days ago

in the code of

training/.github/workflows/auto-add-download-statistics.yml

Line 15 in 2f3578e

training/.github/workflows/auto-add-zenodo-entries.yml

Line 21 in 2f3578e

uses: actions/setup-python@v2 and here

training/.github/workflows/git-bob.yml

Line 36 in 2f3578e

uses: actions/setup-python@v2 all of these are "actions/setup-python@v2". They all still use "actions/setup-python@v2", update them to "uses: actions/setup-python@v4" with code comments.

git-bob implement this!

github-actions[bot] commented 4 days ago

This message was generated by git-bob (version: 0.9.2, model: github_models:gpt-4o, log), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.

Error creating pull-request: 422 {"message": "Validation Failed", "errors": [{"resource": "PullRequest", "code": "custom", "message": "No commits between main and git-bob-mod-zVOu3IeRXD"}], "documentation_url": "https://docs.github.com/rest/pulls/pulls#create-a-pull-request", "status": "422"}

During solving this task, the following errors occurred:

haesleinhuepf commented 4 days ago

As git-bob is a github workflow, it is not allowed to modify github-workflows

SeverusYixin commented 4 days ago

As git-bob is a github workflow, it is not allowed to modify github-workflows

Hmmm, question, perhaps a little rude, are you git-bob or Robert XD, how can you answer so quickly when everytime I try git-bob. XDD

haesleinhuepf commented 4 days ago

Also, again, your task description is not easy to read @SeverusYixin . Try to use clear english sentences. "In file xyz.py, update V2 to V4" and git-bob will be able help you.

SeverusYixin commented 4 days ago

Ahhh, I got it, I will try it next time haha