-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 RustPython to fix Dict.keys
type
#2086
Conversation
src/rules/pyupgrade/rules/convert_typed_dict_functional_to_class.rs
Outdated
Show resolved
Hide resolved
6ad0c41
to
5e58b8b
Compare
Prior to RustPython/RustPython#4449, {"a": 0, **b, "c": 1} is parsed as:
|
.iter() | ||
.flatten() | ||
.map(std::convert::Into::into) | ||
.collect(), |
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 this may need to preserve the None
, to be truly comparable, right?
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.
(So we'd need to update the definition of ComparableExpr
.)
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'll go ahead and do this, then merge.)
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.
@charliermarsh Thanks for the update!
.iter() | ||
.flatten() | ||
.chain(values.iter()) | ||
.any(contains_await), |
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.
Oh, we should rewrite this to use any_over_expr
. Can be a separate PR, or included here...
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ruff](https://github.com/charliermarsh/ruff) | `^0.0.229` -> `^0.0.230` | [![age](https://badges.renovateapi.com/packages/pypi/ruff/0.0.230/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/ruff/0.0.230/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/ruff/0.0.230/compatibility-slim/0.0.229)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/ruff/0.0.230/confidence-slim/0.0.229)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>charliermarsh/ruff</summary> ### [`v0.0.230`](https://github.com/charliermarsh/ruff/releases/tag/v0.0.230) [Compare Source](https://github.com/charliermarsh/ruff/compare/v0.0.229...v0.0.230) #### What's Changed - fix: pin rustpython to the same revision to fix cargo vendor by [@​figsoda](https://github.com/figsoda) in [https://github.com/charliermarsh/ruff/pull/2069](https://github.com/charliermarsh/ruff/pull/2069) - feat: implementation for TRY004 by [@​sbrugman](https://github.com/sbrugman) in [https://github.com/charliermarsh/ruff/pull/2066](https://github.com/charliermarsh/ruff/pull/2066) - ICN001 import-alias-is-not-conventional should check "from" imports by [@​Zeddicus414](https://github.com/Zeddicus414) in [https://github.com/charliermarsh/ruff/pull/2070](https://github.com/charliermarsh/ruff/pull/2070) - Update link to Pylint parity tracking issue by [@​cosmojg](https://github.com/cosmojg) in [https://github.com/charliermarsh/ruff/pull/2074](https://github.com/charliermarsh/ruff/pull/2074) - ICN001 check from imports that have no alias by [@​Zeddicus414](https://github.com/Zeddicus414) in [https://github.com/charliermarsh/ruff/pull/2072](https://github.com/charliermarsh/ruff/pull/2072) - Index source code upfront to power (row, column) lookups by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/1990](https://github.com/charliermarsh/ruff/pull/1990) - Remove remaining `ropey` usages by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/2076](https://github.com/charliermarsh/ruff/pull/2076) - Include package path in cache key by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/2077](https://github.com/charliermarsh/ruff/pull/2077) - feat: update scripts to new rules structure by [@​sbrugman](https://github.com/sbrugman) in [https://github.com/charliermarsh/ruff/pull/2078](https://github.com/charliermarsh/ruff/pull/2078) - Base `INP` check on package inference by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/2079](https://github.com/charliermarsh/ruff/pull/2079) - Improve generator precedence operations by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/2080](https://github.com/charliermarsh/ruff/pull/2080) - Support decorators in source code generator by [@​charliermarsh](https://github.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/2081](https://github.com/charliermarsh/ruff/pull/2081) - feat: enable autofix for TRY004 by [@​sbrugman](https://github.com/sbrugman) in [https://github.com/charliermarsh/ruff/pull/2084](https://github.com/charliermarsh/ruff/pull/2084) - Refactor, decouple and support "PL" by [@​not-my-profile](https://github.com/not-my-profile) in [https://github.com/charliermarsh/ruff/pull/2051](https://github.com/charliermarsh/ruff/pull/2051) - \[`pep8-naming`]\[`N806`] Don't mark `TypeVar` & `NewType` Assignment as Errors by [@​saadmk11](https://github.com/saadmk11) in [https://github.com/charliermarsh/ruff/pull/2085](https://github.com/charliermarsh/ruff/pull/2085) - Update linters pypi links to latest version by [@​alonme](https://github.com/alonme) in [https://github.com/charliermarsh/ruff/pull/2062](https://github.com/charliermarsh/ruff/pull/2062) - flake8\_to_ruff: support `isort` options by [@​shannonrothe](https://github.com/shannonrothe) in [https://github.com/charliermarsh/ruff/pull/2082](https://github.com/charliermarsh/ruff/pull/2082) - Update RustPython to fix `Dict.keys` type by [@​harupy](https://github.com/harupy) in [https://github.com/charliermarsh/ruff/pull/2086](https://github.com/charliermarsh/ruff/pull/2086) #### New Contributors - [@​figsoda](https://github.com/figsoda) made their first contribution in [https://github.com/charliermarsh/ruff/pull/2069](https://github.com/charliermarsh/ruff/pull/2069) - [@​cosmojg](https://github.com/cosmojg) made their first contribution in [https://github.com/charliermarsh/ruff/pull/2074](https://github.com/charliermarsh/ruff/pull/2074) - [@​alonme](https://github.com/alonme) made their first contribution in [https://github.com/charliermarsh/ruff/pull/2062](https://github.com/charliermarsh/ruff/pull/2062) - [@​shannonrothe](https://github.com/shannonrothe) made their first contribution in [https://github.com/charliermarsh/ruff/pull/2082](https://github.com/charliermarsh/ruff/pull/2082) **Full Changelog**: astral-sh/ruff@v0.0.229...v0.0.230 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/ixm-one/pytest-cmake-presets). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMDguNCIsInVwZGF0ZWRJblZlciI6IjM0LjEwOC40In0=--> Signed-off-by: Renovate Bot <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR upgrades RustPython to fix the type of
Dict.keys
toVec<Option<Expr>>
(see RustPython/RustPython#4449 for why this change was needed) and unblock #1884.