-
Notifications
You must be signed in to change notification settings - Fork 332
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
azure tests: move to fedora 37 #6546
Conversation
9936a69
to
a6c1b19
Compare
I'm failing to understand why pylint and tox report a cyclic-import error:
and
Any idea would be welcome, otherwise I will simply disable the check on the files ipatests/prci_definitions/prci_checker.py and ipapython/session_storage.py |
I can't reproduce this on Python3.10. Please, give me a bit more time to check it against Python3.11. |
Disablement of pylint on reported files wouldn't help because of incorrect(confusing?) reports. --- a/ipaplatform/osinfo.py
+++ b/ipaplatform/osinfo.py
@@ -218,7 +218,7 @@ class OSInfo(Mapping):
def container(self):
if self._container is not None:
return self._container
- from ipaplatform.tasks import tasks
+ from ipaplatform.tasks import tasks # pylint: disable=cyclic-import
try:
self._container = tasks.detect_container()
except NotImplementedError: Though I don't know why it's fired on Python3.11 (if it's related at all). |
Ok, it's not related to Python3.11 at all. |
Awkward silence. @flo-renaud, would you expect that someone fixes the issue? Please let me know if I should fix it. |
Sorry for the delay and lack of response, I was caught in other tasks :( |
I will check it today. |
@stanislavlevin thanks for the additional commits, LGTM. |
I wanted to replace deprecated |
d2106a3
to
fe17dcc
Compare
Still working on this. |
9cc432b
to
427f3d4
Compare
@flo-renaud, I added more commits addressing issues found during my review. |
@stanislavlevin Thanks for your help on this one! I'm on vacation but will review as soon as I return early January. |
Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
pylint fixed issue pylint-dev/pylint#4756 and we don't need anymore to disable this check. Related: https://pagure.io/freeipa/issue/9278 Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
The newer version of pylint has fixed false positives and does not need anymore these suppressions: - global-variable-not-assigned - invalid-sequence-index - no-name-in-module - not-callable - unsupported-assignment-operation Related: https://pagure.io/freeipa/issue/9278 Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Related: https://pagure.io/freeipa/issue/9278 Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Related: https://pagure.io/freeipa/issue/9278 Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Related: https://pagure.io/freeipa/issue/9278 Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Related: https://pagure.io/freeipa/issue/9278 Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Related: https://pagure.io/freeipa/issue/9278 Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Related: https://pagure.io/freeipa/issue/9278 Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Related: https://pagure.io/freeipa/issue/9278 Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Related: https://pagure.io/freeipa/issue/9278 Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Related: https://pagure.io/freeipa/issue/9278 Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Related: https://pagure.io/freeipa/issue/9278 Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Related: https://pagure.io/freeipa/issue/9278 Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
There are several known problems with multiprocess mode. For example, pylint-dev/pylint#3232. In other words the lint result depends on the number of jobs. The most correct report is expected for single process. Fixes: https://pagure.io/freeipa/issue/9278 Signed-off-by: Stanislav Levin <slev@altlinux.org>
Fixes: ``` [E0611(no-name-in-module), ] No name 'parse' in module 'lxml.etree' [E0611(no-name-in-module), ] No name 'murmurhash3' in module 'pysss_murmur' ``` Fixes: https://pagure.io/freeipa/issue/9278 Signed-off-by: Stanislav Levin <slev@altlinux.org>
`extension-pkg-whitelist` is deprecated in favour of `extension-pkg-allow-list` since Pylint 2.7.3: https://pylint.pycqa.org/en/latest/whatsnew/2/2.7/full.html#what-s-new-in-pylint-2-7-3 Fixes: https://pagure.io/freeipa/issue/9278 Signed-off-by: Stanislav Levin <slev@altlinux.org>
Most of `cyclic-import` issues reported by Pylint are false-positive and they are already handled in the code, but several ones are the actual errors. Fixes: https://pagure.io/freeipa/issue/9232 Fixes: https://pagure.io/freeipa/issue/9278 Signed-off-by: Stanislav Levin <slev@altlinux.org>
`pipes` module is deprecated as of Python 3.11. https://docs.python.org/3/library/pipes.html#module-pipes: > Deprecated since version 3.11, will be removed in version 3.13: The pipes module is deprecated (see PEP 594 for details). IPA code used only `quote` function from `pipes` that in turn is the alias for `shlex.quote` since Python 3.3: python/cpython@9bce311 Fixes: https://pagure.io/freeipa/issue/9278 Signed-off-by: Stanislav Levin <slev@altlinux.org>
> Emitted when a local variable is accessed before its assignment took place. Assignments in try blocks are assumed not to have occurred when evaluating associated except/finally blocks. Assignments in except blocks are assumed not to have occurred when evaluating statements outside the block, except when the associated try block contains a return statement. Fixes: https://pagure.io/freeipa/issue/9278 Signed-off-by: Stanislav Levin <slev@altlinux.org>
https://pylint.pycqa.org/en/latest/user_guide/messages/warning/modified-iterating-list.html: > Emitted when items are added or removed to a list being iterated through. Doing so can result in unexpected behaviour, that is why it is preferred to use a copy of the list. https://docs.python.org/3/tutorial/controlflow.html#for-statements: > Code that modifies a collection while iterating over that same collection can be tricky to get right. Instead, it is usually more straight-forward to loop over a copy of the collection or to create a new collection Fixes: https://pagure.io/freeipa/issue/9278 Signed-off-by: Stanislav Levin <slev@altlinux.org>
https://pylint.pycqa.org/en/latest/user_guide/messages/convention/unnecessary-lambda-assignment.html: > Used when a lambda expression is assigned to variable rather than defining a standard function with the "def" keyword. https://peps.python.org/pep-0008/#programming-recommendations: > Always use a def statement instead of an assignment statement that binds a lambda expression directly to an identifier: def f(x): return 2*x f = lambda x: 2*x The first form means that the name of the resulting function object is specifically ‘f’ instead of the generic ‘<lambda>’. This is more useful for tracebacks and string representations in general. The use of the assignment statement eliminates the sole benefit a lambda expression can offer over an explicit def statement (i.e. that it can be embedded inside a larger expression) Fixes: https://pagure.io/freeipa/issue/9278 Signed-off-by: Stanislav Levin <slev@altlinux.org>
https://pylint.pycqa.org/en/latest/user_guide/messages/error/unhashable-member.html: > Emitted when a dict key or set member is not hashable (i.e. doesn't define __hash__ method). https://docs.python.org/3/library/stdtypes.html#dict.update: > Update the dictionary with the key/value pairs from other, overwriting existing keys. Return None. update() accepts either another dictionary object or an iterable of key/value pairs (as tuples or other iterables of length two). If keyword arguments are specified, the dictionary is then updated with those key/value pairs: d.update(red=1, blue=2). Fixes: https://pagure.io/freeipa/issue/9278 Signed-off-by: Stanislav Levin <slev@altlinux.org>
https://pylint.pycqa.org/en/latest/user_guide/messages/refactor/useless-object-inheritance.html: > Used when a class inherit from object, which under python3 is implicit, hence can be safely removed from bases. Fixes: https://pagure.io/freeipa/issue/9278 Signed-off-by: Stanislav Levin <slev@altlinux.org>
https://docs.python.org/3/library/cgi.html#module-cgi: > Deprecated since version 3.11, will be removed in version 3.13: The cgi module is deprecated (see PEP 594 for details and alternatives). Fixes: https://pagure.io/freeipa/issue/9278 Signed-off-by: Stanislav Levin <slev@altlinux.org>
@stanislavlevin your updates LGTM. I rebased onto the master branch to make sure that no additional lint issues are detected. |
@flo-renaud, thank you very much for the review :) |
master:
|
Signed-off-by: Florence Blanc-Renaud flo@redhat.com