pacti-org / pacti

A package for compositional system analysis and design
https://www.pacti.org
BSD 3-Clause "New" or "Revised" License
19 stars 5 forks source link

[BUG] flake8 v6.0.0 error with "ignore" keyword #266

Closed ayush9pandey closed 1 year ago

ayush9pandey commented 1 year ago

Describe the bug Running flake8 v6.0.0 through make check gives an error: ValueError: Error code 'C0103' supplied to 'ignore' option does not match

To Reproduce Steps to reproduce the behavior:

Expected behavior Dependency package versioning must be handled by pyproject automatically. I will note here that I am not running Pacti with pdm install, I installed using pip install and then installed flake8, nbqa manually.

System (please complete the following information):

If you cannot reproduce the error using the steps that I have described, then it may be an error on my end.

iincer commented 1 year ago

Hi @ayush9pandey, our dev dependencies in pyproject.toml include flake8. When you install using pdm, pdm will get both pacti's dependencies and the dev dependencies. When you install using pip, you only get pacti's dependencies. It would make sense for the project to move to flake8, so you can get rid of the offending flake8 flag while running the linters.

ayush9pandey commented 1 year ago

Yes, that's what I think is happening. When I installed flake 8 latest version (6.0.0), I got the error, but on downgrading to v5.0.0 the error disappeared. So I just wanted to confirm if this is an issue with flake8's compatibility with nbqa or something else?

iincer commented 1 year ago

The message makes me think that the error that we are ignoring is not even recognized by v6 of flake8. It does not sound like a compatibility issue with nbqa.

ayush9pandey commented 1 year ago

Yes, you are right. I raised the issue because our dependencies allow for flake8>=5.0.0, so if there is an issue with v6..we need to fix something on our use of the ignore keyword or restrict to v5.

iincer commented 1 year ago

Noted. Thanks for raising this. Could you please update pyproject.toml to use flake8 >6 and remove the offending flag from our configuration? It makes sense to use the most recent version available.

ayush9pandey commented 1 year ago

Ok, let me try this.

ayush9pandey commented 1 year ago

I'm sorry the above description was incorrect. The error is reproducible with duty check-jn-quality and not make...The make commands work when the package is pdm installed, as far as I understand. And so, make check-jn-quality works as expected. Closing the issue as pdm install is the recommended installation setup for the package. The error is only relevant for (people like) me who installed using pip in a manually created virtual environment.