Skip to content

Fail to import typing while running test which runs process which imports typing from setup.py with pytest in python 3.7 #573

@ThomasHickman

Description

@ThomasHickman

setup.py

from setuptools import setup

setup(
    setup_requires=['pytest-runner'],
    install_requires=[
        'typing',
        "pytest"
    ]
)

test_test.py

import subprocess

subprocess.check_call(["python", "-c", "import typing"])
$ docker run --rm -it -w /pwd -v $(pwd):/pwd python:3.7 python setup.py pytest
running pytest
Searching for pytest
Best match: pytest 3.6.3
Processing pytest-3.6.3-py3.7.egg

Using /pwd/.eggs/pytest-3.6.3-py3.7.egg
Searching for typing
Best match: typing 3.6.4
Processing typing-3.6.4-py3.7.egg

Using /pwd/.eggs/typing-3.6.4-py3.7.egg
Searching for six>=1.10.0
Best match: six 1.11.0
Processing six-1.11.0-py3.7.egg

Using /pwd/.eggs/six-1.11.0-py3.7.egg
Searching for py>=1.5.0
Best match: py 1.5.4
Processing py-1.5.4-py3.7.egg

Using /pwd/.eggs/py-1.5.4-py3.7.egg
Searching for pluggy<0.7,>=0.5
Best match: pluggy 0.6.0
Processing pluggy-0.6.0-py3.7.egg

Using /pwd/.eggs/pluggy-0.6.0-py3.7.egg
Searching for more-itertools>=4.0.0
Best match: more-itertools 4.2.0
Processing more_itertools-4.2.0-py3.7.egg

Using /pwd/.eggs/more_itertools-4.2.0-py3.7.egg
Searching for attrs>=17.4.0
Best match: attrs 18.1.0
Processing attrs-18.1.0-py3.7.egg

Using /pwd/.eggs/attrs-18.1.0-py3.7.egg
Searching for atomicwrites>=1.0
Best match: atomicwrites 1.1.5
Processing atomicwrites-1.1.5-py3.7.egg

Using /pwd/.eggs/atomicwrites-1.1.5-py3.7.egg
running egg_info
writing UNKNOWN.egg-info/PKG-INFO
writing dependency_links to UNKNOWN.egg-info/dependency_links.txt
writing requirements to UNKNOWN.egg-info/requires.txt
writing top-level names to UNKNOWN.egg-info/top_level.txt
reading manifest file 'UNKNOWN.egg-info/SOURCES.txt'
writing manifest file 'UNKNOWN.egg-info/SOURCES.txt'
running build_ext
============================================ test session starts ============================================
platform linux -- Python 3.7.0, pytest-3.6.3, py-1.5.4, pluggy-0.6.0
rootdir: /pwd, inifile:
collected 0 items / 1 errors

================================================== ERRORS ===================================================
____________________________________ ERROR collecting tests/test_test.py ____________________________________
tests/test_test.py:3: in <module>
    subprocess.check_call(["python", "-c", "import typing"])
/usr/local/lib/python3.7/subprocess.py:328: in check_call
    raise CalledProcessError(retcode, cmd)
E   subprocess.CalledProcessError: Command '['python', '-c', 'import typing']' returned non-zero exit status 1.
---------------------------------------------- Captured stderr ----------------------------------------------
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/pwd/.eggs/typing-3.6.4-py3.7.egg/typing.py", line 1347, in <module>
    class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
  File "/pwd/.eggs/typing-3.6.4-py3.7.egg/typing.py", line 1003, in __new__
    self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================== 1 error in 0.59 seconds ==========================================

I've used docker, to make this error more reproducible but this errors outside docker as well

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy