Closed dg1223 closed 8 months ago
Looks like the linter is unhappy.
I checked the CI output. Most, if not all, are pre-existing lint violations such as:
ganga/GangaCore/Lib/Virtualization/__init__.py:1:1: F401 '.Docker.Docker' imported but unused
ganga/GangaCore/Core/GangaRepository/GangaRepositoryDatabase.py:178:128: E501 line too long (142 > 127 characters)
I'm gonna go ahead and fix them all. Adding a flake8
unit test to the Ganga repo should prevent non-lint-checked codes from being submitted in future.
Another nice little update to the CI pipeline could be running an autopep8
step before the lint checking step and then perform the create PR task separately. That may resolve formatting issues and possibly prevent minor lint failures. Currently, the Create autopep8 PR step is doing two things. It can be divided as above.
Fixed the lint errors and pushed the updates.
Install flake8 locally → python -m pip install flake8
Install autopep8 locally → pip install autopep8
Reformat files that are causing violations using autopep8
autopep8 --in-place --aggressive --aggressive <filename>
Test each commited file for linting violations and fix them manually
flake8 path/to/code/to/check.py
# or
flake8 path/to/code/
Run the previous testing pipeline again to ensure nothing else broke.
No more lint errors
(gangaenv) []@[]: ganga:$flake8 ganga/GangaCore/Lib/Virtualization/Apptainer.py
0
(gangaenv) []@[]: ganga:$flake8 ganga/GangaCore/test/Unit/Utility/TestUtilitiesVirtualizationCheckApptainer.py
0
(gangaenv) []@[]: ganga:$flake8 ganga/GangaCore/test/gangaDB/db_controllers/temp_test_apptainer.py
0
(gangaenv) []@[]: ganga:$flake8 ganga/GangaCore/Core/GangaRepository/GangaRepositoryDatabase.py
0
(gangaenv) []@[]: ganga:$flake8 ganga/GangaCore/Core/GangaRepository/container_controllers.py
0
(gangaenv) []@[]: ganga:$flake8 ganga/GangaCore/Core/GangaRepository/migrate.py
0
(gangaenv) []@[]: ganga:$flake8 ganga/GangaCore/Lib/Virtualization/__init__.py
0
(gangaenv) []@[]: ganga:$flake8 ganga/GangaCore/Utility/Virtualization.py
0
(gangaenv) []@[]: ganga:$flake8 ganga/GangaCore/test/gangaDB/db_controllers/TestContainerHandler.py
0
Regular tests passed
Unit tests as well as tests on Singularity and Apptainer finished successfully.
Looks like the linter is unhappy.
I checked the CI output. Most, if not all, are pre-existing lint violations such as:
ganga/GangaCore/Lib/Virtualization/__init__.py:1:1: F401 '.Docker.Docker' imported but unused ganga/GangaCore/Core/GangaRepository/GangaRepositoryDatabase.py:178:128: E501 line too long (142 > 127 characters)
I'm gonna go ahead and fix them all. Adding a
flake8
unit test to the Ganga repo should prevent non-lint-checked codes from being submitted in future.Another nice little update to the CI pipeline could be running an
autopep8
step before the lint checking step and then perform the create PR task separately. That may resolve formatting issues and possibly prevent minor lint failures. Currently, the Create autopep8 PR step is doing two things. It can be divided as above.
I am not quite sure that I follow the suggestion here. The linting check is mainly catching old non-compliant code. So the changes to make it pass are in general not related to the issue getting fixed. This is the reason that we prefer to get the linting done in a separate PR - it makes it easier to review. Now there is an extra small problem in that PRs from forks can't create the new PR. That is an issue that we have not solved in a satisfactory way.
Understood. I'll open seperate PRs for linting from next time.
The issue with PRs from forks sounds like an interesting thing to investigate. Thanks.
Happy to contribute :)
Resovled a couple of merge conflicts in documentation files WhatIsGanga.rst and Virtualization.rst.
@egede What is the plan with this? I would like to release a new version and it could be nice to include it
Should I be updating the branch again and trigger another CI run? It is out-of-date right now with the develop branch.
Should I be updating the branch again and trigger another CI run? It is out-of-date right now with the develop branch.
I just did. This is all done from your side. Many thanks.
Should I be updating the branch again and trigger another CI run? It is out-of-date right now with the develop branch.
I just did. This is all done from your side. Many thanks.
You are welcome :)
Related issue: #2293
Changelog
Testing
Ensure Singularity is not broken
Result: Test ran successfully after making Apptainer related updates
Run unit tests
python -m pytest ganga/GangaCore/test/Unit
Result: Passed all unit tests including the two newly added tests in
TestUtilitiesVirtualizationCheckApptainer.py
Install and test Apptainer
Install Apptainer from source
Run test
Result: Job finished with
completed
status.