Skip to content

typing check started to fail: error: No overload variant of "PrivateAttr" matches argument type "None" #1537

@yarikoptic

Description

@yarikoptic

originally triggered in

❯ tox -e typing
.pkg: _optional_hooks> python /usr/lib/python3/dist-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: get_requires_for_build_sdist> python /usr/lib/python3/dist-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: get_requires_for_build_wheel> python /usr/lib/python3/dist-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: prepare_metadata_for_build_wheel> python /usr/lib/python3/dist-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: build_sdist> python /usr/lib/python3/dist-packages/pyproject_api/_backend.py True setuptools.build_meta
typing: install_package> python -I -m pip install --force-reinstall --no-deps /home/yoh/proj/dandi/dandi-cli-master/.tox/.tmp/package/22/dandi-0.64.0+10.g3940aa26.tar.gz
typing: commands[0]> mypy dandi
dandi/dandiapi.py:1381: error: No overload variant of "PrivateAttr" matches argument type "None"  [call-overload]
        _metadata: Optional[Dict[str, Any]] = PrivateAttr(default_factory=None)
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dandi/dandiapi.py:1381: note: Possible overload variants:
dandi/dandiapi.py:1381: note:     def [_T] PrivateAttr(default: _T, *, init: Literal[False] = ...) -> _T
dandi/dandiapi.py:1381: note:     def [_T] PrivateAttr(*, default_factory: Callable[[], _T], init: Literal[False] = ...) -> _T
dandi/dandiapi.py:1381: note:     def PrivateAttr(*, init: Literal[False] = ...) -> Any
Found 1 error in 1 file (checked 81 source files)
typing: exit 1 (2.81 seconds) /home/yoh/proj/dandi/dandi-cli-master> mypy dandi pid=451944
  typing: FAIL code 1 (6.82=setup[4.01]+cmd[2.81] seconds)
  evaluation failed :( (6.91 seconds)
tox -e typing  5.66s user 0.72s system 90% cpu 7.080 total

@candleindark @jwodder do you see immediate resolution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions