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

Fix flake8-bugbear warnings #4168

Closed
wants to merge 10 commits into from

Conversation

DimitriPapadopoulos
Copy link
Contributor

@DimitriPapadopoulos DimitriPapadopoulos commented Jan 2, 2024

Summary of changes

Fix flake8-bugbear issues reported by ruff 0.1.9.

Pull Request Checklist

B015 Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it.
B010 Do not call `setattr` with a constant attribute value.
     It is not any safer than normal property access.
B009 Do not call `getattr` with a constant attribute value.
     It is not any safer than normal property access.
B033 Sets should not contain duplicate item `"anyOf"`
B006 Do not use mutable data structures for argument defaults
B904 Within an `except` clause, raise exceptions with `raise ... from err`
     or `raise ... from None` to distinguish them from errors in exception
     handling
Copy link
Contributor

@abravalheri abravalheri left a comment

Choose a reason for hiding this comment

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

Thank you very much @DimitriPapadopoulos for the valuable contribution.

Please see my comments below.

pkg_resources/__init__.py Outdated Show resolved Hide resolved
pkg_resources/__init__.py Outdated Show resolved Hide resolved
setuptools/config/setupcfg.py Show resolved Hide resolved
setuptools/config/_validate_pyproject/error_reporting.py Outdated Show resolved Hide resolved
setuptools/command/egg_info.py Show resolved Hide resolved
setuptools/build_meta.py Show resolved Hide resolved
setuptools/monkey.py Outdated Show resolved Hide resolved
Co-authored-by: Anderson Bravalheri <andersonbravalheri+github@gmail.com>
DimitriPapadopoulos and others added 2 commits January 3, 2024 17:40
Co-authored-by: Anderson Bravalheri <andersonbravalheri+github@gmail.com>
Co-authored-by: Anderson Bravalheri <andersonbravalheri+github@gmail.com>
The whole idea was to cache the result of a couple functions,
do that explictly with @functools.lru_cache.
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