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

Remove pytest_flake8 plugin and use flake8 instead #1722

Merged
merged 16 commits into from
Sep 20, 2022

Conversation

valeriupredoi
Copy link
Contributor

@valeriupredoi valeriupredoi commented Sep 15, 2022

Description

Discussed this and @bouweandela provided a working solution to the problem of the pytest_flake8 plugin being more and more at odds with the mother package flake8. I think we should change the documentation too, tell users to run flake8 before a push, but maybe not in this PR, what do you think @bouweandela ? We should also visit the containers 📦

Closes #1699

Link to documentation:


Before you get started

Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.


To help with the number pull requests:

@valeriupredoi valeriupredoi added enhancement New feature or request installation Installation problem testing labels Sep 15, 2022
@codecov
Copy link

codecov bot commented Sep 15, 2022

Codecov Report

Merging #1722 (286a0b7) into main (55d630c) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1722   +/-   ##
=======================================
  Coverage   91.47%   91.47%           
=======================================
  Files         206      206           
  Lines       11204    11204           
=======================================
  Hits        10249    10249           
  Misses        955      955           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@valeriupredoi
Copy link
Contributor Author

so the good news is that flake8 runs fine on me local machine (as well as the CI machines) but produces no progress bar/dots/flying cats etc - when it finishes it just exists the prompt - the user won't know what the heck's going on, @bouweandela know a way to show some progress on screen? Like mamba - shooting lasers, now that's cool 🌟

@valeriupredoi
Copy link
Contributor Author

Ha! Now that's an odd one - get rid of a pytest plugin, immediately run into a HDF5 segfault, well that escalated quickly 🤣

@schlunma
Copy link
Contributor

schlunma commented Sep 15, 2022

Ha! Now that's an odd one - get rid of a pytest plugin, immediately run into a HDF5 segfault, well that escalated quickly rofl

😃

@taly-pereira ran into the same problem today with a recipe that ran fine for me. We think that a new hdf5 version might be the problem, as I am using

hdf5                     1.12.1         mpi_mpich_h08b82f9_4   conda-forge

whereas she uses (freshly installed environment from today)

hdf5                      1.12.2          mpi_mpich_h08b82f9_0    conda-forge

We are currently downgrading her version to check if that fixes the problem...

EDIT: downgrading to 1.12.1 fixed the problem!

@valeriupredoi
Copy link
Contributor Author

valeriupredoi commented Sep 15, 2022

cheers aplenty @schlunma - I was beginning to think the "butterfly effect" concept 😆 That test is currently stalled (taking forever and half) on my machine, so it's definitely something bellyup in HDF5 - if HDF5 is hosed then queue the angry issues on their github repo since everyone and their dog uses it 🍿

EDIT - that failing test passed on my machine with hdf5 1.12.2 mpi_mpich_h5d83325_0 conda-forge - but that's a different hash

EDI2: even that hash (and the same hash from the CI machine) ran a couple times more with -n 2 causes segfaults - HDF5 1.12.2 is el hosed

@valeriupredoi
Copy link
Contributor Author

@schlunma read the EDIT2 above - HDF5 ist kaput

@schlunma
Copy link
Contributor

Weird. I haven't found anything on their GitHub...it also looks like 1.12.2 is not the latest version

@valeriupredoi
Copy link
Contributor Author

it is https://anaconda.org/conda-forge/hdf5/files - but it's fairly old and we've not seen anything weird until today?

@valeriupredoi
Copy link
Contributor Author

it's netCDF4 that's the problem - updated 5h ago https://anaconda.org/conda-forge/netcdf4

@schlunma
Copy link
Contributor

Ahh, yes, that makes sense!

@schlunma
Copy link
Contributor

schlunma commented Sep 15, 2022

Maybe pin it to !=1.6.1 so that a fixed version gets pulled in automatically in the future?

@valeriupredoi
Copy link
Contributor Author

yis, doing that now 🍺

@bouweandela
Copy link
Member

I think we should change the documentation too, tell users to run flake8 before a push, but maybe not in this PR, what do you think @bouweandela ?

We have pretty extensive advice here aleady: https://docs.esmvaltool.org/projects/esmvalcore/en/latest/contributing.html#code-quality, including the advice to use pre-commit, which runs flake8 as well as a bunch of other useful checks.

@valeriupredoi
Copy link
Contributor Author

I think we should change the documentation too, tell users to run flake8 before a push, but maybe not in this PR, what do you think @bouweandela ?

We have pretty extensive advice here aleady: https://docs.esmvaltool.org/projects/esmvalcore/en/latest/contributing.html#code-quality, including the advice to use pre-commit, which runs flake8 as well as a bunch of other useful checks.

oh yeah I knew about that - very nice indeed - but was wondering if it'd be worth it to tell an (advanced) developer how to check the code standards quality across the package with flake8 -j X?

@bouweandela
Copy link
Member

No: we're already recommending prospector, which will probably tell you about all flake8 issues and more, and then we're recommending pre-commit, so I think that's enough. People already complain that our docs are too lengthy.

@valeriupredoi
Copy link
Contributor Author

OK fair enough. That who complains the docs are too long has not read the fsspec documentation 😁

@bouweandela
Copy link
Member

Looks good to me now! Only when I run flake8 on my computer I get a lot of errors coming from files in the .eggs directory. Do you think it would make sense to add that to the list of directories to ignore?

@valeriupredoi
Copy link
Contributor Author

cheers Bouwe! I don't have any eggs, nor does the CI - where do you get your eggs from, bro? 🥚

@bouweandela
Copy link
Member

It is created by setuptools, e.g. if you ever ran python setup.py develop or similar, you'll have it. Let's leave if for now.

@valeriupredoi
Copy link
Contributor Author

It is created by setuptools, e.g. if you ever ran python setup.py develop or similar, you'll have it. Let's leave if for now.

but of course, silly me - it's just that I've not run python setup.py test/install etc in eons and I thought nobody else still does it; OK let's postpone, now who's using antiquated stuff 😁 Cheers for the review, bud! 🍺

@valeriupredoi valeriupredoi merged commit 640280b into main Sep 20, 2022
@valeriupredoi valeriupredoi deleted the remove_pytest_flake8 branch September 20, 2022 12:30
schlunma pushed a commit to ESMValGroup/ESMValTool that referenced this pull request Nov 7, 2022
<!--
    Thank you for contributing to our project!

Please do not delete this text completely, but read the text below and
keep
items that seem relevant. If in doubt, just keep everything and add your
    own text at the top, a reviewer will update the checklist for you.

While the checklist is intended to be filled in by the technical and
scientific
reviewers, it is the responsibility of the author of the pull request to
make
    sure all items on it are properly implemented.
-->

## Description

<!--
Please describe your changes here, especially focusing on why this pull
request makes
    ESMValTool better and what problem it solves.

Before you start, please read our contribution guidelines:
https://docs.esmvaltool.org/en/latest/community/

Please fill in the GitHub issue that is closed by this pull request,
e.g. Closes #1903
-->

Sister PR to ESMValGroup/ESMValCore#1722 - quite
needed since the conda-forge package needed some involved pinning of the
flake8 and pytest-flake8 packages. Discussed this and @bouweandela
provided a working solution to the problem of the `pytest_flake8` plugin
being more and more at odds with the mother package `flake8`. Currently
the main `flake8` package (and only one as of this PR) is pinned to <5,
there are still some issues with upper versions but we should have in
mind to unpin and test in the future.

- Closes #2897 
- Link to documentation: No need for it, no change to actual docs

* * *

## Before you get started

<!--
Please discuss your idea with the development team before getting
started,
to avoid disappointment or unnecessary work later. The way to do this is
    to open a new issue on GitHub.
-->

- [x] [☝ Create an
issue](https://docs.esmvaltool.org/en/latest/community/code_documentation.html#contributing-code-and-documentation)
to discuss what you are going to do

## Checklist

It is the responsibility of the author to make sure the pull request is
ready to review. The icons indicate whether the item will be subject to
the [🛠 Technical][1] or [🧪 Scientific][2] review.

<!-- The next two lines turn the 🛠 and 🧪 below into hyperlinks -->
[1]:
https://docs.esmvaltool.org/en/latest/community/review.html#technical-review
[2]:
https://docs.esmvaltool.org/en/latest/community/review.html#scientific-review

- [x] [🛠][1] This pull request has a [descriptive
title](https://docs.esmvaltool.org/en/latest/community/code_documentation.html#pull-request-title)
- [x] [🛠][1] The [list of
authors](https://docs.esmvaltool.org/en/latest/community/code_documentation.html#list-of-authors)
is up to date
- [x] [🛠][1] Any changed dependencies have been [added or removed
correctly](https://docs.esmvaltool.org/en/latest/community/code_documentation.html#dependencies)
- [x] [🛠][1] All [checks below this pull
request](https://docs.esmvaltool.org/en/latest/community/code_documentation.html#pull-request-checks)
were successful

Co-authored-by: Bouwe Andela <b.andela@esciencecenter.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request installation Installation problem testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider dropping pytest-flake8 plugin
3 participants