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

CI: Add Flake8 check for selected tests #2199

Merged

Conversation

wenzeslaus
Copy link
Member

grass.jupyter and grass.script tests are almost Flake8 compliant. This fixes the reported issues and removes Python 2 specific check.

A new step in the flake8 job checks explicitly for the files in the two testsuite directories. (There is no way in Flake8 itself to include previosly excluded files which is needed because testsuite directories are ignored in the main .flake8 file and here we need to check them.)

grass.jupyter and grass.script tests are almost Flake8 compliant. This fixes the reported issues and removes Python 2 specific check.

A new step in the flake8 job checks explicitly for the files in the two testsuite directories. (There is no way in Flake8 itself to include previosly excluded files which is needed because testsuite directories are ignored in the main .flake8 file and here we need to check them.)
@wenzeslaus wenzeslaus added CI Continuous integration Python Related code is in Python labels Feb 13, 2022
@wenzeslaus wenzeslaus added this to the 8.2.0 milestone Feb 13, 2022
@wenzeslaus wenzeslaus merged commit 0129d7f into OSGeo:main Feb 13, 2022
@wenzeslaus wenzeslaus deleted the flake8-for-jupyter-script-testsuite branch February 13, 2022 20:56
wenzeslaus added a commit that referenced this pull request Feb 15, 2022
This adds Pylint check job in a new workflow. It uses the current latest Pylint and latest Python. It uses Pylint to check for minimal supported Python version.

The check runs for the grass package (python/grass) and for wxGUI (gui/wxpython). However, most of the files are ignored. Each of the directories has its own .pylintrc file.

Pylint runs for grass.jupyter and grass.benchmark with only slightly modified configuration after fixes in targeted files (#2199, #2200, #2201, #2206). The approach for future compliance is that the other sub-packages should also eventually comply with default or almost default configuration.

For wxGUI, many Pylint messages are disabled and numbers driving coding standard limits, such as max number of local variables, are greatly loosened. Many of the disabled messages show real errors, but ignoring these for now allowed for enabling the check right away at least for the least problematic directories. The approach for future compliance is that new directories can be added (removed from ignore paths) and new issues can be checked (removed from disable) when fixed.

This compiles the code. Just testing Python functions from the grass package in the python directory does not require compiled code and package on path when started from the python directory, but checking other files requires packages on path.

The config file is in the python directory because that's the focus of this PR. (In the future, GUI may have a different config file, e.g., due to different naming conventions. On the other hand, in an ideal case, the whole source code will use this file or even a more strict version of this file in the future.)

Pylint should produce warning for disabled warnings which are not generated, although that seems to not be the case right now (useless-suppression).

The only code change here is that Pylint disable comment needs to be on the same line or inside ().

It needs to install also all optional Python dependencies because Pylint checks (can check unless disabled) all imports. This change is applied also to pytest workflow.

Using workflow on settings to run on push only to main and release branches and semver tags.

It uses strategy.matrix.include to get job-level config variables without using environmental variables.
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Oct 26, 2022
grass.jupyter and grass.script tests are almost Flake8 compliant. This fixes the reported issues and removes Python 2 specific check.

A new step in the flake8 job checks explicitly for the files in the two testsuite directories. (There is no way in Flake8 itself to include previosly excluded files which is needed because testsuite directories are ignored in the main .flake8 file and here we need to check them.)
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Oct 26, 2022
This adds Pylint check job in a new workflow. It uses the current latest Pylint and latest Python. It uses Pylint to check for minimal supported Python version.

The check runs for the grass package (python/grass) and for wxGUI (gui/wxpython). However, most of the files are ignored. Each of the directories has its own .pylintrc file.

Pylint runs for grass.jupyter and grass.benchmark with only slightly modified configuration after fixes in targeted files (OSGeo#2199, OSGeo#2200, OSGeo#2201, OSGeo#2206). The approach for future compliance is that the other sub-packages should also eventually comply with default or almost default configuration.

For wxGUI, many Pylint messages are disabled and numbers driving coding standard limits, such as max number of local variables, are greatly loosened. Many of the disabled messages show real errors, but ignoring these for now allowed for enabling the check right away at least for the least problematic directories. The approach for future compliance is that new directories can be added (removed from ignore paths) and new issues can be checked (removed from disable) when fixed.

This compiles the code. Just testing Python functions from the grass package in the python directory does not require compiled code and package on path when started from the python directory, but checking other files requires packages on path.

The config file is in the python directory because that's the focus of this PR. (In the future, GUI may have a different config file, e.g., due to different naming conventions. On the other hand, in an ideal case, the whole source code will use this file or even a more strict version of this file in the future.)

Pylint should produce warning for disabled warnings which are not generated, although that seems to not be the case right now (useless-suppression).

The only code change here is that Pylint disable comment needs to be on the same line or inside ().

It needs to install also all optional Python dependencies because Pylint checks (can check unless disabled) all imports. This change is applied also to pytest workflow.

Using workflow on settings to run on push only to main and release branches and semver tags.

It uses strategy.matrix.include to get job-level config variables without using environmental variables.
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
grass.jupyter and grass.script tests are almost Flake8 compliant. This fixes the reported issues and removes Python 2 specific check.

A new step in the flake8 job checks explicitly for the files in the two testsuite directories. (There is no way in Flake8 itself to include previosly excluded files which is needed because testsuite directories are ignored in the main .flake8 file and here we need to check them.)
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
This adds Pylint check job in a new workflow. It uses the current latest Pylint and latest Python. It uses Pylint to check for minimal supported Python version.

The check runs for the grass package (python/grass) and for wxGUI (gui/wxpython). However, most of the files are ignored. Each of the directories has its own .pylintrc file.

Pylint runs for grass.jupyter and grass.benchmark with only slightly modified configuration after fixes in targeted files (OSGeo#2199, OSGeo#2200, OSGeo#2201, OSGeo#2206). The approach for future compliance is that the other sub-packages should also eventually comply with default or almost default configuration.

For wxGUI, many Pylint messages are disabled and numbers driving coding standard limits, such as max number of local variables, are greatly loosened. Many of the disabled messages show real errors, but ignoring these for now allowed for enabling the check right away at least for the least problematic directories. The approach for future compliance is that new directories can be added (removed from ignore paths) and new issues can be checked (removed from disable) when fixed.

This compiles the code. Just testing Python functions from the grass package in the python directory does not require compiled code and package on path when started from the python directory, but checking other files requires packages on path.

The config file is in the python directory because that's the focus of this PR. (In the future, GUI may have a different config file, e.g., due to different naming conventions. On the other hand, in an ideal case, the whole source code will use this file or even a more strict version of this file in the future.)

Pylint should produce warning for disabled warnings which are not generated, although that seems to not be the case right now (useless-suppression).

The only code change here is that Pylint disable comment needs to be on the same line or inside ().

It needs to install also all optional Python dependencies because Pylint checks (can check unless disabled) all imports. This change is applied also to pytest workflow.

Using workflow on settings to run on push only to main and release branches and semver tags.

It uses strategy.matrix.include to get job-level config variables without using environmental variables.
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
grass.jupyter and grass.script tests are almost Flake8 compliant. This fixes the reported issues and removes Python 2 specific check.

A new step in the flake8 job checks explicitly for the files in the two testsuite directories. (There is no way in Flake8 itself to include previosly excluded files which is needed because testsuite directories are ignored in the main .flake8 file and here we need to check them.)
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
This adds Pylint check job in a new workflow. It uses the current latest Pylint and latest Python. It uses Pylint to check for minimal supported Python version.

The check runs for the grass package (python/grass) and for wxGUI (gui/wxpython). However, most of the files are ignored. Each of the directories has its own .pylintrc file.

Pylint runs for grass.jupyter and grass.benchmark with only slightly modified configuration after fixes in targeted files (OSGeo#2199, OSGeo#2200, OSGeo#2201, OSGeo#2206). The approach for future compliance is that the other sub-packages should also eventually comply with default or almost default configuration.

For wxGUI, many Pylint messages are disabled and numbers driving coding standard limits, such as max number of local variables, are greatly loosened. Many of the disabled messages show real errors, but ignoring these for now allowed for enabling the check right away at least for the least problematic directories. The approach for future compliance is that new directories can be added (removed from ignore paths) and new issues can be checked (removed from disable) when fixed.

This compiles the code. Just testing Python functions from the grass package in the python directory does not require compiled code and package on path when started from the python directory, but checking other files requires packages on path.

The config file is in the python directory because that's the focus of this PR. (In the future, GUI may have a different config file, e.g., due to different naming conventions. On the other hand, in an ideal case, the whole source code will use this file or even a more strict version of this file in the future.)

Pylint should produce warning for disabled warnings which are not generated, although that seems to not be the case right now (useless-suppression).

The only code change here is that Pylint disable comment needs to be on the same line or inside ().

It needs to install also all optional Python dependencies because Pylint checks (can check unless disabled) all imports. This change is applied also to pytest workflow.

Using workflow on settings to run on push only to main and release branches and semver tags.

It uses strategy.matrix.include to get job-level config variables without using environmental variables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous integration Python Related code is in Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant