8000 Comparing defe53f...f5fc579 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: python/mypy
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: defe53f
Choose a base ref
...
head repository: python/mypy
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f5fc579
Choose a head ref
  • 17 commits
  • 20 files changed
  • 4 contributors

Commits on Jun 18, 2021

  1. Support --install-types --non-interactive that doesn't prompt (#10616)

    It also doesn't show errors, making it useful in CI jobs.
    
    Example:
    ```
    $ mypy --install-types --non-interactive -c 'import click'
    Installing missing stub packages:
    /Users/jukka/venv/mypy/bin/python3 -m pip install types-click
    
    Collecting types-click
      Using cached types_click-7.1.0-py2.py3-none-any.whl (13 kB)
    Installing collected packages: types-click
    Successfully installed types-click-7.1.0
    ```
    
    Work on #10600.
    JukkaL committed Jun 18, 2021
    Configuration menu
    Copy the full SHA
    784aa93 View commit details
    Browse the repository at this point in the history
  2. Fix faulty casts in checker (#10560)

    Fixes #9615, fixes #9682
    
    Both issue reports hit the faulty cast on L2803. This changes the logic
    so that that cast is actually always true. If not, we just end up doing
    whatever the fallback else clause does; this resulted in behaviour that
    matched what I expected.
    
    After that, the #9682 hit another crash in checker.py, where var.node
    was None instead of a Var. It seemed reasonable to just branch instead.
    
    Co-authored-by: hauntsaninja <>
    hauntsaninja authored and JukkaL committed Jun 18, 2021
    Configuration menu
    Copy the full SHA
    e93a700 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5af694e View commit details
    Browse the repository at this point in the history
  4. stubgen: Use NamedTuple class syntax (#10625)

    ### Description
    
    Use `typing.NamedTuple` in stubgen, instead of `collections.namedtuple`.
    
    ## Test Plan
    
    I modified the existing tests and added another test for an empty namedtuple, to ensure that `Any` is not imported unnecessarily.
    srittau authored and JukkaL committed Jun 18, 2021
    Configuration menu
    Copy the full SHA
    fee4422 View commit details
    Browse the repository at this point in the history
  5. stubgen: never generate variable initializer (#10623)

    Previously, the generation of a variable initialized (= ...) was
    inconsistent between top-level and class-level variables. Since the
    initializer has no function in stubs, stubgen will now never generate
    it.
    srittau authored and JukkaL committed Jun 18, 2021
    Configuration menu
    Copy the full SHA
    2ce3677 View commit details
    Browse the repository at this point in the history
  6. stubgen: Don't annotate unknown argument and return types (#10626)

    ### Description
    
    Don't annotate unknown argument and return types with explicit `Any`. Also, fix formatting of functions that have an explicit type and default argument.
    
    ## Test Plan
    
    I adapted the existing tests. I also added tests to ensure that explicit `Any`s remain in the stub. I also added a test for the formatting fix.
    srittau authored and JukkaL committed Jun 18, 2021
    Configuration menu
    Copy the full SHA
    ae3dcc7 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f6e4c9e View commit details
    Browse the repository at this point in the history
  8. Don't suggest to install stubs with py.typed files (#10652)

    The pallets libraries are now bundled with a `py.typed` file. Suggesting to install these stubs only leads to confusion. See python/typeshed#5423 and python/typeshed#5642 for context.
    srittau authored and JukkaL committed Jun 18, 2021
    Configuration menu
    Copy the full SHA
    4905aad View commit details
    Browse the repository at this point in the history
  9. pyopenssl types package name was corrected (#10656)

    It's now also available for Python 3
    srittau authored and JukkaL committed Jun 18, 2021
    Configuration menu
    Copy the full SHA
    0b65866 View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2021

  1. Improve error reporting when --install-types has no cache (#10667)

    There are no tests since our test framework makes it tricky to
    write tests for these kinds of scenarios. Tested manually.
    
    Work on #10600.
    JukkaL committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    f5a3405 View commit details
    Browse the repository at this point in the history
  2. Run build a second time when using --install-types --non-interactive (#…

    …10669)
    
    If the first build finds missing stub packages, run the build a second
    time after installing types. Only show errors from the final build.
    
    Example output:
    ```
    $ mypy --install-types --non-interactive t.py
    Installing missing stub packages:
    /Users/jukka/venv/mypy/bin/python3 -m pip install types-redis
    
    Collecting types-redis
      Using cached types_redis-3.5.2-py2.py3-none-any.whl (11 kB)
    Installing collected packages: types-redis
    Successfully installed types-redis-3.5.2
    
    t.py:2: error: Unsupported operand types for + ("int" and "str")
    Found 1 error in 1 file (checked 1 source file)
    ```
    
    Work on #10600.
    JukkaL committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    e8cf526 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    64deb99 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the FEAE full SHA
    680fded View commit details
    Browse the repository at this point in the history
  5. Fix crash with assignment to variable guarded with TypeGuard (#10683)

    This is a quick fix to unblock the 0.910 release.
    
    The type guard type can be unrelated to the original type, so we
    shouldn't join it. I'm not sure whether this is right from first
    principles, but it seems to address the issue.
    
    Fixes #10671.
    JukkaL committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    9637f99 View commit details
    Browse the repository at this point in the history
  6. Don't ask to install a stub package if stubs are installed (#10670)

    If we encounter an import of a submodule of a package with installed
    stubs, and the submodule doesn't exist, don't ask to install stubs
    since that's not going to help. Also make it possible to ignore this
    error using `--ignore-missing-imports`.
    
    Work on #10645.
    JukkaL committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    96366d1 View commit details
    Browse the repository at this point in the history
  7. Fix crash when inferring multiple assignment with overloaded function (

    …#10689)
    
    When using lvalue context to re-infer call to an overloaded function,
    the inferred tuple type can switch to Any. Defensively accept this. It
    probably means that an Any component in argument types causes ambiguity.
    
    Fixes #10653.
    JukkaL committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    46ce325 View commit details
    Browse the repository at this point in the history
  8. Bump version to 0.910

    JukkaL committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    f5fc579 View commit details
    Browse the repository at this point in the history
Loading
0