GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merging latest changes to mypy by Malika1109 · Pull Request #1 · Malika1109/mypy

Conversation

@Malika1109

@Malika1109 Malika1109 commented Dec 1, 2023

Copy link
Copy Markdown
Owner

(Explain how this PR changes mypy.)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
ilevkivskyi and others added 17 commits November 19, 2023 17:33
@ilevkivskyi
An attempt to fix mypyc tests on MacOS (#16520)
a3e488d
Fixes #16420

Although this is not 100% clear yet, but after 20 runs on a Mac I have
it no longer fails (without this patch it failed 20% of times). Btw,
contrary to the comment, _my_ Linux Mint (which is an Ubuntu derivative)
works perfectly (i.e. test passed 20 times even after I removed the
`sleep()`). So it is not really Mac vs Linux issue.
@ilevkivskyi
Make imprecise constraints handling more robust (#16502)
3e6b552
Fixes #16485

My initial implementation of imprecise constraints fallback was really
fragile and ad-hoc, and I now see several edge case scenarios where we
may end up using imprecise constraints for a `ParamSpec` while some
precise ones are available. So I re-organized it: now we just infer
everything as normally, and filter out imprecise (if needed) at the very
end, when we have the full picture. I also fix an accidental omission in
`expand_type()`.
@ilevkivskyi
Fix polymorphic application for callback protocols (#16514)
fc811ae
Fixes #16512

The problems were caused if same callback protocol appeared multiple
times in a signature. Previous logic confused this with a recursive
callback protocol.
@ilevkivskyi
Fix crash on TypeGuard in __call__ (#16516)
242ad2a
Fixes #16187

Note there may be some more similar crashes, I don't handle them all
properly, for now I leave a TODO and replace the `assert` with `if`, so
at least we should not crash on an unhandled case.
@sveinugu
Docs: update soft-error-limit default value to -1 (#16542)
5b1a231
Default value of `MANY_ERRORS_THRESHOLD` was set to `-1` in
#15138, which is also the default
value of the `--soft-error-limit` CLI option. However the CLI docs were
not updated accordingly.
@sobolevn
Do not allow class-level keywords for NamedTuple (#16526)
50d6d0b
Refs #16521
@JukkaL
Speed up tests by simplifying test fixtures (#16560)
9289a33
Move some definitions away from commonly used fixtures that are only
needed in one or two test cases, as they will slow down many test cases.

This speeds up `mypy/test/testcheck.py` by about 5% on my Linux desktop.
@JukkaL
Add fast path to analyzing special form assignments (#16561)
1200d1d
This showed up as hot spot in a CPU profile collected when running
tests.

This makes `mypy/test/testcheck.py` about 2% faster on my Linux desktop.
@hamdanal
stubgen: Preserve simple defaults in function signatures (#15355)
e69c5cd
Fixes #13238

See also python/typeshed#8988
@JukkaL
Fix multiprocessing warnings when runnign tests on Python 3.12 (#16564)
379d59e
I saw a bunch of warnings when running tests in parallel using pytest.
When running tests sequentially using `-n0` I didn't see warnings. This
only seems to happen on Linux.

The warnings were like these, which can be fixed by avoiding the use of
fork, and using forkserver instead:
```
mypy/test/teststubgen.py::StubgenPythonSuite::stubgen.test::testNestedClass_inspect
  /usr/local/lib/python3.12/multiprocessing/popen_fork.py:66: DeprecationWarning: This process (pid=84587) is multi-threaded, use of fork() may lead to deadlocks in the child.
    self.pid = os.fork()
```

Relevant discussion:

https://discuss.python.org/t/concerns-regarding-deprecation-of-fork-with-alive-threads/33555
@chadrik
Fix stubgen regressions with pybind11 and mypy 1.7 (#16504)
69b3144
This addresses several regressions identified in
#16486

The primary regression from #15770 is
that pybind11 properties with docstrings were erroneously assigned
`typeshed. Incomplete`.

The reason for the regression is that as of the introduction of the
`--include-docstring` feature
(#13284, not my PR, ftr),
`./misc/test-stubgenc.sh` began always reporting success. That has been
fixed.

It was also pointed out that `--include-docstring` does not work for
C-extensions. This was not actually a regression as it turns out this
feature was never implemented for C-extensions (though the tests
suggested it had been), but luckily my efforts to unify the pure-python
and C-extension code-paths made fixing this super easy (barely an
inconvenience)! So that is working now.

I added back the extended list of `typing` objects that generate
implicit imports for the inspection-based stub generator. I originally
removed these because I encountered an issue generating stubs for
`PySide2` (and another internal library) where there was an object with
the same name as one of the `typing` objects and the auto-import created
broken stubs. I felt somewhat justified in this decision as there was a
straightforward solution -- e.g. use `list` or `typing.List` instead of
`List`. That said, I recognize that the problem that I encountered is
more niche than the general desire to add import statements for typing
objects, so I've changed the behavior back for now, with the intention
to eventually add a flag to control this behavior.
@AlexWaygood
Fix stubtest's tests to work with the latest typing_extensions release (
95e7fcb
#16588)

Stubtest's tests will start failing when `typing_extensions==4.9.0`
comes out, due to some new `ClassVar`s on `typing_extensions.TypedDict`.
This PR fixes that.

Fixes python/typing_extensions#309
@AlexWaygood @JelleZijlstra
Sync typeshed
c0fce06
Source commit:
python/typeshed@5f12eeb
@hauntsaninja @JelleZijlstra
Remove use of LiteralString in builtins (#13743)
588623f
@hauntsaninja @JelleZijlstra
Revert sum literal integer change (#13961)
bdcc90e
This is allegedly causing large performance problems, see 13821

typeshed/8231 had zero hits on mypy_primer, so it's not the worst thing
to undo. Patching this in typeshed also feels weird, since there's a
more general soundness issue. If a typevar has a bound or constraint, we
might not want to solve it to a Literal.

If we can confirm the performance regression or fix the unsoundness
within mypy, I might pursue upstreaming this in typeshed.

(Reminder: add this to the sync_typeshed script once merged)
@AlexWaygood @JelleZijlstra
Revert typeshed ctypes change
3e5d813
Since the plugin provides superior type checking: #13987 (comment)
A manual cherry-pick of e437cdf.
@AlexWaygood @JelleZijlstra
Revert use of ParamSpec for functools.wraps
344298e
@Malika1109
Malika1109 merged commit c70b3f1 into Malika1109:master Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

9 participants

@Malika1109 @ilevkivskyi @sveinugu @sobolevn @JukkaL @hamdanal @chadrik @AlexWaygood @hauntsaninja
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.