#67938 closed defect (fixed)

py37-astroid @2.15.6: ERROR cannot import name 'Protocol' from 'typing'

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: stromnov (Andrey Stromnov)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc:
Port: py-astroid py-importlib-metadata

Description

https://build.macports.org/builders/ports-11_arm64-builder/builds/97828/steps/install-port/logs/stdio

Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/build/__main__.py", line 376, in main
    args.srcdir, outdir, distributions, config_settings, not args.no_isolation, args.skip_dependency_check
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/build/__main__.py", line 208, in build_package
    out = _build(isolation, builder, outdir, distribution, config_settings, skip_dependency_check)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/build/__main__.py", line 147, in _build
    return _build_in_current_env(builder, outdir, distribution, config_settings, skip_dependency_check)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/build/__main__.py", line 127, in _build_in_current_env
    missing = builder.check_dependencies(distribution)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/build/__init__.py", line 369, in check_dependencies
    return {u for d in dependencies for u in check_dependency(d)}
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/build/__init__.py", line 369, in <setcomp>
    return {u for d in dependencies for u in check_dependency(d)}
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/build/__init__.py", line 153, in check_dependency
    import importlib_metadata
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/importlib_metadata/__init__.py", line 18, in <module>
    from . import _adapters, _meta, _py39compat
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/importlib_metadata/_meta.py", line 1, in <module>
    from typing import Protocol
ImportError: cannot import name 'Protocol' from 'typing' (/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/typing.py)

ERROR cannot import name 'Protocol' from 'typing' (/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/typing.py)

Change History (4)

comment:1 Changed 15 months ago by stromnov (Andrey Stromnov)

This is an error in the importlib_metadata package, which looks like a version mismatch. In py37-importlib_metadata (v.6.7.0):

from ._compat import Protocol

(Protocol is available in built-in typing package only since Python 3.8).

comment:2 Changed 15 months ago by jmroot (Joshua Root)

Port: py-importlib-metadata added

comment:3 Changed 15 months ago by reneeotten (Renee Otten)

this works locally fine for me with py37-astroid. I *think* the issue has been resolved after the buildbot attempted the build; more specifically this commit.

@ryandesign or @jmroot: can you reschedule builds for the PY37 subport on the buildbots?

comment:4 Changed 10 months ago by reneeotten (Renee Otten)

Resolution: fixed
Status: assignedclosed

In 798c061637da2264db1aa50d9f5bf9b547847837/macports-ports (master):

py-astroid: update to 3.0.2, drop py37 subport

Closes: #67938

Note: See TracTickets for help on using tickets.