-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Update flake8
additional dependencies
#6095
Update flake8
additional dependencies
#6095
Conversation
src/poetry/puzzle/provider.py
Outdated
return ( | ||
f"<c1>{d.name}</c1> <fg=default>(<c2>{d.pretty_constraint}</c2>)</>" | ||
f" with markers <b>{marker}</b>" | ||
f" with markers <b>{'*' if d.marker.is_any() else d.marker}</b>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this change is not strictly needed, it raised a B023
as well.
As marker
is also defined outside of fmt_warning
, I believe it confused the plugin (because renaming marker
to dependency_marker
made it pass).
Since the variable is only used once, I though it wasn't worth having one anyway, but if we prefer the current version, it's fine by me to just rename marker
to dependency_marker
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's good the way it is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, squashed into a84feef by only renaming marker
to dependency_marker
.
@@ -24,4 +24,6 @@ def commands(self) -> list[type[Command]]: | |||
def activate(self, application: Application) -> None: | |||
for command in self.commands: | |||
assert command.name is not None | |||
application.command_loader.register_factory(command.name, lambda: command()) | |||
application.command_loader.register_factory( | |||
command.name, lambda: command() # noqa: B023 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one can, I think, be considered as a false positive, since we do want late binding here.
pre-commit
additional dependenciesflake8
additional dependencies
src/poetry/puzzle/provider.py
Outdated
return ( | ||
f"<c1>{d.name}</c1> <fg=default>(<c2>{d.pretty_constraint}</c2>)</>" | ||
f" with markers <b>{marker}</b>" | ||
f" with markers <b>{'*' if d.marker.is_any() else d.marker}</b>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's good the way it is
tests/compat.py
Outdated
@@ -4,7 +4,7 @@ | |||
try: | |||
import zipp # nopycln: import |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you are at it, you could rewrite it to if sys.version < (3, x)
, that way it will be recognized by pyupgrade
(link) and will be removed when we upgrade Python versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I didn't know that pyupgrade
handled that, thanks!
except ImportError: | ||
import zipfile as zipp # noqa: F401, TC002 | ||
|
||
if sys.version_info < (3, 8): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on
Line 84 in c8ae868
zipp = { version = "^3.4", python = "<3.8" } |
Took the opportunity to export as zipfile
rather than zipp
as well, since zipfile
is the one in stdlib, and zipp
will most likely go away when we will remove support for 3.7
.
* build(deps): update pre-commit additional dependencies * chore: comply with `flake8-type-checking` following update * chore: comply with `flake8-bugbear` following update * refactor(tests): import `zipp` only on < 3.8
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Pull Request Check List
Update
flake8
additional dependencies and update code to comply with:B023
TC002
for third-party imports, andTC003
for built-in imports