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

Disable and revert unpacked-list-comprehension (UP027) #4558

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ extend-select = [

# local
"ANN2", # missing-return-type-*
"FA", # flake8-future-annotations
"F404", # late-future-import
"FA", # flake8-future-annotations
"I", # isort
"PYI", # flake8-pyi
"TRY", # tryceratops
"UP", # pyupgrade
"TRY",
"YTT", # flake8-2020
]
ignore = [
"TRY003", # raise-vanilla-args, avoid multitude of exception classes
"TRY301", # raise-within-try, it's handy
"UP015", # redundant-open-modes, explicit is preferred
"UP027", # unpacked-list-comprehension, is actually slower for cases relevant to unpacking, set for deprecation: https://github.com/astral-sh/ruff/issues/12754
"UP030", # temporarily disabled
"UP031", # temporarily disabled
"UP032", # temporarily disabled
Expand Down
5 changes: 1 addition & 4 deletions setuptools/package_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,7 @@ def not_found_in_index(self, requirement):
if self[requirement.key]: # we've seen at least one distro
meth, msg = self.info, "Couldn't retrieve index page for %r"
else: # no distros seen for this name, might be misspelled
meth, msg = (
self.warn,
"Couldn't find index page for %r (maybe misspelled?)",
)
meth, msg = self.warn, "Couldn't find index page for %r (maybe misspelled?)"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not strictly related to unpacked-list-comprehension (UP027), but I found this whilst looking for ,.*? = \( so I figured I might make it cleaner too whilst I saw it.

meth(msg, requirement.unsafe_name)
self.scan_all()

Expand Down
4 changes: 2 additions & 2 deletions setuptools/tests/test_egg_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ def parametrize(*test_list, **format_dict):
else:
install_cmd_kwargs = {}
name = name_kwargs[0].strip()
setup_py_requires, setup_cfg_requires, expected_requires = (
setup_py_requires, setup_cfg_requires, expected_requires = [
DALS(a).format(**format_dict) for a in test_params
)
]
for id_, requires, use_cfg in (
(name, setup_py_requires, False),
(name + '_in_setup_cfg', setup_cfg_requires, True),
Expand Down
Loading