-
Notifications
You must be signed in to change notification settings - Fork 173
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
[BUG] Version 1.7.0 backward incompatibility: pep8/pep257 config is not read anymore from prospector.yaml #491
Comments
* The latest prospector has introduced a backward incompatible change, see prospector-dev/prospector#491 Change-Id: I8905b8332f252a2f867b54a2e588a5f7e7f650cb
…and pep257 configurations are properly equivalent to pycodestyle and pydocstyle sections
Apologies @volans- : this was supposed to be backwards compatible, not breaking. I have added tests and fixed the code so that both old and new tool names should be equivalent (until version 2.0 when the old names will be removed). Please let me know if these work for you, it does on my repro steps and in unit tests at least. Version 1.7.2 is on PyPI now. |
@carlio Thanks a lot for looking into it, the prompt fix and the new release. I can confirm that the configuration is now properly loaded with the old identifier names for However I noticed a related issue regarding the inheritance of configurations. inherits:
- strictness_high And it seems that those settings are not anymore loaded. For example for profile_dict["pycodestyle"] = profile_dict["pep8"]
profile_dict["pydocstyle"] = profile_dict["pep257"] I'm not familiar with prospector source code, but I think that replacing those 2 lines with the following 2, respectively, should fix the problem: profile_dict["pycodestyle"] = _merge_tool_config(profile_dict["pep8"], profile_dict["pycodestyle"])
profile_dict["pydocstyle"] = _merge_tool_config(profile_dict["pep257"], profile_dict["pydocstyle"]) But I'm not sure if there are other aspects to take into account that I'm missing. Let me know if you want me to open a separate issue or you want to reopen this one. |
Thank for letting me know - I had forgotten to write tests to think about inheritance! You're right, the code will overwrite I'll re-open this because it's still the same issue pretty much. There'll probably be a new release with that fix in too, I'm on a mission to kill bugs and already have a few more fixes I want to release anyway :-) |
…ew name blocks and vice versa - so a pep8 config block will add to, not replace, a pycodestyle for example
@volans- I have pushed 1.7.3 now with what I think is the correct fix. Instead of trying to merge profiles after parsing, I realised just pre-filtering the YAML contents to rename 'pep8' to 'pycodestyle' was easier :-) The unit tests I added seem to work including with inheritance, please let me know if you see problems with it still. (I am ever the optimist so I'll close this again but if it's still broken please just re-open!) |
@carlio I can confirm that 1.7.3 runs cleanly on my setup as 1.6.0. Thanks a lot for the quick turnaround and final fix! |
Cool beans! FYI, I had to yank 1.7.2 and 1.7.3 due to other breaking regressions - 1.7.4 is now released to replace them. |
@carlio sorry to bother you again. In another repository of mine with similar settings, with prospector 1.7.4 I get:
A did a quick look and this seems to be triggered by this check becaue I'm not sure why on one repository this fails, while in another repository this does not fail and runs fine. P.S. I don't have permission to re-open this issue. |
…lidator, instead of warning about "not recognised"
@volans- It's not a bother at all! I'm currently trying to tidy up the repository and close the backlog of bugs, I expected there'd be some new ones appear as the unit tests only go so far. Thank you for your patience and help finding and debugging these issues! Not sure why you can't re-open it but just create new issues if you find any more problems, that'd be easiest I guess. Regarding the problem of 'unknown-setting' that is indeed an oversight and I have fixed it in carlio@cb274a5 which will go out in a 1.7.5 release later. It does raise a new error though, it's a deprecation warning instead of an unknown-setting, but that's valid as the setting is indeed deprecated. |
@carlio Perfect, thanks a lot. I'll let you know once 1.7.5 is out. |
1.7.5 just pushed to PyPI |
@carlio I can confirm it all works fine if I add this to profile-validator:
disable:
- deprecated-tool-code With the above prospector runs fine both on 1.6.0 and 1.7.5. Strictly speaking this is still slightly backward incompatible as I had to change my configuration, but that's not a problem for me, just wanted to mention that. warnings.warn("your message", DeprecationWarning) (see https://docs.python.org/3/library/warnings.html#warnings.warn ) Thanks again for all the fixes and the quick turnarounds. This can be considered closed for me. |
Describe the bug
Prospector 1.7.0 introduces a backward incompatible change. The settings for
pep8
andpep257
inprospector.yaml
are now ignored although the release notes report that the change should be backward compatible and the existing configuration should still work:Renaming the keys in
prospector.yaml
frompep8
topycodestyle
and frompep257
topydocstyle
is not an option because it would make previous versions of prospector ignore their related configuration and hence will report the wrong issues when run.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Prospector should load the
pep8
/pep257
specific configuration fromprospector.yaml
and for example in this specific case not report the line length issue.Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: