Mock Version: 2.12 Mock Version: 2.12 Mock Version: 2.12 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target x86_64 --nodeps /builddir/build/SPECS/python-stack-data.spec'], chrootPath='/var/lib/mock/dist-an23-build-260614-63843/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=86400uid=989gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target x86_64 --nodeps /builddir/build/SPECS/python-stack-data.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'} and shell False Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1683244800 Wrote: /builddir/build/SRPMS/python-stack-data-0.6.2-1.an23.src.rpm Child return code was: 0 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -br --target x86_64 --nodeps /builddir/build/SPECS/python-stack-data.spec'], chrootPath='/var/lib/mock/dist-an23-build-260614-63843/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=86400uid=989gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueraiseExc=FalseprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -br --target x86_64 --nodeps /builddir/build/SPECS/python-stack-data.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'} and shell False Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1683244800 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.hds4BP + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf stack_data-0.6.2 + /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/stack_data-0.6.2.tar.gz + STATUS=0 + '[' 0 -ne 0 ']' + cd stack_data-0.6.2 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/0001-python-typeguard-3.0.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f + RPM_EC=0 ++ jobs -p + exit 0 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.857ULa + umask 022 + cd /builddir/build/BUILD + cd stack_data-0.6.2 + echo pyproject-rpm-macros + echo python3-devel + echo 'python3dist(pip) >= 19' + echo 'python3dist(packaging)' + '[' -f pyproject.toml ']' + echo 'python3dist(toml)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + RPM_TOXENV=py310 + HOSTNAME=rpmbuild + /usr/bin/python3 -s /usr/lib/rpm/anolis/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 -r -t Import error: No module named 'toml' + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-stack-data-0.6.2-1.an23.buildreqs.nosrc.rpm Child return code was: 11 Dynamic buildrequires detected Going to install missing buildrequires. See root.log for details. ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -br --target x86_64 --nodeps /builddir/build/SPECS/python-stack-data.spec'], chrootPath='/var/lib/mock/dist-an23-build-260614-63843/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=86400uid=989gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueraiseExc=FalseprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -br --target x86_64 --nodeps /builddir/build/SPECS/python-stack-data.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'} and shell False Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1683244800 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.xrmZDD + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf stack_data-0.6.2 + /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/stack_data-0.6.2.tar.gz + STATUS=0 + '[' 0 -ne 0 ']' + cd stack_data-0.6.2 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/0001-python-typeguard-3.0.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f + RPM_EC=0 ++ jobs -p + exit 0 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.SaTGEW + umask 022 + cd /builddir/build/BUILD + cd stack_data-0.6.2 + echo pyproject-rpm-macros + echo python3-devel + echo 'python3dist(pip) >= 19' + echo 'python3dist(packaging)' + '[' -f pyproject.toml ']' + echo 'python3dist(toml)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + RPM_TOXENV=py310 + HOSTNAME=rpmbuild + /usr/bin/python3 -s /usr/lib/rpm/anolis/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 -r -t Handling setuptools>=44 from build-system.requires Requirement satisfied: setuptools>=44 (installed: setuptools 65.5.1) Handling wheel from build-system.requires Requirement not satisfied: wheel Handling setuptools_scm[toml]>=3.4.3 from build-system.requires Requirement not satisfied: setuptools_scm[toml]>=3.4.3 Exiting dependency generation pass: build backend + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-stack-data-0.6.2-1.an23.buildreqs.nosrc.rpm Child return code was: 11 Dynamic buildrequires detected Going to install missing buildrequires. See root.log for details. ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -br --target x86_64 --nodeps /builddir/build/SPECS/python-stack-data.spec'], chrootPath='/var/lib/mock/dist-an23-build-260614-63843/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=86400uid=989gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueraiseExc=FalseprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -br --target x86_64 --nodeps /builddir/build/SPECS/python-stack-data.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'} and shell False Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1683244800 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.g4M5ru + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf stack_data-0.6.2 + /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/stack_data-0.6.2.tar.gz + STATUS=0 + '[' 0 -ne 0 ']' + cd stack_data-0.6.2 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/0001-python-typeguard-3.0.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f + RPM_EC=0 ++ jobs -p + exit 0 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.zgunqZ + umask 022 + cd /builddir/build/BUILD + cd stack_data-0.6.2 + echo pyproject-rpm-macros + echo python3-devel + echo 'python3dist(pip) >= 19' + echo 'python3dist(packaging)' + '[' -f pyproject.toml ']' + echo 'python3dist(toml)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + RPM_TOXENV=py310 + HOSTNAME=rpmbuild + /usr/bin/python3 -s /usr/lib/rpm/anolis/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 -r -t Handling setuptools>=44 from build-system.requires Requirement satisfied: setuptools>=44 (installed: setuptools 65.5.1) Handling wheel from build-system.requires Requirement satisfied: wheel (installed: wheel 0.38.4) Handling setuptools_scm[toml]>=3.4.3 from build-system.requires Requirement satisfied: setuptools_scm[toml]>=3.4.3 (installed: setuptools_scm 7.1.0) (extras are currently not checked) Handling wheel from get_requires_for_build_wheel Requirement satisfied: wheel (installed: wheel 0.38.4) Handling setuptools>=44 from get_requires_for_build_wheel Requirement satisfied: setuptools>=44 (installed: setuptools 65.5.1) Handling setuptools_scm[toml]>=3.4.3 from get_requires_for_build_wheel Requirement satisfied: setuptools_scm[toml]>=3.4.3 (installed: setuptools_scm 7.1.0) (extras are currently not checked) Handling tox-current-env >= 0.0.6 from tox itself Requirement not satisfied: tox-current-env >= 0.0.6 Exiting dependency generation pass: tox itself + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-stack-data-0.6.2-1.an23.buildreqs.nosrc.rpm Child return code was: 11 Dynamic buildrequires detected Going to install missing buildrequires. See root.log for details. ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -br --target x86_64 --nodeps /builddir/build/SPECS/python-stack-data.spec'], chrootPath='/var/lib/mock/dist-an23-build-260614-63843/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=86400uid=989gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueraiseExc=FalseprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -br --target x86_64 --nodeps /builddir/build/SPECS/python-stack-data.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'} and shell False Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1683244800 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.1OSIcZ + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf stack_data-0.6.2 + /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/stack_data-0.6.2.tar.gz + STATUS=0 + '[' 0 -ne 0 ']' + cd stack_data-0.6.2 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/0001-python-typeguard-3.0.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f + RPM_EC=0 ++ jobs -p + exit 0 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.J5ZYrO + umask 022 + cd /builddir/build/BUILD + cd stack_data-0.6.2 + echo pyproject-rpm-macros + echo python3-devel + echo 'python3dist(pip) >= 19' + echo 'python3dist(packaging)' + '[' -f pyproject.toml ']' + echo 'python3dist(toml)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + RPM_TOXENV=py310 + HOSTNAME=rpmbuild + /usr/bin/python3 -s /usr/lib/rpm/anolis/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 -r -t Handling setuptools>=44 from build-system.requires Requirement satisfied: setuptools>=44 (installed: setuptools 65.5.1) Handling wheel from build-system.requires Requirement satisfied: wheel (installed: wheel 0.38.4) Handling setuptools_scm[toml]>=3.4.3 from build-system.requires Requirement satisfied: setuptools_scm[toml]>=3.4.3 (installed: setuptools_scm 7.1.0) (extras are currently not checked) Handling wheel from get_requires_for_build_wheel Requirement satisfied: wheel (installed: wheel 0.38.4) Handling setuptools>=44 from get_requires_for_build_wheel Requirement satisfied: setuptools>=44 (installed: setuptools 65.5.1) Handling setuptools_scm[toml]>=3.4.3 from get_requires_for_build_wheel Requirement satisfied: setuptools_scm[toml]>=3.4.3 (installed: setuptools_scm 7.1.0) (extras are currently not checked) Handling tox-current-env >= 0.0.6 from tox itself Requirement satisfied: tox-current-env >= 0.0.6 (installed: tox-current-env 0.0.11) py310: OK (0.00 seconds) congratulations :) (0.17 seconds) Handling tox from tox --print-deps-only: py310 Requirement satisfied: tox (installed: tox 4.4.7) HOOK STDOUT: running dist_info HOOK STDOUT: writing stack_data.egg-info/PKG-INFO HOOK STDOUT: writing dependency_links to stack_data.egg-info/dependency_links.txt HOOK STDOUT: writing requirements to stack_data.egg-info/requires.txt HOOK STDOUT: writing top-level names to stack_data.egg-info/top_level.txt HOOK STDOUT: reading manifest file 'stack_data.egg-info/SOURCES.txt' HOOK STDOUT: reading manifest template 'MANIFEST.in' HOOK STDOUT: adding license file 'LICENSE.txt' HOOK STDOUT: writing manifest file 'stack_data.egg-info/SOURCES.txt' HOOK STDOUT: creating '/builddir/build/BUILD/stack_data-0.6.2/stack_data-0.6.2.dist-info' Handling executing (>=1.2.0) from wheel metadata: Requires-Dist Requirement not satisfied: executing (>=1.2.0) Handling asttokens (>=2.1.0) from wheel metadata: Requires-Dist Requirement not satisfied: asttokens (>=2.1.0) Handling pure-eval from wheel metadata: Requires-Dist Requirement not satisfied: pure-eval Handling pytest ; extra == 'tests' from wheel metadata: Requires-Dist Requirement not satisfied: pytest ; extra == 'tests' Handling typeguard ; extra == 'tests' from wheel metadata: Requires-Dist Requirement satisfied: typeguard ; extra == 'tests' (installed: typeguard 3.0.2) Handling pygments ; extra == 'tests' from wheel metadata: Requires-Dist Requirement not satisfied: pygments ; extra == 'tests' Handling littleutils ; extra == 'tests' from wheel metadata: Requires-Dist Requirement not satisfied: littleutils ; extra == 'tests' Handling cython ; extra == 'tests' from wheel metadata: Requires-Dist Requirement not satisfied: cython ; extra == 'tests' + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-stack-data-0.6.2-1.an23.buildreqs.nosrc.rpm Child return code was: 11 Dynamic buildrequires detected Going to install missing buildrequires. See root.log for details. ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -br --target x86_64 --nodeps /builddir/build/SPECS/python-stack-data.spec'], chrootPath='/var/lib/mock/dist-an23-build-260614-63843/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=86400uid=989gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueraiseExc=FalseprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -br --target x86_64 --nodeps /builddir/build/SPECS/python-stack-data.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'} and shell False Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1683244800 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.QN9RTG + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf stack_data-0.6.2 + /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/stack_data-0.6.2.tar.gz + STATUS=0 + '[' 0 -ne 0 ']' + cd stack_data-0.6.2 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + /usr/lib/rpm/rpmuncompress /builddir/build/SOURCES/0001-python-typeguard-3.0.patch + /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f + RPM_EC=0 ++ jobs -p + exit 0 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.htZTlE + umask 022 + cd /builddir/build/BUILD + cd stack_data-0.6.2 + echo pyproject-rpm-macros + echo python3-devel + echo 'python3dist(pip) >= 19' + echo 'python3dist(packaging)' + '[' -f pyproject.toml ']' + echo 'python3dist(toml)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + RPM_TOXENV=py310 + HOSTNAME=rpmbuild + /usr/bin/python3 -s /usr/lib/rpm/anolis/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 -r -t Handling setuptools>=44 from build-system.requires Requirement satisfied: setuptools>=44 (installed: setuptools 65.5.1) Handling wheel from build-system.requires Requirement satisfied: wheel (installed: wheel 0.38.4) Handling setuptools_scm[toml]>=3.4.3 from build-system.requires Requirement satisfied: setuptools_scm[toml]>=3.4.3 (installed: setuptools_scm 7.1.0) (extras are currently not checked) Handling wheel from get_requires_for_build_wheel Requirement satisfied: wheel (installed: wheel 0.38.4) Handling setuptools>=44 from get_requires_for_build_wheel Requirement satisfied: setuptools>=44 (installed: setuptools 65.5.1) Handling setuptools_scm[toml]>=3.4.3 from get_requires_for_build_wheel Requirement satisfied: setuptools_scm[toml]>=3.4.3 (installed: setuptools_scm 7.1.0) (extras are currently not checked) Handling tox-current-env >= 0.0.6 from tox itself Requirement satisfied: tox-current-env >= 0.0.6 (installed: tox-current-env 0.0.11) py310: OK (0.00 seconds) congratulations :) (0.17 seconds) Handling tox from tox --print-deps-only: py310 Requirement satisfied: tox (installed: tox 4.4.7) HOOK STDOUT: running dist_info HOOK STDOUT: writing stack_data.egg-info/PKG-INFO HOOK STDOUT: writing dependency_links to stack_data.egg-info/dependency_links.txt HOOK STDOUT: writing requirements to stack_data.egg-info/requires.txt HOOK STDOUT: writing top-level names to stack_data.egg-info/top_level.txt HOOK STDOUT: reading manifest file 'stack_data.egg-info/SOURCES.txt' HOOK STDOUT: reading manifest template 'MANIFEST.in' HOOK STDOUT: adding license file 'LICENSE.txt' HOOK STDOUT: writing manifest file 'stack_data.egg-info/SOURCES.txt' HOOK STDOUT: creating '/builddir/build/BUILD/stack_data-0.6.2/stack_data-0.6.2.dist-info' Handling executing (>=1.2.0) from wheel metadata: Requires-Dist Requirement satisfied: executing (>=1.2.0) (installed: executing 1.2.0) Handling asttokens (>=2.1.0) from wheel metadata: Requires-Dist Requirement satisfied: asttokens (>=2.1.0) (installed: asttokens 2.2.1) Handling pure-eval from wheel metadata: Requires-Dist Requirement satisfied: pure-eval (installed: pure-eval 0.2.2) Handling pytest ; extra == 'tests' from wheel metadata: Requires-Dist Requirement satisfied: pytest ; extra == 'tests' (installed: pytest 7.3.1) Handling typeguard ; extra == 'tests' from wheel metadata: Requires-Dist Requirement satisfied: typeguard ; extra == 'tests' (installed: typeguard 3.0.2) Handling pygments ; extra == 'tests' from wheel metadata: Requires-Dist Requirement satisfied: pygments ; extra == 'tests' (installed: pygments 2.14.0) Handling littleutils ; extra == 'tests' from wheel metadata: Requires-Dist Requirement satisfied: littleutils ; extra == 'tests' (installed: littleutils 0.2.2) Handling cython ; extra == 'tests' from wheel metadata: Requires-Dist Requirement satisfied: cython ; extra == 'tests' (installed: cython 0.29.32) + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-stack-data-0.6.2-1.an23.buildreqs.nosrc.rpm Child return code was: 11 Dynamic buildrequires detected Going to install missing buildrequires. See root.log for details. ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -ba --noprep --target x86_64 --nodeps /builddir/build/SPECS/python-stack-data.spec'], chrootPath='/var/lib/mock/dist-an23-build-260614-63843/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=86400uid=989gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -ba --noprep --target x86_64 --nodeps /builddir/build/SPECS/python-stack-data.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'} and shell False Building target platforms: x86_64 Building for target x86_64 setting SOURCE_DATE_EPOCH=1683244800 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.nrcJWJ + umask 022 + cd /builddir/build/BUILD + cd stack_data-0.6.2 + echo pyproject-rpm-macros + echo python3-devel + echo 'python3dist(pip) >= 19' + echo 'python3dist(packaging)' + '[' -f pyproject.toml ']' + echo 'python3dist(toml)' + rm -rfv stack_data-0.6.2.dist-info/ removed 'stack_data-0.6.2.dist-info/top_level.txt' removed 'stack_data-0.6.2.dist-info/METADATA' removed 'stack_data-0.6.2.dist-info/LICENSE.txt' removed directory 'stack_data-0.6.2.dist-info/' + '[' -f /usr/bin/python3 ']' + RPM_TOXENV=py310 + HOSTNAME=rpmbuild + /usr/bin/python3 -s /usr/lib/rpm/anolis/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 -r -t Handling setuptools>=44 from build-system.requires Requirement satisfied: setuptools>=44 (installed: setuptools 65.5.1) Handling wheel from build-system.requires Requirement satisfied: wheel (installed: wheel 0.38.4) Handling setuptools_scm[toml]>=3.4.3 from build-system.requires Requirement satisfied: setuptools_scm[toml]>=3.4.3 (installed: setuptools_scm 7.1.0) (extras are currently not checked) Handling wheel from get_requires_for_build_wheel Requirement satisfied: wheel (installed: wheel 0.38.4) Handling setuptools>=44 from get_requires_for_build_wheel Requirement satisfied: setuptools>=44 (installed: setuptools 65.5.1) Handling setuptools_scm[toml]>=3.4.3 from get_requires_for_build_wheel Requirement satisfied: setuptools_scm[toml]>=3.4.3 (installed: setuptools_scm 7.1.0) (extras are currently not checked) Handling tox-current-env >= 0.0.6 from tox itself Requirement satisfied: tox-current-env >= 0.0.6 (installed: tox-current-env 0.0.11) py310: OK (0.00 seconds) congratulations :) (0.18 seconds) Handling tox from tox --print-deps-only: py310 Requirement satisfied: tox (installed: tox 4.4.7) HOOK STDOUT: running dist_info HOOK STDOUT: writing stack_data.egg-info/PKG-INFO HOOK STDOUT: writing dependency_links to stack_data.egg-info/dependency_links.txt HOOK STDOUT: writing requirements to stack_data.egg-info/requires.txt HOOK STDOUT: writing top-level names to stack_data.egg-info/top_level.txt HOOK STDOUT: reading manifest file 'stack_data.egg-info/SOURCES.txt' HOOK STDOUT: reading manifest template 'MANIFEST.in' HOOK STDOUT: adding license file 'LICENSE.txt' HOOK STDOUT: writing manifest file 'stack_data.egg-info/SOURCES.txt' HOOK STDOUT: creating '/builddir/build/BUILD/stack_data-0.6.2/stack_data-0.6.2.dist-info' Handling executing (>=1.2.0) from wheel metadata: Requires-Dist Requirement satisfied: executing (>=1.2.0) (installed: executing 1.2.0) Handling asttokens (>=2.1.0) from wheel metadata: Requires-Dist Requirement satisfied: asttokens (>=2.1.0) (installed: asttokens 2.2.1) Handling pure-eval from wheel metadata: Requires-Dist Requirement satisfied: pure-eval (installed: pure-eval 0.2.2) Handling pytest ; extra == 'tests' from wheel metadata: Requires-Dist Requirement satisfied: pytest ; extra == 'tests' (installed: pytest 7.3.1) Handling typeguard ; extra == 'tests' from wheel metadata: Requires-Dist Requirement satisfied: typeguard ; extra == 'tests' (installed: typeguard 3.0.2) Handling pygments ; extra == 'tests' from wheel metadata: Requires-Dist Requirement satisfied: pygments ; extra == 'tests' (installed: pygments 2.14.0) Handling littleutils ; extra == 'tests' from wheel metadata: Requires-Dist Requirement satisfied: littleutils ; extra == 'tests' (installed: littleutils 0.2.2) Handling cython ; extra == 'tests' from wheel metadata: Requires-Dist Requirement satisfied: cython ; extra == 'tests' (installed: cython 0.29.32) + RPM_EC=0 ++ jobs -p + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.FOzVUC + umask 022 + cd /builddir/build/BUILD + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/anolis/anolis-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/anolis/anolis-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/anolis/anolis-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/anolis/anolis-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/anolis/anolis-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/anolis/anolis-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/anolis/anolis-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/anolis/anolis-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules' + export FCFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/anolis/anolis-hardened-ld -specs=/usr/lib/rpm/anolis/anolis-annobin-cc1 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib64: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + cd stack_data-0.6.2 + mkdir -p /builddir/build/BUILD/stack_data-0.6.2/.pyproject-builddir + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/anolis/anolis-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/anolis/anolis-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/anolis/anolis-hardened-ld -specs=/usr/lib/rpm/anolis/anolis-annobin-cc1 -Wl,--build-id=sha1 ' + TMPDIR=/builddir/build/BUILD/stack_data-0.6.2/.pyproject-builddir + /usr/bin/python3 -m pip wheel --wheel-dir /builddir/build/BUILD/stack_data-0.6.2/pyproject-wheeldir --no-deps --use-pep517 --no-build-isolation --disable-pip-version-check --no-clean --progress-bar off --verbose . Looking in indexes: https://mirrors.aliyun.com/pypi/simple/ Processing /builddir/build/BUILD/stack_data-0.6.2 Preparing metadata (pyproject.toml): started Running command Preparing metadata (pyproject.toml) running dist_info creating /builddir/build/BUILD/stack_data-0.6.2/.pyproject-builddir/pip-modern-metadata-iy61xwjl/stack_data.egg-info writing /builddir/build/BUILD/stack_data-0.6.2/.pyproject-builddir/pip-modern-metadata-iy61xwjl/stack_data.egg-info/PKG-INFO writing dependency_links to /builddir/build/BUILD/stack_data-0.6.2/.pyproject-builddir/pip-modern-metadata-iy61xwjl/stack_data.egg-info/dependency_links.txt writing requirements to /builddir/build/BUILD/stack_data-0.6.2/.pyproject-builddir/pip-modern-metadata-iy61xwjl/stack_data.egg-info/requires.txt writing top-level names to /builddir/build/BUILD/stack_data-0.6.2/.pyproject-builddir/pip-modern-metadata-iy61xwjl/stack_data.egg-info/top_level.txt writing manifest file '/builddir/build/BUILD/stack_data-0.6.2/.pyproject-builddir/pip-modern-metadata-iy61xwjl/stack_data.egg-info/SOURCES.txt' reading manifest file '/builddir/build/BUILD/stack_data-0.6.2/.pyproject-builddir/pip-modern-metadata-iy61xwjl/stack_data.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' adding license file 'LICENSE.txt' writing manifest file '/builddir/build/BUILD/stack_data-0.6.2/.pyproject-builddir/pip-modern-metadata-iy61xwjl/stack_data.egg-info/SOURCES.txt' creating '/builddir/build/BUILD/stack_data-0.6.2/.pyproject-builddir/pip-modern-metadata-iy61xwjl/stack_data-0.6.2.dist-info' Preparing metadata (pyproject.toml): finished with status 'done' Building wheels for collected packages: stack-data Building wheel for stack-data (pyproject.toml): started Running command Building wheel for stack-data (pyproject.toml) running bdist_wheel running build running build_py creating build creating build/lib creating build/lib/stack_data copying stack_data/__init__.py -> build/lib/stack_data copying stack_data/core.py -> build/lib/stack_data copying stack_data/formatting.py -> build/lib/stack_data copying stack_data/serializing.py -> build/lib/stack_data copying stack_data/utils.py -> build/lib/stack_data copying stack_data/version.py -> build/lib/stack_data running egg_info writing stack_data.egg-info/PKG-INFO writing dependency_links to stack_data.egg-info/dependency_links.txt writing requirements to stack_data.egg-info/requires.txt writing top-level names to stack_data.egg-info/top_level.txt reading manifest file 'stack_data.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' adding license file 'LICENSE.txt' writing manifest file 'stack_data.egg-info/SOURCES.txt' copying stack_data/py.typed -> build/lib/stack_data installing to build/bdist.linux-x86_64/wheel running install running install_lib creating build/bdist.linux-x86_64 creating build/bdist.linux-x86_64/wheel creating build/bdist.linux-x86_64/wheel/stack_data copying build/lib/stack_data/__init__.py -> build/bdist.linux-x86_64/wheel/stack_data copying build/lib/stack_data/core.py -> build/bdist.linux-x86_64/wheel/stack_data copying build/lib/stack_data/formatting.py -> build/bdist.linux-x86_64/wheel/stack_data copying build/lib/stack_data/serializing.py -> build/bdist.linux-x86_64/wheel/stack_data copying build/lib/stack_data/utils.py -> build/bdist.linux-x86_64/wheel/stack_data copying build/lib/stack_data/version.py -> build/bdist.linux-x86_64/wheel/stack_data copying build/lib/stack_data/py.typed -> build/bdist.linux-x86_64/wheel/stack_data running install_egg_info Copying stack_data.egg-info to build/bdist.linux-x86_64/wheel/stack_data-0.6.2-py3.10.egg-info running install_scripts creating build/bdist.linux-x86_64/wheel/stack_data-0.6.2.dist-info/WHEEL creating '/builddir/build/BUILD/stack_data-0.6.2/.pyproject-builddir/pip-wheel-twf922og/tmpxcv46aia/stack_data-0.6.2-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it adding 'stack_data/__init__.py' adding 'stack_data/core.py' adding 'stack_data/formatting.py' adding 'stack_data/py.typed' adding 'stack_data/serializing.py' adding 'stack_data/utils.py' adding 'stack_data/version.py' adding 'stack_data-0.6.2.dist-info/LICENSE.txt' adding 'stack_data-0.6.2.dist-info/METADATA' adding 'stack_data-0.6.2.dist-info/WHEEL' adding 'stack_data-0.6.2.dist-info/top_level.txt' adding 'stack_data-0.6.2.dist-info/RECORD' removing build/bdist.linux-x86_64/wheel Building wheel for stack-data (pyproject.toml): finished with status 'done' Created wheel for stack-data: filename=stack_data-0.6.2-py3-none-any.whl size=24496 sha256=6fe0949e6e91cc15c1b893bc5ed34e61d1e95a4f1c176e22ab0e1f223a7ed1e4 Stored in directory: /builddir/.cache/pip/wheels/37/e9/cd/85d36b97481bbad2df588021196799e3de429f4f8a68ab6a9d Successfully built stack-data + RPM_EC=0 ++ jobs -p + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.aiBren + umask 022 + cd /builddir/build/BUILD + '[' /builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64 '!=' / ']' + rm -rf /builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64 ++ dirname /builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64 + mkdir -p /builddir/build/BUILDROOT + mkdir /builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64 + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/anolis/anolis-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/anolis/anolis-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/anolis/anolis-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/anolis/anolis-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/anolis/anolis-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/anolis/anolis-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/anolis/anolis-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/anolis/anolis-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules' + export FCFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/anolis/anolis-hardened-ld -specs=/usr/lib/rpm/anolis/anolis-annobin-cc1 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib64: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + cd stack_data-0.6.2 ++ ls /builddir/build/BUILD/stack_data-0.6.2/pyproject-wheeldir/stack_data-0.6.2-py3-none-any.whl ++ xargs basename --multiple ++ sed -E 's/([^-]+)-([^-]+)-.+\.whl/\1==\2/' + specifier=stack_data==0.6.2 + TMPDIR=/builddir/build/BUILD/stack_data-0.6.2/.pyproject-builddir + /usr/bin/python3 -m pip install --root /builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64 --no-deps --disable-pip-version-check --progress-bar off --verbose --ignore-installed --no-warn-script-location --no-index --no-cache-dir --find-links /builddir/build/BUILD/stack_data-0.6.2/pyproject-wheeldir stack_data==0.6.2 Using pip 23.1 from /usr/lib/python3.10/site-packages/pip (python 3.10) Looking in links: /builddir/build/BUILD/stack_data-0.6.2/pyproject-wheeldir Processing ./pyproject-wheeldir/stack_data-0.6.2-py3-none-any.whl Installing collected packages: stack_data Successfully installed stack_data-0.6.2 + '[' -d /builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64/usr/bin ']' + rm -f /builddir/build/BUILD/pyproject-ghost-distinfo + site_dirs=() + '[' -d /builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64/usr/lib/python3.10/site-packages ']' + site_dirs+=("/usr/lib/python3.10/site-packages") + '[' /builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64/usr/lib64/python3.10/site-packages '!=' /builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64/usr/lib/python3.10/site-packages ']' + '[' -d /builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64/usr/lib64/python3.10/site-packages ']' + for site_dir in ${site_dirs[@]} + for distinfo in /builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64$site_dir/*.dist-info + echo '%ghost /usr/lib/python3.10/site-packages/stack_data-0.6.2.dist-info' + sed -i s/pip/rpm/ /builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64/usr/lib/python3.10/site-packages/stack_data-0.6.2.dist-info/INSTALLER + PYTHONPATH=/usr/lib/rpm/anolis + /usr/bin/python3 -B /usr/lib/rpm/anolis/pyproject_preprocess_record.py --buildroot /builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64 --record /builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64/usr/lib/python3.10/site-packages/stack_data-0.6.2.dist-info/RECORD --output /builddir/build/BUILD/pyproject-record + rm -fv /builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64/usr/lib/python3.10/site-packages/stack_data-0.6.2.dist-info/RECORD removed '/builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64/usr/lib/python3.10/site-packages/stack_data-0.6.2.dist-info/RECORD' + rm -fv /builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64/usr/lib/python3.10/site-packages/stack_data-0.6.2.dist-info/REQUESTED removed '/builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64/usr/lib/python3.10/site-packages/stack_data-0.6.2.dist-info/REQUESTED' ++ wc -l /builddir/build/BUILD/pyproject-ghost-distinfo ++ cut -f1 '-d ' + lines=1 + '[' 1 -ne 1 ']' + /usr/bin/python3 /usr/lib/rpm/anolis/pyproject_save_files.py --output-files /builddir/build/BUILD/pyproject-files --output-modules /builddir/build/BUILD/pyproject-modules --buildroot /builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64 --sitelib /usr/lib/python3.10/site-packages --sitearch /usr/lib64/python3.10/site-packages --python-version 3.10 --pyproject-record /builddir/build/BUILD/pyproject-record --prefix /usr stack_data + /usr/bin/find-debuginfo -j64 --strict-build-id -m -i --build-id-seed 0.6.2-1.an23 --unique-debug-suffix -0.6.2-1.an23.x86_64 --unique-debug-src-base python-stack-data-0.6.2-1.an23.x86_64 --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 -S debugsourcefiles.list /builddir/build/BUILD/stack_data-0.6.2 find: 'debug': No such file or directory + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/anolis/brp-ldconfig + COMPRESS='zstd -f --rm -19 -T0' + COMPRESS_EXT=.zst + /usr/lib/rpm/brp-compress + /usr/lib/rpm/anolis/brp-strip-lto /usr/bin/strip + /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/check-rpaths + /usr/lib/rpm/brp-remove-la-files + /usr/lib/rpm/anolis/clean_perl + /usr/lib/rpm/anolis/check_elf_files + /usr/lib/rpm/anolis/brp-mangle-shebangs + /usr/lib/rpm/anolis/remove-info-dir + /usr/lib/rpm/anolis/check-desktop-files + /usr/lib/rpm/anolis/brp-python-bytecompile '' 1 0 Bytecompiling .py files below /builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64/usr/lib/python3.10 using python3.10 + /usr/lib/rpm/anolis/brp-python-hardlink Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.caoGN4 + umask 022 + cd /builddir/build/BUILD + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/anolis/anolis-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/anolis/anolis-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/anolis/anolis-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/anolis/anolis-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/anolis/anolis-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/anolis/anolis-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/anolis/anolis-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/anolis/anolis-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules' + export FCFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/anolis/anolis-hardened-ld -specs=/usr/lib/rpm/anolis/anolis-annobin-cc1 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib64: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + cd stack_data-0.6.2 + TOX_TESTENV_PASSENV='*' + PYTHONDONTWRITEBYTECODE=1 + PATH=/builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin + PYTHONPATH=/builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64/usr/lib64/python3.10/site-packages:/builddir/build/BUILDROOT/python-stack-data-0.6.2-1.an23.x86_64/usr/lib/python3.10/site-packages + PYTEST_ADDOPTS=' --ignore=/builddir/build/BUILD/stack_data-0.6.2/.pyproject-builddir' + HOSTNAME=rpmbuild + /usr/bin/python3 -m tox --current-env -q --recreate -e py310 ============================= test session starts ============================== platform linux -- Python 3.10.11, pytest-7.3.1, pluggy-1.0.0 cachedir: .tox/py310/.pytest_cache rootdir: /builddir/build/BUILD/stack_data-0.6.2 plugins: typeguard-3.0.2 collected 21 items tests/test_core.py FF.FFFF.F....FF [ 71%] tests/test_formatter.py F. [ 80%] tests/test_serializer.py F [ 85%] tests/test_utils.py ... [100%] =================================== FAILURES =================================== _____________________________ test_lines_with_gaps _____________________________ self = func = frame_locals = {'self': FrameInfo()} self_type = def __init__( self, func: FunctionType, frame_locals: dict[str, Any] | None = None, self_type: type | None = None, ): frame_globals = getattr(func, "__globals__", None) or sys._getframe(1).f_globals super().__init__(frame_globals, frame_locals or {}) self.func = func self.self_type = self_type assert ( frame_locals is not None ), "frame must be specified if args or kwargs is None" self.arguments = frame_locals.copy() self.arguments.pop("typeguard", None) func = inspect.unwrap(func) try: > self.type_hints = _type_hints_map[func] /usr/lib/python3.10/site-packages/typeguard/_memo.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = key = def __getitem__(self, key): > return self.data[ref(key)] E KeyError: /usr/lib64/python3.10/weakref.py:416: KeyError During handling of the above exception, another exception occurred: self = func = frame_locals = {'self': FrameInfo()} self_type = def __init__( self, func: FunctionType, frame_locals: dict[str, Any] | None = None, self_type: type | None = None, ): frame_globals = getattr(func, "__globals__", None) or sys._getframe(1).f_globals super().__init__(frame_globals, frame_locals or {}) self.func = func self.self_type = self_type assert ( frame_locals is not None ), "frame must be specified if args or kwargs is None" self.arguments = frame_locals.copy() self.arguments.pop("typeguard", None) func = inspect.unwrap(func) try: self.type_hints = _type_hints_map[func] except KeyError: try: > self.type_hints = _type_hints_map[func] = get_type_hints( func, localns=frame_locals, include_extras=True ) /usr/lib/python3.10/site-packages/typeguard/_memo.py:73: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ obj = , globalns = {} localns = {'self': FrameInfo()} include_extras = True def get_type_hints(obj, globalns=None, localns=None, include_extras=False): """Return type hints for an object. This is often the same as obj.__annotations__, but it handles forward references encoded as string literals, adds Optional[t] if a default value equal to None is set and recursively replaces all 'Annotated[T, ...]' with 'T' (unless 'include_extras=True'). The argument may be a module, class, method, or function. The annotations are returned as a dictionary. For classes, annotations include also inherited members. TypeError is raised if the argument is not of a type that can contain annotations, and an empty dictionary is returned if no annotations are present. BEWARE -- the behavior of globalns and localns is counterintuitive (unless you are familiar with how eval() and exec() work). The search order is locals first, then globals. - If no dict arguments are passed, an attempt is made to use the globals from obj (or the respective module's globals for classes), and these are also used as the locals. If the object does not appear to have globals, an empty dictionary is used. For classes, the search order is globals first then locals. - If one dict argument is passed, it is used for both globals and locals. - If two dict arguments are passed, they specify globals and locals, respectively. """ if getattr(obj, '__no_type_check__', None): return {} # Classes require a special treatment. if isinstance(obj, type): hints = {} for base in reversed(obj.__mro__): if globalns is None: base_globals = getattr(sys.modules.get(base.__module__, None), '__dict__', {}) else: base_globals = globalns ann = base.__dict__.get('__annotations__', {}) if isinstance(ann, types.GetSetDescriptorType): ann = {} base_locals = dict(vars(base)) if localns is None else localns if localns is None and globalns is None: # This is surprising, but required. Before Python 3.10, # get_type_hints only evaluated the globalns of # a class. To maintain backwards compatibility, we reverse # the globalns and localns order so that eval() looks into # *base_globals* first rather than *base_locals*. # This only affects ForwardRefs. base_globals, base_locals = base_locals, base_globals for name, value in ann.items(): if value is None: value = type(None) if isinstance(value, str): value = ForwardRef(value, is_argument=False, is_class=True) value = _eval_type(value, base_globals, base_locals) hints[name] = value return hints if include_extras else {k: _strip_annotations(t) for k, t in hints.items()} if globalns is None: if isinstance(obj, types.ModuleType): globalns = obj.__dict__ else: nsobj = obj # Find globalns for the unwrapped object. while hasattr(nsobj, '__wrapped__'): nsobj = nsobj.__wrapped__ globalns = getattr(nsobj, '__globals__', {}) if localns is None: localns = globalns elif localns is None: localns = globalns hints = getattr(obj, '__annotations__', None) if hints is None: # Return empty annotations for something that _could_ have them. if isinstance(obj, _allowed_types): return {} else: > raise TypeError('{!r} is not a module, class, method, ' 'or function.'.format(obj)) E TypeError: is not a module, class, method, or function. /usr/lib64/python3.10/typing.py:1856: TypeError During handling of the above exception, another exception occurred: def test_lines_with_gaps(): lines = [] dedented = False def gather_lines(): frame = inspect.currentframe().f_back frame_info = FrameInfo(frame, options) assert repr(frame_info) == "FrameInfo({})".format(frame) lines[:] = [ line.render(strip_leading_indent=dedented) if isinstance(line, Line) else line for line in frame_info.lines ] def foo(): x = 1 lst = [1] lst.insert(0, x) lst.append( [ 1, 2, 3, 4, 5, 6 ][0]) gather_lines() lst += [99] return lst options = Options(include_signature=True) > foo() tests/test_core.py:57: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/test_core.py:52: in foo gather_lines() tests/test_core.py:35: in gather_lines for line in frame_info.lines stack_data/utils.py:144: in cached_property_wrapper value = obj.__dict__[self.func.__name__] = self.func(obj) stack_data/core.py:719: in lines def lines(self) -> List[Union[Line, LineGap, BlankLineRange]]: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = func = frame_locals = {'self': FrameInfo()} self_type = def __init__( self, func: FunctionType, frame_locals: dict[str, Any] | None = None, self_type: type | None = None, ): frame_globals = getattr(func, "__globals__", None) or sys._getframe(1).f_globals super().__init__(frame_globals, frame_locals or {}) self.func = func self.self_type = self_type assert ( frame_locals is not None ), "frame must be specified if args or kwargs is None" self.arguments = frame_locals.copy() self.arguments.pop("typeguard", None) func = inspect.unwrap(func) try: self.type_hints = _type_hints_map[func] except KeyError: try: self.type_hints = _type_hints_map[func] = get_type_hints( func, localns=frame_locals, include_extras=True ) except (TypeError, NameError): type_hints = {} > for key, annotation in func.__annotations__.items(): E AttributeError: 'cached_property' object has no attribute '__annotations__' /usr/lib/python3.10/site-packages/typeguard/_memo.py:78: AttributeError _________________________________ test_markers _________________________________ self = func = frame_locals = {'self': FrameInfo()} self_type = def __init__( self, func: FunctionType, frame_locals: dict[str, Any] | None = None, self_type: type | None = None, ): frame_globals = getattr(func, "__globals__", None) or sys._getframe(1).f_globals super().__init__(frame_globals, frame_locals or {}) self.func = func self.self_type = self_type assert ( frame_locals is not None ), "frame must be specified if args or kwargs is None" self.arguments = frame_locals.copy() self.arguments.pop("typeguard", None) func = inspect.unwrap(func) try: > self.type_hints = _type_hints_map[func] /usr/lib/python3.10/site-packages/typeguard/_memo.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = key = def __getitem__(self, key): > return self.data[ref(key)] E KeyError: /usr/lib64/python3.10/weakref.py:416: KeyError During handling of the above exception, another exception occurred: self = func = frame_locals = {'self': FrameInfo()} self_type = def __init__( self, func: FunctionType, frame_locals: dict[str, Any] | None = None, self_type: type | None = None, ): frame_globals = getattr(func, "__globals__", None) or sys._getframe(1).f_globals super().__init__(frame_globals, frame_locals or {}) self.func = func self.self_type = self_type assert ( frame_locals is not None ), "frame must be specified if args or kwargs is None" self.arguments = frame_locals.copy() self.arguments.pop("typeguard", None) func = inspect.unwrap(func) try: self.type_hints = _type_hints_map[func] except KeyError: try: > self.type_hints = _type_hints_map[func] = get_type_hints( func, localns=frame_locals, include_extras=True ) /usr/lib/python3.10/site-packages/typeguard/_memo.py:73: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ obj = , globalns = {} localns = {'self': FrameInfo()} include_extras = True def get_type_hints(obj, globalns=None, localns=None, include_extras=False): """Return type hints for an object. This is often the same as obj.__annotations__, but it handles forward references encoded as string literals, adds Optional[t] if a default value equal to None is set and recursively replaces all 'Annotated[T, ...]' with 'T' (unless 'include_extras=True'). The argument may be a module, class, method, or function. The annotations are returned as a dictionary. For classes, annotations include also inherited members. TypeError is raised if the argument is not of a type that can contain annotations, and an empty dictionary is returned if no annotations are present. BEWARE -- the behavior of globalns and localns is counterintuitive (unless you are familiar with how eval() and exec() work). The search order is locals first, then globals. - If no dict arguments are passed, an attempt is made to use the globals from obj (or the respective module's globals for classes), and these are also used as the locals. If the object does not appear to have globals, an empty dictionary is used. For classes, the search order is globals first then locals. - If one dict argument is passed, it is used for both globals and locals. - If two dict arguments are passed, they specify globals and locals, respectively. """ if getattr(obj, '__no_type_check__', None): return {} # Classes require a special treatment. if isinstance(obj, type): hints = {} for base in reversed(obj.__mro__): if globalns is None: base_globals = getattr(sys.modules.get(base.__module__, None), '__dict__', {}) else: base_globals = globalns ann = base.__dict__.get('__annotations__', {}) if isinstance(ann, types.GetSetDescriptorType): ann = {} base_locals = dict(vars(base)) if localns is None else localns if localns is None and globalns is None: # This is surprising, but required. Before Python 3.10, # get_type_hints only evaluated the globalns of # a class. To maintain backwards compatibility, we reverse # the globalns and localns order so that eval() looks into # *base_globals* first rather than *base_locals*. # This only affects ForwardRefs. base_globals, base_locals = base_locals, base_globals for name, value in ann.items(): if value is None: value = type(None) if isinstance(value, str): value = ForwardRef(value, is_argument=False, is_class=True) value = _eval_type(value, base_globals, base_locals) hints[name] = value return hints if include_extras else {k: _strip_annotations(t) for k, t in hints.items()} if globalns is None: if isinstance(obj, types.ModuleType): globalns = obj.__dict__ else: nsobj = obj # Find globalns for the unwrapped object. while hasattr(nsobj, '__wrapped__'): nsobj = nsobj.__wrapped__ globalns = getattr(nsobj, '__globals__', {}) if localns is None: localns = globalns elif localns is None: localns = globalns hints = getattr(obj, '__annotations__', None) if hints is None: # Return empty annotations for something that _could_ have them. if isinstance(obj, _allowed_types): return {} else: > raise TypeError('{!r} is not a module, class, method, ' 'or function.'.format(obj)) E TypeError: is not a module, class, method, or function. /usr/lib64/python3.10/typing.py:1856: TypeError During handling of the above exception, another exception occurred: def test_markers(): options = Options(before=0, after=0) > line = only(FrameInfo(inspect.currentframe(), options).lines) tests/test_core.py:151: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ stack_data/utils.py:144: in cached_property_wrapper value = obj.__dict__[self.func.__name__] = self.func(obj) stack_data/core.py:719: in lines def lines(self) -> List[Union[Line, LineGap, BlankLineRange]]: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = func = frame_locals = {'self': FrameInfo()} self_type = def __init__( self, func: FunctionType, frame_locals: dict[str, Any] | None = None, self_type: type | None = None, ): frame_globals = getattr(func, "__globals__", None) or sys._getframe(1).f_globals super().__init__(frame_globals, frame_locals or {}) self.func = func self.self_type = self_type assert ( frame_locals is not None ), "frame must be specified if args or kwargs is None" self.arguments = frame_locals.copy() self.arguments.pop("typeguard", None) func = inspect.unwrap(func) try: self.type_hints = _type_hints_map[func] except KeyError: try: self.type_hints = _type_hints_map[func] = get_type_hints( func, localns=frame_locals, include_extras=True ) except (TypeError, NameError): type_hints = {} > for key, annotation in func.__annotations__.items(): E AttributeError: 'cached_property' object has no attribute '__annotations__' /usr/lib/python3.10/site-packages/typeguard/_memo.py:78: AttributeError ________________________________ test_variables ________________________________ self = func = frame_locals = {'self': FrameInfo()} self_type = def __init__( self, func: FunctionType, frame_locals: dict[str, Any] | None = None, self_type: type | None = None, ): frame_globals = getattr(func, "__globals__", None) or sys._getframe(1).f_globals super().__init__(frame_globals, frame_locals or {}) self.func = func self.self_type = self_type assert ( frame_locals is not None ), "frame must be specified if args or kwargs is None" self.arguments = frame_locals.copy() self.arguments.pop("typeguard", None) func = inspect.unwrap(func) try: > self.type_hints = _type_hints_map[func] /usr/lib/python3.10/site-packages/typeguard/_memo.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = key = def __getitem__(self, key): > return self.data[ref(key)] E KeyError: /usr/lib64/python3.10/weakref.py:416: KeyError During handling of the above exception, another exception occurred: self = func = frame_locals = {'self': FrameInfo()} self_type = def __init__( self, func: FunctionType, frame_locals: dict[str, Any] | None = None, self_type: type | None = None, ): frame_globals = getattr(func, "__globals__", None) or sys._getframe(1).f_globals super().__init__(frame_globals, frame_locals or {}) self.func = func self.self_type = self_type assert ( frame_locals is not None ), "frame must be specified if args or kwargs is None" self.arguments = frame_locals.copy() self.arguments.pop("typeguard", None) func = inspect.unwrap(func) try: self.type_hints = _type_hints_map[func] except KeyError: try: > self.type_hints = _type_hints_map[func] = get_type_hints( func, localns=frame_locals, include_extras=True ) /usr/lib/python3.10/site-packages/typeguard/_memo.py:73: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ obj = , globalns = {} localns = {'self': FrameInfo()} include_extras = True def get_type_hints(obj, globalns=None, localns=None, include_extras=False): """Return type hints for an object. This is often the same as obj.__annotations__, but it handles forward references encoded as string literals, adds Optional[t] if a default value equal to None is set and recursively replaces all 'Annotated[T, ...]' with 'T' (unless 'include_extras=True'). The argument may be a module, class, method, or function. The annotations are returned as a dictionary. For classes, annotations include also inherited members. TypeError is raised if the argument is not of a type that can contain annotations, and an empty dictionary is returned if no annotations are present. BEWARE -- the behavior of globalns and localns is counterintuitive (unless you are familiar with how eval() and exec() work). The search order is locals first, then globals. - If no dict arguments are passed, an attempt is made to use the globals from obj (or the respective module's globals for classes), and these are also used as the locals. If the object does not appear to have globals, an empty dictionary is used. For classes, the search order is globals first then locals. - If one dict argument is passed, it is used for both globals and locals. - If two dict arguments are passed, they specify globals and locals, respectively. """ if getattr(obj, '__no_type_check__', None): return {} # Classes require a special treatment. if isinstance(obj, type): hints = {} for base in reversed(obj.__mro__): if globalns is None: base_globals = getattr(sys.modules.get(base.__module__, None), '__dict__', {}) else: base_globals = globalns ann = base.__dict__.get('__annotations__', {}) if isinstance(ann, types.GetSetDescriptorType): ann = {} base_locals = dict(vars(base)) if localns is None else localns if localns is None and globalns is None: # This is surprising, but required. Before Python 3.10, # get_type_hints only evaluated the globalns of # a class. To maintain backwards compatibility, we reverse # the globalns and localns order so that eval() looks into # *base_globals* first rather than *base_locals*. # This only affects ForwardRefs. base_globals, base_locals = base_locals, base_globals for name, value in ann.items(): if value is None: value = type(None) if isinstance(value, str): value = ForwardRef(value, is_argument=False, is_class=True) value = _eval_type(value, base_globals, base_locals) hints[name] = value return hints if include_extras else {k: _strip_annotations(t) for k, t in hints.items()} if globalns is None: if isinstance(obj, types.ModuleType): globalns = obj.__dict__ else: nsobj = obj # Find globalns for the unwrapped object. while hasattr(nsobj, '__wrapped__'): nsobj = nsobj.__wrapped__ globalns = getattr(nsobj, '__globals__', {}) if localns is None: localns = globalns elif localns is None: localns = globalns hints = getattr(obj, '__annotations__', None) if hints is None: # Return empty annotations for something that _could_ have them. if isinstance(obj, _allowed_types): return {} else: > raise TypeError('{!r} is not a module, class, method, ' 'or function.'.format(obj)) E TypeError: is not a module, class, method, or function. /usr/lib64/python3.10/typing.py:1856: TypeError During handling of the above exception, another exception occurred: def test_variables(): options = Options(before=1, after=0) assert repr(options) == ('Options(after=0, before=1, ' + 'blank_lines=,' + ' include_signature=False, ' + 'max_lines_per_piece=6, pygments_formatter=None)') def foo(arg, _arg2: str = None, *_args, **_kwargs): y = 123986 str(y) x = {982347298304} str(x) return ( FrameInfo(inspect.currentframe(), options), arg, arg, )[0] frame_info = foo('this is arg') > assert sum(line.is_current for line in frame_info.lines) == 1 tests/test_core.py:227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ stack_data/utils.py:144: in cached_property_wrapper value = obj.__dict__[self.func.__name__] = self.func(obj) stack_data/core.py:719: in lines def lines(self) -> List[Union[Line, LineGap, BlankLineRange]]: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = func = frame_locals = {'self': FrameInfo()} self_type = def __init__( self, func: FunctionType, frame_locals: dict[str, Any] | None = None, self_type: type | None = None, ): frame_globals = getattr(func, "__globals__", None) or sys._getframe(1).f_globals super().__init__(frame_globals, frame_locals or {}) self.func = func self.self_type = self_type assert ( frame_locals is not None ), "frame must be specified if args or kwargs is None" self.arguments = frame_locals.copy() self.arguments.pop("typeguard", None) func = inspect.unwrap(func) try: self.type_hints = _type_hints_map[func] except KeyError: try: self.type_hints = _type_hints_map[func] = get_type_hints( func, localns=frame_locals, include_extras=True ) except (TypeError, NameError): type_hints = {} > for key, annotation in func.__annotations__.items(): E AttributeError: 'cached_property' object has no attribute '__annotations__' /usr/lib/python3.10/site-packages/typeguard/_memo.py:78: AttributeError _________________________________ test_pieces __________________________________ self = func = frame_locals = {'self': } self_type = def __init__( self, func: FunctionType, frame_locals: dict[str, Any] | None = None, self_type: type | None = None, ): frame_globals = getattr(func, "__globals__", None) or sys._getframe(1).f_globals super().__init__(frame_globals, frame_locals or {}) self.func = func self.self_type = self_type assert ( frame_locals is not None ), "frame must be specified if args or kwargs is None" self.arguments = frame_locals.copy() self.arguments.pop("typeguard", None) func = inspect.unwrap(func) try: > self.type_hints = _type_hints_map[func] /usr/lib/python3.10/site-packages/typeguard/_memo.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = key = def __getitem__(self, key): > return self.data[ref(key)] E KeyError: /usr/lib64/python3.10/weakref.py:416: KeyError During handling of the above exception, another exception occurred: self = func = frame_locals = {'self': } self_type = def __init__( self, func: FunctionType, frame_locals: dict[str, Any] | None = None, self_type: type | None = None, ): frame_globals = getattr(func, "__globals__", None) or sys._getframe(1).f_globals super().__init__(frame_globals, frame_locals or {}) self.func = func self.self_type = self_type assert ( frame_locals is not None ), "frame must be specified if args or kwargs is None" self.arguments = frame_locals.copy() self.arguments.pop("typeguard", None) func = inspect.unwrap(func) try: self.type_hints = _type_hints_map[func] except KeyError: try: > self.type_hints = _type_hints_map[func] = get_type_hints( func, localns=frame_locals, include_extras=True ) /usr/lib/python3.10/site-packages/typeguard/_memo.py:73: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ obj = , globalns = {} localns = {'self': } include_extras = True def get_type_hints(obj, globalns=None, localns=None, include_extras=False): """Return type hints for an object. This is often the same as obj.__annotations__, but it handles forward references encoded as string literals, adds Optional[t] if a default value equal to None is set and recursively replaces all 'Annotated[T, ...]' with 'T' (unless 'include_extras=True'). The argument may be a module, class, method, or function. The annotations are returned as a dictionary. For classes, annotations include also inherited members. TypeError is raised if the argument is not of a type that can contain annotations, and an empty dictionary is returned if no annotations are present. BEWARE -- the behavior of globalns and localns is counterintuitive (unless you are familiar with how eval() and exec() work). The search order is locals first, then globals. - If no dict arguments are passed, an attempt is made to use the globals from obj (or the respective module's globals for classes), and these are also used as the locals. If the object does not appear to have globals, an empty dictionary is used. For classes, the search order is globals first then locals. - If one dict argument is passed, it is used for both globals and locals. - If two dict arguments are passed, they specify globals and locals, respectively. """ if getattr(obj, '__no_type_check__', None): return {} # Classes require a special treatment. if isinstance(obj, type): hints = {} for base in reversed(obj.__mro__): if globalns is None: base_globals = getattr(sys.modules.get(base.__module__, None), '__dict__', {}) else: base_globals = globalns ann = base.__dict__.get('__annotations__', {}) if isinstance(ann, types.GetSetDescriptorType): ann = {} base_locals = dict(vars(base)) if localns is None else localns if localns is None and globalns is None: # This is surprising, but required. Before Python 3.10, # get_type_hints only evaluated the globalns of # a class. To maintain backwards compatibility, we reverse # the globalns and localns order so that eval() looks into # *base_globals* first rather than *base_locals*. # This only affects ForwardRefs. base_globals, base_locals = base_locals, base_globals for name, value in ann.items(): if value is None: value = type(None) if isinstance(value, str): value = ForwardRef(value, is_argument=False, is_class=True) value = _eval_type(value, base_globals, base_locals) hints[name] = value return hints if include_extras else {k: _strip_annotations(t) for k, t in hints.items()} if globalns is None: if isinstance(obj, types.ModuleType): globalns = obj.__dict__ else: nsobj = obj # Find globalns for the unwrapped object. while hasattr(nsobj, '__wrapped__'): nsobj = nsobj.__wrapped__ globalns = getattr(nsobj, '__globals__', {}) if localns is None: localns = globalns elif localns is None: localns = globalns hints = getattr(obj, '__annotations__', None) if hints is None: # Return empty annotations for something that _could_ have them. if isinstance(obj, _allowed_types): return {} else: > raise TypeError('{!r} is not a module, class, method, ' 'or function.'.format(obj)) E TypeError: is not a module, class, method, or function. /usr/lib64/python3.10/typing.py:1856: TypeError During handling of the above exception, another exception occurred: def test_pieces(): filename = samples_dir / "pieces.py" source = Source.for_filename(str(filename)) pieces = [ [ source.lines[i - 1] for i in piece ] > for piece in source.pieces ] tests/test_core.py:328: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ stack_data/utils.py:144: in cached_property_wrapper value = obj.__dict__[self.func.__name__] = self.func(obj) stack_data/core.py:95: in pieces def pieces(self) -> List[range]: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = func = frame_locals = {'self': } self_type = def __init__( self, func: FunctionType, frame_locals: dict[str, Any] | None = None, self_type: type | None = None, ): frame_globals = getattr(func, "__globals__", None) or sys._getframe(1).f_globals super().__init__(frame_globals, frame_locals or {}) self.func = func self.self_type = self_type assert ( frame_locals is not None ), "frame must be specified if args or kwargs is None" self.arguments = frame_locals.copy() self.arguments.pop("typeguard", None) func = inspect.unwrap(func) try: self.type_hints = _type_hints_map[func] except KeyError: try: self.type_hints = _type_hints_map[func] = get_type_hints( func, localns=frame_locals, include_extras=True ) except (TypeError, NameError): type_hints = {} > for key, annotation in func.__annotations__.items(): E AttributeError: 'cached_property' object has no attribute '__annotations__' /usr/lib/python3.10/site-packages/typeguard/_memo.py:78: AttributeError _____________________________ test_skipping_frames _____________________________ collapse = True def check_skipping_frames(collapse: bool): def factorial(n): if n <= 1: return 1 / 0 # exception lineno return n * foo(n - 1) # factorial lineno def foo(n): return factorial(n) # foo lineno try: > factorial(20) # check_skipping_frames lineno tests/test_core.py:430: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 20 def factorial(n): if n <= 1: return 1 / 0 # exception lineno > return n * foo(n - 1) # factorial lineno tests/test_core.py:424: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 19 def foo(n): > return factorial(n) # foo lineno tests/test_core.py:427: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 19 def factorial(n): if n <= 1: return 1 / 0 # exception lineno > return n * foo(n - 1) # factorial lineno tests/test_core.py:424: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 18 def foo(n): > return factorial(n) # foo lineno tests/test_core.py:427: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 18 def factorial(n): if n <= 1: return 1 / 0 # exception lineno > return n * foo(n - 1) # factorial lineno tests/test_core.py:424: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 17 def foo(n): > return factorial(n) # foo lineno tests/test_core.py:427: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 17 def factorial(n): if n <= 1: return 1 / 0 # exception lineno > return n * foo(n - 1) # factorial lineno tests/test_core.py:424: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 16 def foo(n): > return factorial(n) # foo lineno tests/test_core.py:427: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 16 def factorial(n): if n <= 1: return 1 / 0 # exception lineno > return n * foo(n - 1) # factorial lineno tests/test_core.py:424: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 15 def foo(n): > return factorial(n) # foo lineno tests/test_core.py:427: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 15 def factorial(n): if n <= 1: return 1 / 0 # exception lineno > return n * foo(n - 1) # factorial lineno tests/test_core.py:424: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 14 def foo(n): > return factorial(n) # foo lineno tests/test_core.py:427: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 14 def factorial(n): if n <= 1: return 1 / 0 # exception lineno > return n * foo(n - 1) # factorial lineno tests/test_core.py:424: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 13 def foo(n): > return factorial(n) # foo lineno tests/test_core.py:427: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 13 def factorial(n): if n <= 1: return 1 / 0 # exception lineno > return n * foo(n - 1) # factorial lineno tests/test_core.py:424: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 12 def foo(n): > return factorial(n) # foo lineno tests/test_core.py:427: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 12 def factorial(n): if n <= 1: return 1 / 0 # exception lineno > return n * foo(n - 1) # factorial lineno tests/test_core.py:424: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 11 def foo(n): > return factorial(n) # foo lineno tests/test_core.py:427: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 11 def factorial(n): if n <= 1: return 1 / 0 # exception lineno > return n * foo(n - 1) # factorial lineno tests/test_core.py:424: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 10 def foo(n): > return factorial(n) # foo lineno tests/test_core.py:427: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 10 def factorial(n): if n <= 1: return 1 / 0 # exception lineno > return n * foo(n - 1) # factorial lineno tests/test_core.py:424: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 9 def foo(n): > return factorial(n) # foo lineno tests/test_core.py:427: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 9 def factorial(n): if n <= 1: return 1 / 0 # exception lineno > return n * foo(n - 1) # factorial lineno tests/test_core.py:424: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 8 def foo(n): > return factorial(n) # foo lineno tests/test_core.py:427: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 8 def factorial(n): if n <= 1: return 1 / 0 # exception lineno > return n * foo(n - 1) # factorial lineno tests/test_core.py:424: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 7 def foo(n): > return factorial(n) # foo lineno tests/test_core.py:427: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 7 def factorial(n): if n <= 1: return 1 / 0 # exception lineno > return n * foo(n - 1) # factorial lineno tests/test_core.py:424: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 6 def foo(n): > return factorial(n) # foo lineno tests/test_core.py:427: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 6 def factorial(n): if n <= 1: return 1 / 0 # exception lineno > return n * foo(n - 1) # factorial lineno tests/test_core.py:424: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 5 def foo(n): > return factorial(n) # foo lineno tests/test_core.py:427: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 5 def factorial(n): if n <= 1: return 1 / 0 # exception lineno > return n * foo(n - 1) # factorial lineno tests/test_core.py:424: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 4 def foo(n): > return factorial(n) # foo lineno tests/test_core.py:427: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 4 def factorial(n): if n <= 1: return 1 / 0 # exception lineno > return n * foo(n - 1) # factorial lineno tests/test_core.py:424: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 3 def foo(n): > return factorial(n) # foo lineno tests/test_core.py:427: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 3 def factorial(n): if n <= 1: return 1 / 0 # exception lineno > return n * foo(n - 1) # factorial lineno tests/test_core.py:424: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 2 def foo(n): > return factorial(n) # foo lineno tests/test_core.py:427: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 2 def factorial(n): if n <= 1: return 1 / 0 # exception lineno > return n * foo(n - 1) # factorial lineno tests/test_core.py:424: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 1 def foo(n): > return factorial(n) # foo lineno tests/test_core.py:427: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 1 def factorial(n): if n <= 1: > return 1 / 0 # exception lineno E ZeroDivisionError: division by zero tests/test_core.py:423: ZeroDivisionError During handling of the above exception, another exception occurred: def test_skipping_frames(): > check_skipping_frames(True) tests/test_core.py:479: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/test_core.py:435: in check_skipping_frames for x in FrameInfo.stack_data(tb, collapse_repeated_frames=collapse): stack_data/core.py:578: in stack_data stack = list(iter_stack(frame_or_tb)) stack_data/utils.py:100: in iter_stack frame_or_tb = frame_or_tb.tb_next /usr/lib/python3.10/site-packages/typeguard/_functions.py:254: in check_variable_assignment check_type_internal(value, annotation, memo) /usr/lib/python3.10/site-packages/typeguard/_checkers.py:676: in check_type_internal checker(value, origin_type, args, memo) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ value = None, origin_type = typing.Union args = (, ) memo = def check_union( value: Any, origin_type: Any, args: tuple[Any, ...], memo: TypeCheckMemo ) -> None: errors: dict[str, TypeCheckError] = {} for type_ in args: try: check_type_internal(value, type_, memo) return except TypeCheckError as exc: errors[get_type_name(type_)] = exc formatted_errors = indent( "\n".join(f"{key}: {error}" for key, error in errors.items()), " " ) > raise TypeCheckError(f"did not match any element in the union:\n{formatted_errors}") E typeguard.TypeCheckError: value assigned to frame_or_tb (NoneType) did not match any element in the union: E frame: is not an instance of frame E traceback: is not an instance of traceback /usr/lib/python3.10/site-packages/typeguard/_checkers.py:385: TypeCheckError _______________________________ test_sys_modules _______________________________ self = func = frame_locals = {'self': } self_type = def __init__( self, func: FunctionType, frame_locals: dict[str, Any] | None = None, self_type: type | None = None, ): frame_globals = getattr(func, "__globals__", None) or sys._getframe(1).f_globals super().__init__(frame_globals, frame_locals or {}) self.func = func self.self_type = self_type assert ( frame_locals is not None ), "frame must be specified if args or kwargs is None" self.arguments = frame_locals.copy() self.arguments.pop("typeguard", None) func = inspect.unwrap(func) try: > self.type_hints = _type_hints_map[func] /usr/lib/python3.10/site-packages/typeguard/_memo.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = key = def __getitem__(self, key): > return self.data[ref(key)] E KeyError: /usr/lib64/python3.10/weakref.py:416: KeyError During handling of the above exception, another exception occurred: self = func = frame_locals = {'self': } self_type = def __init__( self, func: FunctionType, frame_locals: dict[str, Any] | None = None, self_type: type | None = None, ): frame_globals = getattr(func, "__globals__", None) or sys._getframe(1).f_globals super().__init__(frame_globals, frame_locals or {}) self.func = func self.self_type = self_type assert ( frame_locals is not None ), "frame must be specified if args or kwargs is None" self.arguments = frame_locals.copy() self.arguments.pop("typeguard", None) func = inspect.unwrap(func) try: self.type_hints = _type_hints_map[func] except KeyError: try: > self.type_hints = _type_hints_map[func] = get_type_hints( func, localns=frame_locals, include_extras=True ) /usr/lib/python3.10/site-packages/typeguard/_memo.py:73: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ obj = , globalns = {} localns = {'self': } include_extras = True def get_type_hints(obj, globalns=None, localns=None, include_extras=False): """Return type hints for an object. This is often the same as obj.__annotations__, but it handles forward references encoded as string literals, adds Optional[t] if a default value equal to None is set and recursively replaces all 'Annotated[T, ...]' with 'T' (unless 'include_extras=True'). The argument may be a module, class, method, or function. The annotations are returned as a dictionary. For classes, annotations include also inherited members. TypeError is raised if the argument is not of a type that can contain annotations, and an empty dictionary is returned if no annotations are present. BEWARE -- the behavior of globalns and localns is counterintuitive (unless you are familiar with how eval() and exec() work). The search order is locals first, then globals. - If no dict arguments are passed, an attempt is made to use the globals from obj (or the respective module's globals for classes), and these are also used as the locals. If the object does not appear to have globals, an empty dictionary is used. For classes, the search order is globals first then locals. - If one dict argument is passed, it is used for both globals and locals. - If two dict arguments are passed, they specify globals and locals, respectively. """ if getattr(obj, '__no_type_check__', None): return {} # Classes require a special treatment. if isinstance(obj, type): hints = {} for base in reversed(obj.__mro__): if globalns is None: base_globals = getattr(sys.modules.get(base.__module__, None), '__dict__', {}) else: base_globals = globalns ann = base.__dict__.get('__annotations__', {}) if isinstance(ann, types.GetSetDescriptorType): ann = {} base_locals = dict(vars(base)) if localns is None else localns if localns is None and globalns is None: # This is surprising, but required. Before Python 3.10, # get_type_hints only evaluated the globalns of # a class. To maintain backwards compatibility, we reverse # the globalns and localns order so that eval() looks into # *base_globals* first rather than *base_locals*. # This only affects ForwardRefs. base_globals, base_locals = base_locals, base_globals for name, value in ann.items(): if value is None: value = type(None) if isinstance(value, str): value = ForwardRef(value, is_argument=False, is_class=True) value = _eval_type(value, base_globals, base_locals) hints[name] = value return hints if include_extras else {k: _strip_annotations(t) for k, t in hints.items()} if globalns is None: if isinstance(obj, types.ModuleType): globalns = obj.__dict__ else: nsobj = obj # Find globalns for the unwrapped object. while hasattr(nsobj, '__wrapped__'): nsobj = nsobj.__wrapped__ globalns = getattr(nsobj, '__globals__', {}) if localns is None: localns = globalns elif localns is None: localns = globalns hints = getattr(obj, '__annotations__', None) if hints is None: # Return empty annotations for something that _could_ have them. if isinstance(obj, _allowed_types): return {} else: > raise TypeError('{!r} is not a module, class, method, ' 'or function.'.format(obj)) E TypeError: is not a module, class, method, or function. /usr/lib64/python3.10/typing.py:1856: TypeError During handling of the above exception, another exception occurred: def test_sys_modules(): modules = sys_modules_sources() if not os.environ.get('STACK_DATA_SLOW_TESTS'): modules = islice(modules, 0, 3) for source in modules: > check_pieces(source) tests/test_core.py:508: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/test_core.py:513: in check_pieces pieces = source.pieces stack_data/utils.py:144: in cached_property_wrapper value = obj.__dict__[self.func.__name__] = self.func(obj) stack_data/core.py:95: in pieces def pieces(self) -> List[range]: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = func = frame_locals = {'self': } self_type = def __init__( self, func: FunctionType, frame_locals: dict[str, Any] | None = None, self_type: type | None = None, ): frame_globals = getattr(func, "__globals__", None) or sys._getframe(1).f_globals super().__init__(frame_globals, frame_locals or {}) self.func = func self.self_type = self_type assert ( frame_locals is not None ), "frame must be specified if args or kwargs is None" self.arguments = frame_locals.copy() self.arguments.pop("typeguard", None) func = inspect.unwrap(func) try: self.type_hints = _type_hints_map[func] except KeyError: try: self.type_hints = _type_hints_map[func] = get_type_hints( func, localns=frame_locals, include_extras=True ) except (TypeError, NameError): type_hints = {} > for key, annotation in func.__annotations__.items(): E AttributeError: 'cached_property' object has no attribute '__annotations__' /usr/lib/python3.10/site-packages/typeguard/_memo.py:78: AttributeError ----------------------------- Captured stdout call ----------------------------- /usr/lib64/python3.10/importlib/_bootstrap.py ____________________________ test_absolute_filename ____________________________ self = func = frame_locals = {'self': FrameInfo(>)} self_type = def __init__( self, func: FunctionType, frame_locals: dict[str, Any] | None = None, self_type: type | None = None, ): frame_globals = getattr(func, "__globals__", None) or sys._getframe(1).f_globals super().__init__(frame_globals, frame_locals or {}) self.func = func self.self_type = self_type assert ( frame_locals is not None ), "frame must be specified if args or kwargs is None" self.arguments = frame_locals.copy() self.arguments.pop("typeguard", None) func = inspect.unwrap(func) try: > self.type_hints = _type_hints_map[func] /usr/lib/python3.10/site-packages/typeguard/_memo.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = key = def __getitem__(self, key): > return self.data[ref(key)] E KeyError: /usr/lib64/python3.10/weakref.py:416: KeyError During handling of the above exception, another exception occurred: self = func = frame_locals = {'self': FrameInfo(>)} self_type = def __init__( self, func: FunctionType, frame_locals: dict[str, Any] | None = None, self_type: type | None = None, ): frame_globals = getattr(func, "__globals__", None) or sys._getframe(1).f_globals super().__init__(frame_globals, frame_locals or {}) self.func = func self.self_type = self_type assert ( frame_locals is not None ), "frame must be specified if args or kwargs is None" self.arguments = frame_locals.copy() self.arguments.pop("typeguard", None) func = inspect.unwrap(func) try: self.type_hints = _type_hints_map[func] except KeyError: try: > self.type_hints = _type_hints_map[func] = get_type_hints( func, localns=frame_locals, include_extras=True ) /usr/lib/python3.10/site-packages/typeguard/_memo.py:73: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ obj = , globalns = {} localns = {'self': FrameInfo(>)} include_extras = True def get_type_hints(obj, globalns=None, localns=None, include_extras=False): """Return type hints for an object. This is often the same as obj.__annotations__, but it handles forward references encoded as string literals, adds Optional[t] if a default value equal to None is set and recursively replaces all 'Annotated[T, ...]' with 'T' (unless 'include_extras=True'). The argument may be a module, class, method, or function. The annotations are returned as a dictionary. For classes, annotations include also inherited members. TypeError is raised if the argument is not of a type that can contain annotations, and an empty dictionary is returned if no annotations are present. BEWARE -- the behavior of globalns and localns is counterintuitive (unless you are familiar with how eval() and exec() work). The search order is locals first, then globals. - If no dict arguments are passed, an attempt is made to use the globals from obj (or the respective module's globals for classes), and these are also used as the locals. If the object does not appear to have globals, an empty dictionary is used. For classes, the search order is globals first then locals. - If one dict argument is passed, it is used for both globals and locals. - If two dict arguments are passed, they specify globals and locals, respectively. """ if getattr(obj, '__no_type_check__', None): return {} # Classes require a special treatment. if isinstance(obj, type): hints = {} for base in reversed(obj.__mro__): if globalns is None: base_globals = getattr(sys.modules.get(base.__module__, None), '__dict__', {}) else: base_globals = globalns ann = base.__dict__.get('__annotations__', {}) if isinstance(ann, types.GetSetDescriptorType): ann = {} base_locals = dict(vars(base)) if localns is None else localns if localns is None and globalns is None: # This is surprising, but required. Before Python 3.10, # get_type_hints only evaluated the globalns of # a class. To maintain backwards compatibility, we reverse # the globalns and localns order so that eval() looks into # *base_globals* first rather than *base_locals*. # This only affects ForwardRefs. base_globals, base_locals = base_locals, base_globals for name, value in ann.items(): if value is None: value = type(None) if isinstance(value, str): value = ForwardRef(value, is_argument=False, is_class=True) value = _eval_type(value, base_globals, base_locals) hints[name] = value return hints if include_extras else {k: _strip_annotations(t) for k, t in hints.items()} if globalns is None: if isinstance(obj, types.ModuleType): globalns = obj.__dict__ else: nsobj = obj # Find globalns for the unwrapped object. while hasattr(nsobj, '__wrapped__'): nsobj = nsobj.__wrapped__ globalns = getattr(nsobj, '__globals__', {}) if localns is None: localns = globalns elif localns is None: localns = globalns hints = getattr(obj, '__annotations__', None) if hints is None: # Return empty annotations for something that _could_ have them. if isinstance(obj, _allowed_types): return {} else: > raise TypeError('{!r} is not a module, class, method, ' 'or function.'.format(obj)) E TypeError: is not a module, class, method, or function. /usr/lib64/python3.10/typing.py:1856: TypeError During handling of the above exception, another exception occurred: def test_absolute_filename(): sys.path.append(str(samples_dir)) short_filename = "to_exec.py" full_filename = str(samples_dir / short_filename) source = Source.for_filename(short_filename) names = {} code = compile(source.text, short_filename, "exec") exec(code, names) frame_info = names["frame_info"] assert frame_info.source is source assert frame_info.code is code assert code.co_filename == source.filename == short_filename > assert frame_info.filename == full_filename tests/test_core.py:569: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ stack_data/utils.py:144: in cached_property_wrapper value = obj.__dict__[self.func.__name__] = self.func(obj) stack_data/core.py:622: in filename def filename(self) -> str: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = func = frame_locals = {'self': FrameInfo(>)} self_type = def __init__( self, func: FunctionType, frame_locals: dict[str, Any] | None = None, self_type: type | None = None, ): frame_globals = getattr(func, "__globals__", None) or sys._getframe(1).f_globals super().__init__(frame_globals, frame_locals or {}) self.func = func self.self_type = self_type assert ( frame_locals is not None ), "frame must be specified if args or kwargs is None" self.arguments = frame_locals.copy() self.arguments.pop("typeguard", None) func = inspect.unwrap(func) try: self.type_hints = _type_hints_map[func] except KeyError: try: self.type_hints = _type_hints_map[func] = get_type_hints( func, localns=frame_locals, include_extras=True ) except (TypeError, NameError): type_hints = {} > for key, annotation in func.__annotations__.items(): E AttributeError: 'cached_property' object has no attribute '__annotations__' /usr/lib/python3.10/site-packages/typeguard/_memo.py:78: AttributeError _________________________________ test_example _________________________________ def test_example(): from .samples.example import bar > result = bar() tests/test_core.py:590: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/samples/example.py:27: in bar exec("result = foo()", globals(), names) :1: in ??? tests/samples/example.py:20: in foo result = print_stack( tests/samples/example.py:35: in print_stack for frame_info in list(FrameInfo.stack_data(frame, options))[-3:]: stack_data/core.py:578: in stack_data stack = list(iter_stack(frame_or_tb)) stack_data/utils.py:98: in iter_stack frame_or_tb = frame_or_tb.f_back /usr/lib/python3.10/site-packages/typeguard/_functions.py:254: in check_variable_assignment check_type_internal(value, annotation, memo) /usr/lib/python3.10/site-packages/typeguard/_checkers.py:676: in check_type_internal checker(value, origin_type, args, memo) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ value = None, origin_type = typing.Union args = (, ) memo = def check_union( value: Any, origin_type: Any, args: tuple[Any, ...], memo: TypeCheckMemo ) -> None: errors: dict[str, TypeCheckError] = {} for type_ in args: try: check_type_internal(value, type_, memo) return except TypeCheckError as exc: errors[get_type_name(type_)] = exc formatted_errors = indent( "\n".join(f"{key}: {error}" for key, error in errors.items()), " " ) > raise TypeCheckError(f"did not match any element in the union:\n{formatted_errors}") E typeguard.TypeCheckError: value assigned to frame_or_tb (NoneType) did not match any element in the union: E frame: is not an instance of frame E traceback: is not an instance of traceback /usr/lib/python3.10/site-packages/typeguard/_checkers.py:385: TypeCheckError ____________________________ test_pygments_example _____________________________ @pytest.mark.skipif(pygments_version < (2, 12), reason="Different output in older Pygments") def test_pygments_example(): from .samples.pygments_example import bar > result = bar() tests/test_core.py:636: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/samples/pygments_example.py:18: in bar def foo(): tests/samples/pygments_example.py:26: in deco f.result = print_stack() tests/samples/pygments_example.py:43: in print_stack for frame_info in list(FrameInfo.stack_data(frame, options))[-2:]: stack_data/core.py:578: in stack_data stack = list(iter_stack(frame_or_tb)) stack_data/utils.py:98: in iter_stack frame_or_tb = frame_or_tb.f_back /usr/lib/python3.10/site-packages/typeguard/_functions.py:254: in check_variable_assignment check_type_internal(value, annotation, memo) /usr/lib/python3.10/site-packages/typeguard/_checkers.py:676: in check_type_internal checker(value, origin_type, args, memo) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ value = None, origin_type = typing.Union args = (, ) memo = def check_union( value: Any, origin_type: Any, args: tuple[Any, ...], memo: TypeCheckMemo ) -> None: errors: dict[str, TypeCheckError] = {} for type_ in args: try: check_type_internal(value, type_, memo) return except TypeCheckError as exc: errors[get_type_name(type_)] = exc formatted_errors = indent( "\n".join(f"{key}: {error}" for key, error in errors.items()), " " ) > raise TypeCheckError(f"did not match any element in the union:\n{formatted_errors}") E typeguard.TypeCheckError: value assigned to frame_or_tb (NoneType) did not match any element in the union: E frame: is not an instance of frame E traceback: is not an instance of traceback /usr/lib/python3.10/site-packages/typeguard/_checkers.py:385: TypeCheckError _________________________________ test_example _________________________________ n = 0 def foo(n=5): if n > 0: return foo(n - 1) x = 1 lst = ( [ x, ] + [] + [] + [] + [] + [] ) try: > return int(str(lst)) E ValueError: invalid literal for int() with base 10: '[1]' tests/samples/formatter_example.py:21: ValueError During handling of the above exception, another exception occurred: n = 0 def foo(n=5): if n > 0: return foo(n - 1) x = 1 lst = ( [ x, ] + [] + [] + [] + [] + [] ) try: return int(str(lst)) except: try: > return 1 / 0 E ZeroDivisionError: division by zero tests/samples/formatter_example.py:24: ZeroDivisionError The above exception was the direct cause of the following exception: capsys = <_pytest.capture.CaptureFixture object at 0x7f0e2826e950> def test_example(capsys): from .samples.formatter_example import bar, print_stack1, format_stack1, format_frame, f_string, blank_lines @contextmanager def check_example(name): yield stderr = capsys.readouterr().err compare_to_file(stderr, name) with check_example("variables"): try: > bar() tests/test_formatter.py:43: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def bar(): > exec("foo()") tests/samples/formatter_example.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ??? :1: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 5 def foo(n=5): if n > 0: > return foo(n - 1) tests/samples/formatter_example.py:8: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 4 def foo(n=5): if n > 0: > return foo(n - 1) tests/samples/formatter_example.py:8: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 3 def foo(n=5): if n > 0: > return foo(n - 1) tests/samples/formatter_example.py:8: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 2 def foo(n=5): if n > 0: > return foo(n - 1) tests/samples/formatter_example.py:8: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 1 def foo(n=5): if n > 0: > return foo(n - 1) tests/samples/formatter_example.py:8: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ n = 0 def foo(n=5): if n > 0: return foo(n - 1) x = 1 lst = ( [ x, ] + [] + [] + [] + [] + [] ) try: return int(str(lst)) except: try: return 1 / 0 except Exception as e: > raise TypeError from e E TypeError tests/samples/formatter_example.py:26: TypeError During handling of the above exception, another exception occurred: capsys = <_pytest.capture.CaptureFixture object at 0x7f0e2826e950> def test_example(capsys): from .samples.formatter_example import bar, print_stack1, format_stack1, format_frame, f_string, blank_lines @contextmanager def check_example(name): yield stderr = capsys.readouterr().err compare_to_file(stderr, name) with check_example("variables"): try: bar() except Exception: > MyFormatter(show_variables=True).print_exception() tests/test_formatter.py:45: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ stack_data/formatting.py:84: in print_exception self.print_lines(self.format_exception(e), file=file) stack_data/formatting.py:95: in print_lines for line in lines: stack_data/formatting.py:104: in format_exception yield from self.format_exception(e.__cause__) stack_data/formatting.py:108: in format_exception yield from self.format_exception(e.__context__) stack_data/formatting.py:112: in format_exception yield from self.format_stack(e.__traceback__) stack_data/formatting.py:119: in format_stack yield from self.format_stack_data( stack_data/formatting.py:130: in format_stack_data for item in stack: stack_data/core.py:578: in stack_data stack = list(iter_stack(frame_or_tb)) stack_data/utils.py:100: in iter_stack frame_or_tb = frame_or_tb.tb_next /usr/lib/python3.10/site-packages/typeguard/_functions.py:254: in check_variable_assignment check_type_internal(value, annotation, memo) /usr/lib/python3.10/site-packages/typeguard/_checkers.py:676: in check_type_internal checker(value, origin_type, args, memo) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ value = None, origin_type = typing.Union args = (, ) memo = def check_union( value: Any, origin_type: Any, args: tuple[Any, ...], memo: TypeCheckMemo ) -> None: errors: dict[str, TypeCheckError] = {} for type_ in args: try: check_type_internal(value, type_, memo) return except TypeCheckError as exc: errors[get_type_name(type_)] = exc formatted_errors = indent( "\n".join(f"{key}: {error}" for key, error in errors.items()), " " ) > raise TypeCheckError(f"did not match any element in the union:\n{formatted_errors}") E typeguard.TypeCheckError: value assigned to frame_or_tb (NoneType) did not match any element in the union: E frame: is not an instance of frame E traceback: is not an instance of traceback /usr/lib/python3.10/site-packages/typeguard/_checkers.py:385: TypeCheckError ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): _________________________________ test_example _________________________________ self = func = frame_locals = {'self': FrameInfo()} self_type = def __init__( self, func: FunctionType, frame_locals: dict[str, Any] | None = None, self_type: type | None = None, ): frame_globals = getattr(func, "__globals__", None) or sys._getframe(1).f_globals super().__init__(frame_globals, frame_locals or {}) self.func = func self.self_type = self_type assert ( frame_locals is not None ), "frame must be specified if args or kwargs is None" self.arguments = frame_locals.copy() self.arguments.pop("typeguard", None) func = inspect.unwrap(func) try: > self.type_hints = _type_hints_map[func] /usr/lib/python3.10/site-packages/typeguard/_memo.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = key = def __getitem__(self, key): > return self.data[ref(key)] E KeyError: /usr/lib64/python3.10/weakref.py:416: KeyError During handling of the above exception, another exception occurred: self = func = frame_locals = {'self': FrameInfo()} self_type = def __init__( self, func: FunctionType, frame_locals: dict[str, Any] | None = None, self_type: type | None = None, ): frame_globals = getattr(func, "__globals__", None) or sys._getframe(1).f_globals super().__init__(frame_globals, frame_locals or {}) self.func = func self.self_type = self_type assert ( frame_locals is not None ), "frame must be specified if args or kwargs is None" self.arguments = frame_locals.copy() self.arguments.pop("typeguard", None) func = inspect.unwrap(func) try: self.type_hints = _type_hints_map[func] except KeyError: try: > self.type_hints = _type_hints_map[func] = get_type_hints( func, localns=frame_locals, include_extras=True ) /usr/lib/python3.10/site-packages/typeguard/_memo.py:73: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ obj = , globalns = {} localns = {'self': FrameInfo()} include_extras = True def get_type_hints(obj, globalns=None, localns=None, include_extras=False): """Return type hints for an object. This is often the same as obj.__annotations__, but it handles forward references encoded as string literals, adds Optional[t] if a default value equal to None is set and recursively replaces all 'Annotated[T, ...]' with 'T' (unless 'include_extras=True'). The argument may be a module, class, method, or function. The annotations are returned as a dictionary. For classes, annotations include also inherited members. TypeError is raised if the argument is not of a type that can contain annotations, and an empty dictionary is returned if no annotations are present. BEWARE -- the behavior of globalns and localns is counterintuitive (unless you are familiar with how eval() and exec() work). The search order is locals first, then globals. - If no dict arguments are passed, an attempt is made to use the globals from obj (or the respective module's globals for classes), and these are also used as the locals. If the object does not appear to have globals, an empty dictionary is used. For classes, the search order is globals first then locals. - If one dict argument is passed, it is used for both globals and locals. - If two dict arguments are passed, they specify globals and locals, respectively. """ if getattr(obj, '__no_type_check__', None): return {} # Classes require a special treatment. if isinstance(obj, type): hints = {} for base in reversed(obj.__mro__): if globalns is None: base_globals = getattr(sys.modules.get(base.__module__, None), '__dict__', {}) else: base_globals = globalns ann = base.__dict__.get('__annotations__', {}) if isinstance(ann, types.GetSetDescriptorType): ann = {} base_locals = dict(vars(base)) if localns is None else localns if localns is None and globalns is None: # This is surprising, but required. Before Python 3.10, # get_type_hints only evaluated the globalns of # a class. To maintain backwards compatibility, we reverse # the globalns and localns order so that eval() looks into # *base_globals* first rather than *base_locals*. # This only affects ForwardRefs. base_globals, base_locals = base_locals, base_globals for name, value in ann.items(): if value is None: value = type(None) if isinstance(value, str): value = ForwardRef(value, is_argument=False, is_class=True) value = _eval_type(value, base_globals, base_locals) hints[name] = value return hints if include_extras else {k: _strip_annotations(t) for k, t in hints.items()} if globalns is None: if isinstance(obj, types.ModuleType): globalns = obj.__dict__ else: nsobj = obj # Find globalns for the unwrapped object. while hasattr(nsobj, '__wrapped__'): nsobj = nsobj.__wrapped__ globalns = getattr(nsobj, '__globals__', {}) if localns is None: localns = globalns elif localns is None: localns = globalns hints = getattr(obj, '__annotations__', None) if hints is None: # Return empty annotations for something that _could_ have them. if isinstance(obj, _allowed_types): return {} else: > raise TypeError('{!r} is not a module, class, method, ' 'or function.'.format(obj)) E TypeError: is not a module, class, method, or function. /usr/lib64/python3.10/typing.py:1856: TypeError During handling of the above exception, another exception occurred: def test_example(): from .samples.formatter_example import bar, format_frame, format_stack1 result = dict( > format_frame=(format_frame(MyFormatter())), format_stack=format_stack1(MyFormatter(show_variables=True)), ) tests/test_serializer.py:28: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/samples/formatter_example.py:51: in format_frame return formatter.format_frame(frame) tests/test_serializer.py:19: in format_frame result = super().format_frame(frame) stack_data/serializing.py:152: in format_frame filename=frame.filename, stack_data/utils.py:144: in cached_property_wrapper value = obj.__dict__[self.func.__name__] = self.func(obj) stack_data/core.py:622: in filename def filename(self) -> str: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = func = frame_locals = {'self': FrameInfo()} self_type = def __init__( self, func: FunctionType, frame_locals: dict[str, Any] | None = None, self_type: type | None = None, ): frame_globals = getattr(func, "__globals__", None) or sys._getframe(1).f_globals super().__init__(frame_globals, frame_locals or {}) self.func = func self.self_type = self_type assert ( frame_locals is not None ), "frame must be specified if args or kwargs is None" self.arguments = frame_locals.copy() self.arguments.pop("typeguard", None) func = inspect.unwrap(func) try: self.type_hints = _type_hints_map[func] except KeyError: try: self.type_hints = _type_hints_map[func] = get_type_hints( func, localns=frame_locals, include_extras=True ) except (TypeError, NameError): type_hints = {} > for key, annotation in func.__annotations__.items(): E AttributeError: 'cached_property' object has no attribute '__annotations__' /usr/lib/python3.10/site-packages/typeguard/_memo.py:78: AttributeError =============================== warnings summary =============================== ../../../../usr/lib64/python3.10/site-packages/pyximport/pyximport.py:51 /usr/lib64/python3.10/site-packages/pyximport/pyximport.py:51: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses import imp -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== short test summary info ============================ FAILED tests/test_core.py::test_lines_with_gaps - AttributeError: 'cached_pro... FAILED tests/test_core.py::test_markers - AttributeError: 'cached_property' o... FAILED tests/test_core.py::test_variables - AttributeError: 'cached_property'... FAILED tests/test_core.py::test_pieces - AttributeError: 'cached_property' ob... FAILED tests/test_core.py::test_skipping_frames - typeguard.TypeCheckError: v... FAILED tests/test_core.py::test_sys_modules - AttributeError: 'cached_propert... FAILED tests/test_core.py::test_absolute_filename - AttributeError: 'cached_p... FAILED tests/test_core.py::test_example - typeguard.TypeCheckError: value ass... FAILED tests/test_core.py::test_pygments_example - typeguard.TypeCheckError: ... FAILED tests/test_formatter.py::test_example - typeguard.TypeCheckError: valu... FAILED tests/test_serializer.py::test_example - AttributeError: 'cached_prope... =================== 11 failed, 10 passed, 1 warning in 1.02s =================== py310: exit 1 (1.24 seconds) /builddir/build/BUILD/stack_data-0.6.2> pytest pid=1585734 py310: FAIL code 1 (1.25=setup[0.01]+cmd[1.24] seconds) evaluation failed :( (1.43 seconds) error: Bad exit status from /var/tmp/rpm-tmp.caoGN4 (%check) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.caoGN4 (%check) Child return code was: 1 EXCEPTION: [Error()] Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 93, in trace result = func(*args, **kw) File "/usr/lib/python3.6/site-packages/mockbuild/util.py", line 600, in do_with_status raise exception.Error("Command failed: \n # %s\n%s" % (command, output), child.returncode) mockbuild.exception.Error: Command failed: # bash --login -c /usr/bin/rpmbuild -ba --noprep --target x86_64 --nodeps /builddir/build/SPECS/python-stack-data.spec