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 fallback getloadavg impl. #589

Closed
wants to merge 3 commits into from

Conversation

antarus12345
Copy link
Contributor

I suspect this impl made sense when portage used python2.2 (which lacked it) but this function was added to the unix stdlib in python 2.3; so I think we can drop this now.

For now it disables all checks except for checks that I have already
eliminated and silenced.

Signed-off-by: Alec Warner <[email protected]>
The disable list has been tweaked to disable most of the bad-style ones.

Signed-off-by: Alec Warner <[email protected]>
Is there any reason to keep this fallback implementation?

Signed-off-by: Alec Warner <[email protected]>
@zmedico
Copy link
Member

zmedico commented Jul 24, 2020

As I recall, the getloadavg function was added in 8607a39 due to the function being missing for python built with uclibc back then. I've found that this is still an issue with current autobuilds found in http://ftp.romnet.org/gentoo/releases/amd64/autobuilds/current-stage3-amd64-uclibc-vanilla/, for example this is with stage3-amd64-uclibc-vanilla-20200619.tar.bz2:

Python 3.7.7 (default, May 31 2020, 21:22:59) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.getloadavg
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'os' has no attribute 'getloadavg'

enable=redefined-builtin,useless-object-inheritance,trailing-newlines
disable=no-absolute-import,bad-continuation,C0103,C0114,C0115,E1101,W0201,no-name-in-module,W0613,C0116
#disable=all
#enable=redefined-builtin,useless-object-inheritance,trailing-newlines
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should add missing-docstring in there because with pylint 2.3.1 I see a lot of errors like this:

************* Module portage.tests.util.test_file_copier
lib/portage/tests/util/test_file_copier.py:1:0: C0111: Missing module docstring (missing-docstring)
lib/portage/tests/util/test_file_copier.py:15:0: C0111: Missing class docstring (missing-docstring)

@antarus12345 antarus12345 marked this pull request as draft July 24, 2020 18:16
@zmedico
Copy link
Member

zmedico commented Sep 27, 2024

We're reconsidering this PR in #1383.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants