Thanks to visit codestin.com
Credit goes to github.com

Skip to content

mypy failures on main #3253

@booxter

Description

@booxter
tox -e mypy
mypy: recreate env because python changed version_info=[3, 12, 4, 'final', 0]->[3, 11, 11, 'final', 0] | executable='/opt/homebrew/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/bin/python3.12'->'/nix/store/dxddp6nsbryq1lnp61srqf90nb3n3s0f-python3-3.11.11/bin/python3.11' | virtualenv version='20.26.6'->'20.29.2'
mypy: remove tox env folder /Users/ihrachys/src/instructlab/.tox/mypy
mypy: install_deps> python -I -m pip install 'mypy<1.14,>=1.10.0' 'pydantic<=2.9.2' pytest types-psutil types-PyYAML types-requests types-tqdm
pkg: recreate env because python changed executable='/nix/store/kdgf2msgpg7k6ixqxja6hr3df7vblrpd-python3-3.11.11/bin/python3.11'->'/nix/store/dxddp6nsbryq1lnp61srqf90nb3n3s0f-python3-3.11.11/bin/python3.11' | virtualenv version='20.29.1'->'20.29.2'
pkg: remove tox env folder /Users/ihrachys/src/instructlab/.tox/pkg
pkg: install_requires> python -I -m pip install 'setuptools>=70.1.0' 'setuptools_scm>=8' wheel
pkg: _optional_hooks> python /nix/store/by5ahzhrgh23lhcv7zfp19z1kdr72lxc-python3.11-pyproject-api-1.9.0/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
pkg: get_requires_for_build_wheel> python /nix/store/by5ahzhrgh23lhcv7zfp19z1kdr72lxc-python3.11-pyproject-api-1.9.0/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
pkg: build_wheel> python /nix/store/by5ahzhrgh23lhcv7zfp19z1kdr72lxc-python3.11-pyproject-api-1.9.0/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
mypy: install_package_deps> python -I -m pip install 'GitPython>=3.1.42' 'PyYAML>=6.0.0' 'boto3>=1.35.96' 'click-didyoumean>=0.3.0' 'click<9.0.0,>=8.1.7' 'datasets>=2.18.0' 'docling-core[chunking]>=2.10.0' filelock 'gguf>=0.6.0' 'haystack-ai>=2.8' 'httpx>=0.25.0' 'huggingface-hub[hf_transfer]>=0.1.8' 'instructlab-eval>=0.5.1' 'instructlab-quantize>=0.1.0' 'instructlab-schema>=0.4.2' 'instructlab-sdg>=0.7.2' 'instructlab-training<0.7.1,>=0.7.0' 'llama-cpp-python[server]==0.3.6' 'mlx<0.6.0,>=0.5.1; sys_platform == "darwin" and platform_machine == "arm64"' 'numpy<2.0.0,>=1.26.4' 'openai>=1.13.3' 'peft>=0.9.0' 'prompt-toolkit>=3.0.38' 'psutil>=6.0.0' 'pydantic-yaml>=1.2.0' 'pydantic>=2.7.4' 'rich>=13.3.1' 'rouge-score>=0.1.2' 'ruamel.yaml>=0.17.0' 'sentence-transformers>=3.0.0' 'sentencepiece>=0.2.0' 'tokenizers>=0.11.1' 'toml>=0.10.2' 'torch<2.6.0,>=2.3.0' 'tqdm>=4.66.2' 'transformers>=4.41.2' 'trl<0.15.0,>=0.12.2' 'wandb>=0.16.4' 'xdg-base-dirs>=6.0.1'
mypy: install_package> python -I -m pip install --force-reinstall --no-deps /Users/ihrachys/src/instructlab/.tox/.tmp/package/107/instructlab-0.23.0rc1.dev247-py3-none-any.whl
mypy: commands[0]> mypy
src/instructlab/cli/data/list.py:55: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
tests/test_lab.py:26: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
tests/test_utils.py:41: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
tests/test_utils.py:99: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
tests/test_utils.py:117: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/instructlab/model/chat.py:108: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/instructlab/model/chat.py:837: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/instructlab/model/chat.py:845: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/instructlab/model/simple_train.py:32: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
src/instructlab/rag/convert.py:212: error: Missing positional arguments "options", "accelerator_options" in call to "TesseractOcrModel"  [call-arg]
src/instructlab/rag/convert.py:212: error: Argument 2 to "TesseractOcrModel" has incompatible type "TesseractOcrOptions"; expected "Path | None"  [arg-type]
src/instructlab/rag/convert.py:224: error: Incompatible types in assignment (expression has type "EasyOcrOptions", variable has type "TesseractOcrOptions")  [assignment]
src/instructlab/rag/convert.py:227: error: "TesseractOcrOptions" has no attribute "use_gpu"  [attr-defined]
src/instructlab/rag/convert.py:230: error: Missing positional arguments "options", "accelerator_options" in call to "EasyOcrModel"  [call-arg]
src/instructlab/rag/convert.py:230: error: Argument 2 to "EasyOcrModel" has incompatible type "TesseractOcrOptions"; expected "Path | None"  [arg-type]
src/instructlab/rag/convert.py:237: error: Incompatible return value type (got "None", expected "OcrOptions")  [return-value]
tests/test_lab_rag_convert.py:46: error: Argument "path_or_stream" to "InputDocument" has incompatible type "Path | str | DocumentStream"; expected "BytesIO | Path"  [arg-type]
Found 8 errors in 2 files (checked 165 source files)
mypy: exit 1 (40.39 seconds) /Users/ihrachys/src/instructlab> mypy pid=29038
  mypy: FAIL code 1 (136.36=setup[95.97]+cmd[40.39] seconds)
  evaluation failed :( (136.49 seconds)

There seems to be two separate groups: one is due to annotation-unchecked and another in docling library uses (was there a new docling-core release that changed their signatures?)

annotation-unchecked messages are just notes and probably don't affect the result. Docling failures are the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingci-failurePR has at least one CI failure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions