-
Notifications
You must be signed in to change notification settings - Fork 98
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
fix python linting using venv #1331
fix python linting using venv #1331
Conversation
.github/workflows/python.yml
Outdated
@@ -8,6 +8,13 @@ jobs: | |||
runs-on: ubuntu-latest | |||
steps: | |||
- uses: actions/checkout@v3 | |||
- name: Create venv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the correct way of doing it, or should we use something like this action for it?
https://github.com/galaxyproject/iwc/blob/main/.github/workflows/setup.yml#L63C1-L65C53
@arash77 you know these things correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both ways will work to set up a virtual environment, but you're right that using actions/setup-python is better. It handles the setup automatically and makes sure everything is ready without needing to manually activate the virtual environment.
Co-authored-by: Arash Kadkhodaei <[email protected]>
.github/workflows/python.yml
Outdated
- name: Setup Python | ||
uses: actions/setup-python@v5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- name: Setup Python | |
uses: actions/setup-python@v5 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
cache: 'pip' | |
cache-dependency-path: '.github/requirements-python-lint.txt' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For chacing pip, it would be better to use requirements.txt instead of direct pip install
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that stored in the repo's root or under .github
? (sorry I tried to google this but did not find anything)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be anywhere but the address is based on the repo's root. For example, it may be saved in the .github folder, and used like this:
pip install -r .github/requirements.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should do it now. Thanks for showing me :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, we could also use the super-linter which I did for WALLE, but I did not want to change too much in the beginning and just fix the action.
Should fix this: