Bug 1739167 - pylint error with rpm-4.15.0-0.beta.2 - Module 'rpm' has no 'RPMTAG_NAME' member
Summary: pylint error with rpm-4.15.0-0.beta.2 - Module 'rpm' has no 'RPMTAG_NAME' member
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: pylint
Version: 31
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Gwyn Ciesla
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-08 16:27 UTC by Brian Lane
Modified: 2020-02-08 02:00 UTC (History)
11 users (show)

Fixed In Version: pylint-2.4.4-1.fc31
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-01-30 17:40:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Brian Lane 2019-08-08 16:27:56 UTC
Something in rpm changed recently and pylint is no longer able to handle the rpm.RPMTAG_* constants.

I don't see anything obvious in the commit log so I need some help figuring this out.

python3-rpm-4.15.0-0.beta.2.fc31.2.x86_64
python3-pylint-2.3.1-2.fc31.noarch

A simple reproducer is:

    #!/usr/bin/python3
    import rpm
    print(rpm.RPMTAG_NAME)

pylint-3 ./test-rpm.py

************* Module test-rpm
test-rpm.py:1:0: C0103: Module name "test-rpm" doesn't conform to snake_case naming style (invalid-name)
test-rpm.py:1:0: C0111: Missing module docstring (missing-docstring)
test-rpm.py:4:6: E1101: Module 'rpm' has no 'RPMTAG_NAME' member (no-member)


Running the program works fine, and they are also available when running python3 interactively.

Comment 1 Miro Hrončok 2019-08-09 00:38:35 UTC
python3-rpm is an EPEL7 only component, reassigning to rpm (it has python3-rpm subpackage in Fedora)

Comment 2 Panu Matilainen 2019-08-09 06:30:49 UTC
I can't reproduce on Fedora 30 (running a development snapshot of rpm which is slightly newer than the F31 beta):

[pmatilai🎩︎sopuli ~]$ rpm -q python3-rpm python3-pylint
python3-rpm-4.15.90-0.git14694.1.fc30.x86_64
python3-pylint-2.3.1-1.fc30.noarch
[pmatilai🎩︎sopuli ~]$ pylint-3 test-rpm.py 
************* Module test-rpm
test-rpm.py:1:0: C0103: Module name "test-rpm" doesn't conform to snake_case naming style (invalid-name)
test-rpm.py:1:0: C0111: Missing module docstring (missing-docstring)

------------------------------------------------------------------

Obviously this is not conclusive, but makes me suspect it's something else than rpm at fault.
The only even remotely related change in rpm-python that I can think of is re-merging the lib, build and sign modules back into one, but this shouldn't be visible to users at all unless pylint has some rpm-specific "knowledge" in it (which would seem highly peculiar too)

Comment 3 Panu Matilainen 2019-08-12 08:59:06 UTC
...but I certainly can reproduce on rawhide:

[pmatilai@localhost tmp]$ uname -r
5.3.0-0.rc3.git1.1.fc31.x86_64
[pmatilai@localhost tmp]$ pylint-3 test-rpm.py
************* Module test-rpm
test-rpm.py:1:0: C0103: Module name "test-rpm" doesn't conform to snake_case naming style (invalid-name)
test-rpm.py:1:0: C0111: Missing module docstring (missing-docstring)
test-rpm.py:3:6: E1101: Module 'rpm' has no 'RPMTAG_NAME' member (no-member)

Since the code works just fine it seems more like an analyzer problem, but it'd be good to understand the underlying issue before passing judgement.
Pavlina, please investigate.

Comment 4 Ben Cotton 2019-08-13 16:52:23 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 5 Ben Cotton 2019-08-13 17:05:05 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 6 Michal Domonkos 2020-01-27 16:10:48 UTC
The RPMTAG_NAME member actually is available from the rpm module, it's just pylint that complains about it for some reason.  Unless I'm missing something, this appears to be a problem with pylint so I'm reassigning.

Comment 7 Gwyn Ciesla 2020-01-27 17:37:45 UTC
Cannot reproduce on current updated f31 with pylint 2.4.4. Please reopen if you can.

Comment 8 Brian Lane 2020-01-27 18:43:17 UTC
I'm still seeing this on fully updated Fedora 31 and on rawhide.

On F31 I have these versions installed:

python3-pylint-2.3.1-2.fc31.noarch
python3-lazy-object-proxy-1.4.3-1.fc31.x86_64
python3-wrapt-1.11.2-2.fc31.x86_64
python3-astroid-2.3.3-4.gitace7b29.fc31.noarch
python3-typed_ast-1.4.0-2.fc31.x86_64

(There is no 2.4.4 available for f31, even though I see one was built in koji)

On rawhide I have:

python3-pylint-2.4.4-2.fc32.noarch
python3-lazy-object-proxy-1.4.3-2.fc32.x86_64
python3-wrapt-1.11.2-4.fc32.x86_64
python3-astroid-2.3.3-6.gitace7b29.fc32.noarch
python3-typed_ast-1.4.1-1.fc32.x86_64

Comment 9 Gwyn Ciesla 2020-01-27 19:43:26 UTC
How strange. I'll get that out.

Comment 10 Fedora Update System 2020-01-27 19:43:42 UTC
FEDORA-2020-5172449b3b has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-5172449b3b

Comment 11 Brian Lane 2020-01-29 23:15:38 UTC
I've filed a pylint bug and put together a repo of dockerfiles demonstrating the problem.

https://github.com/PyCQA/pylint/issues/3371

https://github.com/bcl/pylint-rpm-1739167

Looking at the rpm code I can't spot any changes that would have broken this, and I'm seeing it happen with pylint 2.4.4 and with 2.3.1 on rawhide and f31 (I also installed the new 2.4.4 build on f31 and it was still happening). I don't see it on F30.

I also reproduced it on a RHEL8 system by installing pylint 2.4.4 via pip.

Comment 12 Gwyn Ciesla 2020-01-30 14:44:06 UTC
This is so weird. I have the same package versions as you on f31 and can't reproduce. Thanks for taking this upstream.

Comment 13 Brian Lane 2020-01-30 17:33:39 UTC
I have no idea why this behavior changed, but upstream suggests adding '--extension-pkg-whitelist=rpm' which works for my simple reproducer. So I guess we can close this.

Comment 14 Gwyn Ciesla 2020-01-30 17:40:17 UTC
Odd. Ok.

Comment 15 Fedora Update System 2020-01-31 01:28:57 UTC
pylint-2.4.4-1.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-5172449b3b

Comment 16 Fedora Update System 2020-02-08 02:00:03 UTC
pylint-2.4.4-1.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.