Skip to content

Fix flake8-bugbear warnings#4168

Closed
DimitriPapadopoulos wants to merge 10 commits intopypa:mainfrom
DimitriPapadopoulos:bugbear
Closed

Fix flake8-bugbear warnings#4168
DimitriPapadopoulos wants to merge 10 commits intopypa:mainfrom
DimitriPapadopoulos:bugbear

Conversation

@DimitriPapadopoulos
Copy link
Copy Markdown
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
@DimitriPapadopoulos DimitriPapadopoulos marked this pull request as ready for review January 2, 2024 20:44
Copy link
Copy Markdown
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.

Comment thread pkg_resources/__init__.py Outdated
Comment thread pkg_resources/__init__.py Outdated
Comment thread setuptools/config/setupcfg.py
Comment thread setuptools/config/_validate_pyproject/error_reporting.py Outdated
Comment thread setuptools/command/egg_info.py
Comment thread setuptools/build_meta.py
Comment thread setuptools/monkey.py Outdated
Co-authored-by: Anderson Bravalheri <[email protected]>
Comment thread setuptools/command/egg_info.py Outdated
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