Mock Version: 4.1 Mock Version: 4.1 Mock Version: 4.1 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --noclean --target x86_64 --nodeps /builddir/build/SPECS/python-extension-helpers.spec'], chrootPath='/var/lib/mock/dist-oc9-epol-build-243775-83166/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=991gid=135user='mockbuild'nspawn_args=[]unshare_net=FalseprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --noclean --target x86_64 --nodeps /builddir/build/SPECS/python-extension-helpers.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 Wrote: /builddir/build/SRPMS/python-extension-helpers-1.4.0-1.oc9.src.rpm Child return code was: 0 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -br --noclean --target x86_64 --nodeps /builddir/build/SPECS/python-extension-helpers.spec'], chrootPath='/var/lib/mock/dist-oc9-epol-build-243775-83166/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=991gid=135user='mockbuild'nspawn_args=[]unshare_net=FalseraiseExc=FalseprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -br --noclean --target x86_64 --nodeps /builddir/build/SPECS/python-extension-helpers.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 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.DFMxye + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf extension_helpers-1.4.0 + /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/extension-helpers-1.4.0.tar.gz + STATUS=0 + '[' 0 -ne 0 ']' + cd extension_helpers-1.4.0 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + export SETUPTOOLS_SCM_PRETEND_VERSION=1.4.0 + SETUPTOOLS_SCM_PRETEND_VERSION=1.4.0 + RPM_EC=0 ++ jobs -p + exit 0 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.ZalypH + umask 022 + cd /builddir/build/BUILD + cd extension_helpers-1.4.0 + 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=py311 + HOSTNAME=rpmbuild + /usr/bin/python3 -s /usr/lib/rpm/OpenCloudOS/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 Import error: No module named 'toml' + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-extension-helpers-1.4.0-1.oc9.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 --noclean --target x86_64 --nodeps /builddir/build/SPECS/python-extension-helpers.spec'], chrootPath='/var/lib/mock/dist-oc9-epol-build-243775-83166/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=991gid=135user='mockbuild'nspawn_args=[]unshare_net=FalseraiseExc=FalseprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -br --noclean --target x86_64 --nodeps /builddir/build/SPECS/python-extension-helpers.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 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.eoVpiH + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf extension_helpers-1.4.0 + /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/extension-helpers-1.4.0.tar.gz + STATUS=0 + '[' 0 -ne 0 ']' + cd extension_helpers-1.4.0 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + export SETUPTOOLS_SCM_PRETEND_VERSION=1.4.0 + SETUPTOOLS_SCM_PRETEND_VERSION=1.4.0 + RPM_EC=0 ++ jobs -p + exit 0 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.qF2hNt + umask 022 + cd /builddir/build/BUILD + cd extension_helpers-1.4.0 + 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=py311 + HOSTNAME=rpmbuild + /usr/bin/python3 -s /usr/lib/rpm/OpenCloudOS/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 Handling setuptools>=43.0.0 from build-system.requires Requirement not satisfied: setuptools>=43.0.0 Handling setuptools_scm>=6.2 from build-system.requires Requirement not satisfied: setuptools_scm>=6.2 Exiting dependency generation pass: build backend + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-extension-helpers-1.4.0-1.oc9.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 --noclean --target x86_64 --nodeps /builddir/build/SPECS/python-extension-helpers.spec'], chrootPath='/var/lib/mock/dist-oc9-epol-build-243775-83166/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=991gid=135user='mockbuild'nspawn_args=[]unshare_net=FalseraiseExc=FalseprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -br --noclean --target x86_64 --nodeps /builddir/build/SPECS/python-extension-helpers.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 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.dFbQ2O + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf extension_helpers-1.4.0 + /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/extension-helpers-1.4.0.tar.gz + STATUS=0 + '[' 0 -ne 0 ']' + cd extension_helpers-1.4.0 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + export SETUPTOOLS_SCM_PRETEND_VERSION=1.4.0 + SETUPTOOLS_SCM_PRETEND_VERSION=1.4.0 + RPM_EC=0 ++ jobs -p + exit 0 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.Gnse2D + umask 022 + cd /builddir/build/BUILD + cd extension_helpers-1.4.0 + 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=py311 + HOSTNAME=rpmbuild + /usr/bin/python3 -s /usr/lib/rpm/OpenCloudOS/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 Handling setuptools>=43.0.0 from build-system.requires Requirement satisfied: setuptools>=43.0.0 (installed: setuptools 68.0.0) Handling setuptools_scm>=6.2 from build-system.requires Requirement satisfied: setuptools_scm>=6.2 (installed: setuptools_scm 8.0.4) /usr/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py:66: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*. config = read_configuration(filepath, True, ignore_option_errors, dist) warning: no files found matching 'CHANGES.rst' warning: no files found matching 'ah_bootstrap.py' warning: no previously-included files found matching '*.pyc' warning: no previously-included files found matching '*.o' no previously-included directories found matching 'build' HOOK STDOUT: running egg_info HOOK STDOUT: writing extension_helpers.egg-info/PKG-INFO HOOK STDOUT: writing dependency_links to extension_helpers.egg-info/dependency_links.txt HOOK STDOUT: writing entry points to extension_helpers.egg-info/entry_points.txt HOOK STDOUT: writing requirements to extension_helpers.egg-info/requires.txt HOOK STDOUT: writing top-level names to extension_helpers.egg-info/top_level.txt HOOK STDOUT: reading manifest file 'extension_helpers.egg-info/SOURCES.txt' HOOK STDOUT: reading manifest template 'MANIFEST.in' HOOK STDOUT: adding license file 'LICENSE.rst' HOOK STDOUT: writing manifest file 'extension_helpers.egg-info/SOURCES.txt' Handling wheel from get_requires_for_build_wheel Requirement not satisfied: wheel Exiting dependency generation pass: get_requires_for_build_wheel + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-extension-helpers-1.4.0-1.oc9.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 --noclean --target x86_64 --nodeps /builddir/build/SPECS/python-extension-helpers.spec'], chrootPath='/var/lib/mock/dist-oc9-epol-build-243775-83166/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=991gid=135user='mockbuild'nspawn_args=[]unshare_net=FalseraiseExc=FalseprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -br --noclean --target x86_64 --nodeps /builddir/build/SPECS/python-extension-helpers.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 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.qC8BIz + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf extension_helpers-1.4.0 + /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/extension-helpers-1.4.0.tar.gz + STATUS=0 + '[' 0 -ne 0 ']' + cd extension_helpers-1.4.0 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + export SETUPTOOLS_SCM_PRETEND_VERSION=1.4.0 + SETUPTOOLS_SCM_PRETEND_VERSION=1.4.0 + RPM_EC=0 ++ jobs -p + exit 0 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.yJuxU9 + umask 022 + cd /builddir/build/BUILD + cd extension_helpers-1.4.0 + 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=py311 + HOSTNAME=rpmbuild + /usr/bin/python3 -s /usr/lib/rpm/OpenCloudOS/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 Handling setuptools>=43.0.0 from build-system.requires Requirement satisfied: setuptools>=43.0.0 (installed: setuptools 68.0.0) Handling setuptools_scm>=6.2 from build-system.requires Requirement satisfied: setuptools_scm>=6.2 (installed: setuptools_scm 8.0.4) /usr/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py:66: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*. config = read_configuration(filepath, True, ignore_option_errors, dist) warning: no files found matching 'CHANGES.rst' warning: no files found matching 'ah_bootstrap.py' warning: no previously-included files found matching '*.pyc' warning: no previously-included files found matching '*.o' no previously-included directories found matching 'build' HOOK STDOUT: running egg_info HOOK STDOUT: writing extension_helpers.egg-info/PKG-INFO HOOK STDOUT: writing dependency_links to extension_helpers.egg-info/dependency_links.txt HOOK STDOUT: writing entry points to extension_helpers.egg-info/entry_points.txt HOOK STDOUT: writing requirements to extension_helpers.egg-info/requires.txt HOOK STDOUT: writing top-level names to extension_helpers.egg-info/top_level.txt HOOK STDOUT: reading manifest file 'extension_helpers.egg-info/SOURCES.txt' HOOK STDOUT: reading manifest template 'MANIFEST.in' HOOK STDOUT: adding license file 'LICENSE.rst' HOOK STDOUT: writing manifest file 'extension_helpers.egg-info/SOURCES.txt' Handling wheel from get_requires_for_build_wheel Requirement satisfied: wheel (installed: wheel 0.41.2) /usr/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py:66: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*. config = read_configuration(filepath, True, ignore_option_errors, dist) warning: no files found matching 'CHANGES.rst' warning: no files found matching 'ah_bootstrap.py' warning: no previously-included files found matching '*.pyc' warning: no previously-included files found matching '*.o' no previously-included directories found matching 'build' Handling setuptools >=64 from wheel metadata: Requires-Dist Requirement satisfied: setuptools >=64 (installed: setuptools 68.0.0) Handling tomli >=1.0.0 ; python_version < "3.11" from wheel metadata: Requires-Dist Ignoring alien requirement: tomli >=1.0.0 ; python_version < "3.11" Handling sphinx ; extra == 'docs' from wheel metadata: Requires-Dist Ignoring alien requirement: sphinx ; extra == 'docs' Handling sphinx-automodapi ; extra == 'docs' from wheel metadata: Requires-Dist Ignoring alien requirement: sphinx-automodapi ; extra == 'docs' Handling wheel ; extra == 'test' from wheel metadata: Requires-Dist Ignoring alien requirement: wheel ; extra == 'test' Handling pytest ; extra == 'test' from wheel metadata: Requires-Dist Ignoring alien requirement: pytest ; extra == 'test' Handling pytest-cov ; extra == 'test' from wheel metadata: Requires-Dist Ignoring alien requirement: pytest-cov ; extra == 'test' Handling cython ; extra == 'test' from wheel metadata: Requires-Dist Ignoring alien requirement: cython ; extra == 'test' Handling build ; extra == 'test' from wheel metadata: Requires-Dist Ignoring alien requirement: build ; extra == 'test' + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-extension-helpers-1.4.0-1.oc9.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 --noclean --target x86_64 --nodeps /builddir/build/SPECS/python-extension-helpers.spec'], chrootPath='/var/lib/mock/dist-oc9-epol-build-243775-83166/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=991gid=135user='mockbuild'nspawn_args=[]unshare_net=FalseprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -ba --noprep --noclean --target x86_64 --nodeps /builddir/build/SPECS/python-extension-helpers.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 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.d56Iyx + umask 022 + cd /builddir/build/BUILD + cd extension_helpers-1.4.0 + echo pyproject-rpm-macros + echo python3-devel + echo 'python3dist(pip) >= 19' + echo 'python3dist(packaging)' + '[' -f pyproject.toml ']' + echo 'python3dist(toml)' + rm -rfv extension_helpers-1.4.0.dist-info/ removed 'extension_helpers-1.4.0.dist-info/METADATA' removed 'extension_helpers-1.4.0.dist-info/entry_points.txt' removed 'extension_helpers-1.4.0.dist-info/LICENSE.rst' removed 'extension_helpers-1.4.0.dist-info/top_level.txt' removed directory 'extension_helpers-1.4.0.dist-info/' + '[' -f /usr/bin/python3 ']' + RPM_TOXENV=py311 + HOSTNAME=rpmbuild + /usr/bin/python3 -s /usr/lib/rpm/OpenCloudOS/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 Handling setuptools>=43.0.0 from build-system.requires Requirement satisfied: setuptools>=43.0.0 (installed: setuptools 68.0.0) Handling setuptools_scm>=6.2 from build-system.requires Requirement satisfied: setuptools_scm>=6.2 (installed: setuptools_scm 8.0.4) /usr/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py:66: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*. config = read_configuration(filepath, True, ignore_option_errors, dist) warning: no files found matching 'CHANGES.rst' warning: no files found matching 'ah_bootstrap.py' warning: no previously-included files found matching '*.pyc' warning: no previously-included files found matching '*.o' no previously-included directories found matching 'build' HOOK STDOUT: running egg_info HOOK STDOUT: writing extension_helpers.egg-info/PKG-INFO HOOK STDOUT: writing dependency_links to extension_helpers.egg-info/dependency_links.txt HOOK STDOUT: writing entry points to extension_helpers.egg-info/entry_points.txt HOOK STDOUT: writing requirements to extension_helpers.egg-info/requires.txt HOOK STDOUT: writing top-level names to extension_helpers.egg-info/top_level.txt HOOK STDOUT: reading manifest file 'extension_helpers.egg-info/SOURCES.txt' HOOK STDOUT: reading manifest template 'MANIFEST.in' HOOK STDOUT: adding license file 'LICENSE.rst' HOOK STDOUT: writing manifest file 'extension_helpers.egg-info/SOURCES.txt' Handling wheel from get_requires_for_build_wheel Requirement satisfied: wheel (installed: wheel 0.41.2) /usr/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py:66: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*. config = read_configuration(filepath, True, ignore_option_errors, dist) warning: no files found matching 'CHANGES.rst' warning: no files found matching 'ah_bootstrap.py' warning: no previously-included files found matching '*.pyc' warning: no previously-included files found matching '*.o' no previously-included directories found matching 'build' Handling setuptools >=64 from wheel metadata: Requires-Dist Requirement satisfied: setuptools >=64 (installed: setuptools 68.0.0) Handling tomli >=1.0.0 ; python_version < "3.11" from wheel metadata: Requires-Dist Ignoring alien requirement: tomli >=1.0.0 ; python_version < "3.11" Handling sphinx ; extra == 'docs' from wheel metadata: Requires-Dist Ignoring alien requirement: sphinx ; extra == 'docs' Handling sphinx-automodapi ; extra == 'docs' from wheel metadata: Requires-Dist Ignoring alien requirement: sphinx-automodapi ; extra == 'docs' Handling wheel ; extra == 'test' from wheel metadata: Requires-Dist Ignoring alien requirement: wheel ; extra == 'test' Handling pytest ; extra == 'test' from wheel metadata: Requires-Dist Ignoring alien requirement: pytest ; extra == 'test' Handling pytest-cov ; extra == 'test' from wheel metadata: Requires-Dist Ignoring alien requirement: pytest-cov ; extra == 'test' Handling cython ; extra == 'test' from wheel metadata: Requires-Dist Ignoring alien requirement: cython ; extra == 'test' Handling build ; extra == 'test' from wheel metadata: Requires-Dist Ignoring alien requirement: build ; extra == 'test' + RPM_EC=0 ++ jobs -p + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.4EDveZ + 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/OpenCloudOS/OpenCloudOS-hardened-cc1 -fstack-protector-strong -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/OpenCloudOS/OpenCloudOS-hardened-cc1 -fstack-protector-strong -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 -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/OpenCloudOS/OpenCloudOS-hardened-cc1 -fstack-protector-strong -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 -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/OpenCloudOS/OpenCloudOS-hardened-cc1 -fstack-protector-strong -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/OpenCloudOS/OpenCloudOS-hardened-ld -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 extension_helpers-1.4.0 + export SETUPTOOLS_SCM_PRETEND_VERSION=1.4.0 + SETUPTOOLS_SCM_PRETEND_VERSION=1.4.0 + mkdir -p /builddir/build/BUILD/extension_helpers-1.4.0/.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/OpenCloudOS/OpenCloudOS-hardened-cc1 -fstack-protector-strong -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/OpenCloudOS/OpenCloudOS-hardened-ld -Wl,--build-id=sha1' + TMPDIR=/builddir/build/BUILD/extension_helpers-1.4.0/.pyproject-builddir + /usr/bin/python3 -m pip wheel --wheel-dir /builddir/build/BUILD/extension_helpers-1.4.0/pyproject-wheeldir --no-deps --use-pep517 --no-build-isolation --disable-pip-version-check --no-clean --progress-bar off --verbose . Processing /builddir/build/BUILD/extension_helpers-1.4.0 Preparing metadata (pyproject.toml): started Running command Preparing metadata (pyproject.toml) /usr/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py:66: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*. config = read_configuration(filepath, True, ignore_option_errors, dist) running dist_info creating /builddir/build/BUILD/extension_helpers-1.4.0/.pyproject-builddir/pip-modern-metadata-zxb6lv8f/extension_helpers.egg-info writing /builddir/build/BUILD/extension_helpers-1.4.0/.pyproject-builddir/pip-modern-metadata-zxb6lv8f/extension_helpers.egg-info/PKG-INFO writing dependency_links to /builddir/build/BUILD/extension_helpers-1.4.0/.pyproject-builddir/pip-modern-metadata-zxb6lv8f/extension_helpers.egg-info/dependency_links.txt writing entry points to /builddir/build/BUILD/extension_helpers-1.4.0/.pyproject-builddir/pip-modern-metadata-zxb6lv8f/extension_helpers.egg-info/entry_points.txt writing requirements to /builddir/build/BUILD/extension_helpers-1.4.0/.pyproject-builddir/pip-modern-metadata-zxb6lv8f/extension_helpers.egg-info/requires.txt writing top-level names to /builddir/build/BUILD/extension_helpers-1.4.0/.pyproject-builddir/pip-modern-metadata-zxb6lv8f/extension_helpers.egg-info/top_level.txt writing manifest file '/builddir/build/BUILD/extension_helpers-1.4.0/.pyproject-builddir/pip-modern-metadata-zxb6lv8f/extension_helpers.egg-info/SOURCES.txt' reading manifest file '/builddir/build/BUILD/extension_helpers-1.4.0/.pyproject-builddir/pip-modern-metadata-zxb6lv8f/extension_helpers.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching 'CHANGES.rst' warning: no files found matching 'ah_bootstrap.py' warning: no previously-included files found matching '*.pyc' warning: no previously-included files found matching '*.o' no previously-included directories found matching 'build' adding license file 'LICENSE.rst' writing manifest file '/builddir/build/BUILD/extension_helpers-1.4.0/.pyproject-builddir/pip-modern-metadata-zxb6lv8f/extension_helpers.egg-info/SOURCES.txt' creating '/builddir/build/BUILD/extension_helpers-1.4.0/.pyproject-builddir/pip-modern-metadata-zxb6lv8f/extension_helpers-1.4.0.dist-info' Preparing metadata (pyproject.toml): finished with status 'done' Building wheels for collected packages: extension-helpers Building wheel for extension-helpers (pyproject.toml): started Running command Building wheel for extension-helpers (pyproject.toml) /usr/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py:66: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*. config = read_configuration(filepath, True, ignore_option_errors, dist) running bdist_wheel running build running build_py creating build creating build/lib creating build/lib/extension_helpers copying extension_helpers/version.py -> build/lib/extension_helpers copying extension_helpers/_utils.py -> build/lib/extension_helpers copying extension_helpers/__init__.py -> build/lib/extension_helpers copying extension_helpers/_openmp_helpers.py -> build/lib/extension_helpers copying extension_helpers/conftest.py -> build/lib/extension_helpers copying extension_helpers/_setup_helpers.py -> build/lib/extension_helpers creating build/lib/extension_helpers/tests copying extension_helpers/tests/test_utils.py -> build/lib/extension_helpers/tests copying extension_helpers/tests/test_setup_helpers.py -> build/lib/extension_helpers/tests copying extension_helpers/tests/__init__.py -> build/lib/extension_helpers/tests copying extension_helpers/tests/py311_backports.py -> build/lib/extension_helpers/tests copying extension_helpers/tests/test_openmp_helpers.py -> build/lib/extension_helpers/tests creating build/lib/extension_helpers/src copying extension_helpers/src/compiler.c -> build/lib/extension_helpers/src 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/extension_helpers copying build/lib/extension_helpers/version.py -> build/bdist.linux-x86_64/wheel/extension_helpers copying build/lib/extension_helpers/_utils.py -> build/bdist.linux-x86_64/wheel/extension_helpers copying build/lib/extension_helpers/__init__.py -> build/bdist.linux-x86_64/wheel/extension_helpers creating build/bdist.linux-x86_64/wheel/extension_helpers/src copying build/lib/extension_helpers/src/compiler.c -> build/bdist.linux-x86_64/wheel/extension_helpers/src copying build/lib/extension_helpers/_openmp_helpers.py -> build/bdist.linux-x86_64/wheel/extension_helpers copying build/lib/extension_helpers/conftest.py -> build/bdist.linux-x86_64/wheel/extension_helpers creating build/bdist.linux-x86_64/wheel/extension_helpers/tests copying build/lib/extension_helpers/tests/test_utils.py -> build/bdist.linux-x86_64/wheel/extension_helpers/tests copying build/lib/extension_helpers/tests/test_setup_helpers.py -> build/bdist.linux-x86_64/wheel/extension_helpers/tests copying build/lib/extension_helpers/tests/__init__.py -> build/bdist.linux-x86_64/wheel/extension_helpers/tests copying build/lib/extension_helpers/tests/py311_backports.py -> build/bdist.linux-x86_64/wheel/extension_helpers/tests copying build/lib/extension_helpers/tests/test_openmp_helpers.py -> build/bdist.linux-x86_64/wheel/extension_helpers/tests copying build/lib/extension_helpers/_setup_helpers.py -> build/bdist.linux-x86_64/wheel/extension_helpers running install_egg_info running egg_info writing extension_helpers.egg-info/PKG-INFO writing dependency_links to extension_helpers.egg-info/dependency_links.txt writing entry points to extension_helpers.egg-info/entry_points.txt writing requirements to extension_helpers.egg-info/requires.txt writing top-level names to extension_helpers.egg-info/top_level.txt reading manifest file 'extension_helpers.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching 'CHANGES.rst' warning: no files found matching 'ah_bootstrap.py' warning: no previously-included files found matching '*.pyc' warning: no previously-included files found matching '*.o' no previously-included directories found matching 'build' adding license file 'LICENSE.rst' writing manifest file 'extension_helpers.egg-info/SOURCES.txt' Copying extension_helpers.egg-info to build/bdist.linux-x86_64/wheel/extension_helpers-1.4.0-py3.11.egg-info running install_scripts creating build/bdist.linux-x86_64/wheel/extension_helpers-1.4.0.dist-info/WHEEL creating '/builddir/build/BUILD/extension_helpers-1.4.0/.pyproject-builddir/pip-wheel-hnapoume/.tmp-1hcl67yb/extension_helpers-1.4.0-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it adding 'extension_helpers/__init__.py' adding 'extension_helpers/_openmp_helpers.py' adding 'extension_helpers/_setup_helpers.py' adding 'extension_helpers/_utils.py' adding 'extension_helpers/conftest.py' adding 'extension_helpers/version.py' adding 'extension_helpers/src/compiler.c' adding 'extension_helpers/tests/__init__.py' adding 'extension_helpers/tests/py311_backports.py' adding 'extension_helpers/tests/test_openmp_helpers.py' adding 'extension_helpers/tests/test_setup_helpers.py' adding 'extension_helpers/tests/test_utils.py' adding 'extension_helpers-1.4.0.dist-info/LICENSE.rst' adding 'extension_helpers-1.4.0.dist-info/METADATA' adding 'extension_helpers-1.4.0.dist-info/WHEEL' adding 'extension_helpers-1.4.0.dist-info/entry_points.txt' adding 'extension_helpers-1.4.0.dist-info/top_level.txt' adding 'extension_helpers-1.4.0.dist-info/RECORD' removing build/bdist.linux-x86_64/wheel Building wheel for extension-helpers (pyproject.toml): finished with status 'done' Created wheel for extension-helpers: filename=extension_helpers-1.4.0-py3-none-any.whl size=26256 sha256=282d94e22d17a1f825582a1f507e408c3b57eabc97f9ad1f4e11a6c4e6de6a23 Stored in directory: /builddir/.cache/pip/wheels/ae/52/60/e18e07f6e421799219e9ba3bd8b64113a89968001a929b0292 Successfully built extension-helpers + RPM_EC=0 ++ jobs -p + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.ZM6KQe + umask 022 + cd /builddir/build/BUILD + '[' /builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.x86_64 '!=' / ']' + rm -rf /builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.x86_64 ++ dirname /builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.x86_64 + mkdir -p /builddir/build/BUILDROOT + mkdir /builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.x86_64 + cd extension_helpers-1.4.0 ++ ls /builddir/build/BUILD/extension_helpers-1.4.0/pyproject-wheeldir/extension_helpers-1.4.0-py3-none-any.whl ++ xargs basename --multiple ++ sed -E 's/([^-]+)-([^-]+)-.+\.whl/\1==\2/' + specifier=extension_helpers==1.4.0 + TMPDIR=/builddir/build/BUILD/extension_helpers-1.4.0/.pyproject-builddir + /usr/bin/python3 -m pip install --root /builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.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/extension_helpers-1.4.0/pyproject-wheeldir extension_helpers==1.4.0 Using pip 23.3.1 from /usr/lib/python3.11/site-packages/pip (python 3.11) Looking in links: /builddir/build/BUILD/extension_helpers-1.4.0/pyproject-wheeldir Processing ./pyproject-wheeldir/extension_helpers-1.4.0-py3-none-any.whl Installing collected packages: extension_helpers Successfully installed extension_helpers-1.4.0 + '[' -d /builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.x86_64/usr/bin ']' + rm -f /builddir/build/BUILD/pyproject-ghost-distinfo + site_dirs=() + '[' -d /builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.x86_64/usr/lib/python3.11/site-packages ']' + site_dirs+=("/usr/lib/python3.11/site-packages") + '[' /builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.x86_64/usr/lib64/python3.11/site-packages '!=' /builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.x86_64/usr/lib/python3.11/site-packages ']' + '[' -d /builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.x86_64/usr/lib64/python3.11/site-packages ']' + for site_dir in ${site_dirs[@]} + for distinfo in /builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.x86_64$site_dir/*.dist-info + echo '%ghost /usr/lib/python3.11/site-packages/extension_helpers-1.4.0.dist-info' + sed -i s/pip/rpm/ /builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.x86_64/usr/lib/python3.11/site-packages/extension_helpers-1.4.0.dist-info/INSTALLER + PYTHONPATH=/usr/lib/rpm/OpenCloudOS + /usr/bin/python3 -B /usr/lib/rpm/OpenCloudOS/pyproject_preprocess_record.py --buildroot /builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.x86_64 --record /builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.x86_64/usr/lib/python3.11/site-packages/extension_helpers-1.4.0.dist-info/RECORD --output /builddir/build/BUILD/pyproject-record + rm -fv /builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.x86_64/usr/lib/python3.11/site-packages/extension_helpers-1.4.0.dist-info/RECORD removed '/builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.x86_64/usr/lib/python3.11/site-packages/extension_helpers-1.4.0.dist-info/RECORD' + rm -fv /builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.x86_64/usr/lib/python3.11/site-packages/extension_helpers-1.4.0.dist-info/REQUESTED removed '/builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.x86_64/usr/lib/python3.11/site-packages/extension_helpers-1.4.0.dist-info/REQUESTED' + /usr/bin/python3 /usr/lib/rpm/OpenCloudOS/pyproject_save_files.py --output-files /builddir/build/BUILD/pyproject-files --output-modules /builddir/build/BUILD/pyproject-modules --buildroot /builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.x86_64 --sitelib /usr/lib/python3.11/site-packages --sitearch /usr/lib64/python3.11/site-packages --python-version 3.11 --pyproject-record /builddir/build/BUILD/pyproject-record --prefix /usr extension_helpers + /usr/bin/find-debuginfo -j32 --strict-build-id -m -i --build-id-seed 1.4.0-1.oc9 --unique-debug-suffix -1.4.0-1.oc9.x86_64 --unique-debug-src-base python-extension-helpers-1.4.0-1.oc9.x86_64 -S debugsourcefiles.list /builddir/build/BUILD/extension_helpers-1.4.0 find: 'debug': No such file or directory + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/OpenCloudOS/brp-ldconfig + /usr/lib/rpm/brp-compress + /usr/lib/rpm/OpenCloudOS/brp-strip-lto /usr/bin/strip + /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/check-rpaths + /usr/lib/rpm/OpenCloudOS/brp-mangle-shebangs + /usr/lib/rpm/OpenCloudOS/brp-python-bytecompile '' 1 0 Bytecompiling .py files below /builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.x86_64/usr/lib/python3.11 using python3.11 + /usr/lib/rpm/OpenCloudOS/brp-python-hardlink Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.Ch6GiK + 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/OpenCloudOS/OpenCloudOS-hardened-cc1 -fstack-protector-strong -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/OpenCloudOS/OpenCloudOS-hardened-cc1 -fstack-protector-strong -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 -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/OpenCloudOS/OpenCloudOS-hardened-cc1 -fstack-protector-strong -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 -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/OpenCloudOS/OpenCloudOS-hardened-cc1 -fstack-protector-strong -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/OpenCloudOS/OpenCloudOS-hardened-ld -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 extension_helpers-1.4.0 + 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/OpenCloudOS/OpenCloudOS-hardened-cc1 -fstack-protector-strong -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/OpenCloudOS/OpenCloudOS-hardened-ld -Wl,--build-id=sha1' + PATH=/builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.x86_64/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin + PYTHONPATH=/builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.x86_64/usr/lib64/python3.11/site-packages:/builddir/build/BUILDROOT/python-extension-helpers-1.4.0-1.oc9.x86_64/usr/lib/python3.11/site-packages + PYTHONDONTWRITEBYTECODE=1 + PYTEST_ADDOPTS=' --ignore=/builddir/build/BUILD/extension_helpers-1.4.0/.pyproject-builddir' + /usr/bin/pytest -q extension_helpers/tests ................FFFFFFFFFFFFFFFFFFFFFFFFFF........... [100%] =================================== FAILURES =================================== __________________________ test_only_pyproject[True] ___________________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_only_pyproject_True_0') pyproject_use_helpers = True @pytest.mark.parametrize("pyproject_use_helpers", [None, False, True]) def test_only_pyproject(tmp_path, pyproject_use_helpers): """ Test that makes sure that extension-helpers can be enabled without a setup.py and without a setup.cfg file. """ pytest.importorskip("setuptools", minversion="62.0") package_name = "helpers_test_package_" + str(uuid.uuid4()).replace("-", "_") test_pkg = tmp_path / "test_pkg" os.makedirs(test_pkg / package_name) (test_pkg / package_name / "__init__.py").touch() simple_pyx = test_pkg / package_name / "simple.pyx" simple_pyx.write_text( dedent( """\ def test(): pass """ ) ) if pyproject_use_helpers is None: extension_helpers_option = "" else: extension_helpers_option = dedent( f""" [tool.extension-helpers] use_extension_helpers = {str(pyproject_use_helpers).lower()} """ ) buildtime_requirements = ["setuptools>=43.0.0", "wheel", "Cython"] (test_pkg / "pyproject.toml").write_text( dedent( f"""\ [project] name = "{package_name}" version = "0.1" [tool.setuptools.packages] find = {{namespaces = false}} [build-system] requires = [{', '.join(f'"{_}"' for _ in buildtime_requirements)}] build-backend = 'setuptools.build_meta' """ ) + extension_helpers_option ) install_temp = test_pkg / "install_temp" os.mkdir(install_temp) with chdir(test_pkg): # NOTE: we disable build isolation as we need to pick up the current # developer version of extension-helpers # In order to do so, we need to ensure that build-time dependencies are # installed first cmd1 = [ sys.executable, "-m", "pip", "install", *buildtime_requirements, f"--target={install_temp}", ] subprocess.call(cmd1) cmd2 = [ sys.executable, "-m", "pip", "install", ".", "--no-build-isolation", f"--target={install_temp}", ] subprocess.call(cmd2) if "" in sys.path: sys.path.remove("") sys.path.insert(0, "") with chdir(install_temp): > importlib.import_module(package_name) extension_helpers/tests/test_setup_helpers.py:454: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) :1204: in _gcd_import ??? :1176: in _find_and_load ??? _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 'helpers_test_package_28413145_2d28_4ed2_b709_384ca71c437a' import_ = > ??? E ModuleNotFoundError: No module named 'helpers_test_package_28413145_2d28_4ed2_b709_384ca71c437a' :1140: ModuleNotFoundError ----------------------------- Captured stdout call ----------------------------- Collecting setuptools>=43.0.0 Using cached setuptools-83.0.0-py3-none-any.whl.metadata (6.6 kB) Collecting wheel Using cached wheel-0.47.0-py3-none-any.whl.metadata (2.3 kB) Collecting Cython Using cached cython-3.2.8-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (4.2 kB) Collecting packaging>=24.0 (from wheel) Using cached packaging-26.2-py3-none-any.whl.metadata (3.5 kB) Using cached setuptools-83.0.0-py3-none-any.whl (1.0 MB) Using cached wheel-0.47.0-py3-none-any.whl (32 kB) Using cached cython-3.2.8-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (3.5 MB) Using cached packaging-26.2-py3-none-any.whl (100 kB) Installing collected packages: setuptools, packaging, Cython, wheel Successfully installed Cython-3.2.8 packaging-26.2 setuptools-83.0.0 wheel-0.47.0 Processing /tmp/pytest-of-mockbuild/pytest-0/test_only_pyproject_True_0/test_pkg Preparing metadata (pyproject.toml): started Preparing metadata (pyproject.toml): finished with status 'done' Building wheels for collected packages: helpers-test-package-28413145-2d28-4ed2-b709-384ca71c437a Building wheel for helpers-test-package-28413145-2d28-4ed2-b709-384ca71c437a (pyproject.toml): started Building wheel for helpers-test-package-28413145-2d28-4ed2-b709-384ca71c437a (pyproject.toml): finished with status 'error' Failed to build helpers-test-package-28413145-2d28-4ed2-b709-384ca71c437a ----------------------------- Captured stderr call ----------------------------- error: subprocess-exited-with-error × Building wheel for helpers-test-package-28413145-2d28-4ed2-b709-384ca71c437a (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [29 lines of output] WARNING setuptools_scm._integration.setuptools pyproject.toml does not contain a tool.setuptools_scm section /usr/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py:66: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*. config = read_configuration(filepath, True, ignore_option_errors, dist) running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-cpython-311 creating build/lib.linux-x86_64-cpython-311/helpers_test_package_28413145_2d28_4ed2_b709_384ca71c437a copying helpers_test_package_28413145_2d28_4ed2_b709_384ca71c437a/__init__.py -> build/lib.linux-x86_64-cpython-311/helpers_test_package_28413145_2d28_4ed2_b709_384ca71c437a running egg_info creating helpers_test_package_28413145_2d28_4ed2_b709_384ca71c437a.egg-info writing helpers_test_package_28413145_2d28_4ed2_b709_384ca71c437a.egg-info/PKG-INFO writing dependency_links to helpers_test_package_28413145_2d28_4ed2_b709_384ca71c437a.egg-info/dependency_links.txt writing top-level names to helpers_test_package_28413145_2d28_4ed2_b709_384ca71c437a.egg-info/top_level.txt writing manifest file 'helpers_test_package_28413145_2d28_4ed2_b709_384ca71c437a.egg-info/SOURCES.txt' reading manifest file 'helpers_test_package_28413145_2d28_4ed2_b709_384ca71c437a.egg-info/SOURCES.txt' writing manifest file 'helpers_test_package_28413145_2d28_4ed2_b709_384ca71c437a.egg-info/SOURCES.txt' copying helpers_test_package_28413145_2d28_4ed2_b709_384ca71c437a/_compiler.c -> build/lib.linux-x86_64-cpython-311/helpers_test_package_28413145_2d28_4ed2_b709_384ca71c437a warning: build_py: byte-compiling is disabled, skipping. running build_ext building 'helpers_test_package_28413145_2d28_4ed2_b709_384ca71c437a.simple' extension creating build/temp.linux-x86_64-cpython-311 creating build/temp.linux-x86_64-cpython-311/helpers_test_package_28413145_2d28_4ed2_b709_384ca71c437a gcc -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -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/OpenCloudOS/OpenCloudOS-hardened-cc1 -fstack-protector-strong -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -I/usr/include/python3.11 -c ./helpers_test_package_28413145_2d28_4ed2_b709_384ca71c437a/simple.c -o build/temp.linux-x86_64-cpython-311/./helpers_test_package_28413145_2d28_4ed2_b709_384ca71c437a/simple.o cc1: fatal error: ./helpers_test_package_28413145_2d28_4ed2_b709_384ca71c437a/simple.c: No such file or directory compilation terminated. error: command '/usr/bin/gcc' failed with exit code 1 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for helpers-test-package-28413145-2d28-4ed2-b709-384ca71c437a ERROR: Could not build wheels for helpers-test-package-28413145-2d28-4ed2-b709-384ca71c437a, which is required to install pyproject.toml-based projects ___________________ test_limited_api[c-None-False-setup.cfg] ___________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_c_None_False_0') config = 'setup.cfg', envvar = False, limited_api = None, extension_type = 'c' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build ________________ test_limited_api[c-None-False-pyproject.toml] _________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_c_None_False_1') config = 'pyproject.toml', envvar = False, limited_api = None extension_type = 'c' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build ___________________ test_limited_api[c-None-True-setup.cfg] ____________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_c_None_True_s0') config = 'setup.cfg', envvar = True, limited_api = None, extension_type = 'c' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build _________________ test_limited_api[c-None-True-pyproject.toml] _________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_c_None_True_p0') config = 'pyproject.toml', envvar = True, limited_api = None extension_type = 'c' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build __________________ test_limited_api[c-cp310-False-setup.cfg] ___________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_c_cp310_False0') config = 'setup.cfg', envvar = False, limited_api = 'cp310' extension_type = 'c' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build ________________ test_limited_api[c-cp310-False-pyproject.toml] ________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_c_cp310_False1') config = 'pyproject.toml', envvar = False, limited_api = 'cp310' extension_type = 'c' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build ___________________ test_limited_api[c-cp310-True-setup.cfg] ___________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_c_cp310_True_0') config = 'setup.cfg', envvar = True, limited_api = 'cp310', extension_type = 'c' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build ________________ test_limited_api[c-cp310-True-pyproject.toml] _________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_c_cp310_True_1') config = 'pyproject.toml', envvar = True, limited_api = 'cp310' extension_type = 'c' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build __________________ test_limited_api[pyx-None-False-setup.cfg] __________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_pyx_None_Fals0') config = 'setup.cfg', envvar = False, limited_api = None, extension_type = 'pyx' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build _______________ test_limited_api[pyx-None-False-pyproject.toml] ________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_pyx_None_Fals1') config = 'pyproject.toml', envvar = False, limited_api = None extension_type = 'pyx' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build __________________ test_limited_api[pyx-None-True-setup.cfg] ___________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_pyx_None_True0') config = 'setup.cfg', envvar = True, limited_api = None, extension_type = 'pyx' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build ________________ test_limited_api[pyx-None-True-pyproject.toml] ________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_pyx_None_True1') config = 'pyproject.toml', envvar = True, limited_api = None extension_type = 'pyx' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build _________________ test_limited_api[pyx-cp310-False-setup.cfg] __________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_pyx_cp310_Fal0') config = 'setup.cfg', envvar = False, limited_api = 'cp310' extension_type = 'pyx' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build _______________ test_limited_api[pyx-cp310-False-pyproject.toml] _______________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_pyx_cp310_Fal1') config = 'pyproject.toml', envvar = False, limited_api = 'cp310' extension_type = 'pyx' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build __________________ test_limited_api[pyx-cp310-True-setup.cfg] __________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_pyx_cp310_Tru0') config = 'setup.cfg', envvar = True, limited_api = 'cp310' extension_type = 'pyx' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build _______________ test_limited_api[pyx-cp310-True-pyproject.toml] ________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_pyx_cp310_Tru1') config = 'pyproject.toml', envvar = True, limited_api = 'cp310' extension_type = 'pyx' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build _________________ test_limited_api[both-None-False-setup.cfg] __________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_both_None_Fal0') config = 'setup.cfg', envvar = False, limited_api = None extension_type = 'both' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build _______________ test_limited_api[both-None-False-pyproject.toml] _______________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_both_None_Fal1') config = 'pyproject.toml', envvar = False, limited_api = None extension_type = 'both' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build __________________ test_limited_api[both-None-True-setup.cfg] __________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_both_None_Tru0') config = 'setup.cfg', envvar = True, limited_api = None, extension_type = 'both' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build _______________ test_limited_api[both-None-True-pyproject.toml] ________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_both_None_Tru1') config = 'pyproject.toml', envvar = True, limited_api = None extension_type = 'both' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build _________________ test_limited_api[both-cp310-False-setup.cfg] _________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_both_cp310_Fa0') config = 'setup.cfg', envvar = False, limited_api = 'cp310' extension_type = 'both' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build ______________ test_limited_api[both-cp310-False-pyproject.toml] _______________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_both_cp310_Fa1') config = 'pyproject.toml', envvar = False, limited_api = 'cp310' extension_type = 'both' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build _________________ test_limited_api[both-cp310-True-setup.cfg] __________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_both_cp310_Tr0') config = 'setup.cfg', envvar = True, limited_api = 'cp310' extension_type = 'both' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build _______________ test_limited_api[both-cp310-True-pyproject.toml] _______________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_both_cp310_Tr1') config = 'pyproject.toml', envvar = True, limited_api = 'cp310' extension_type = 'both' @pytest.mark.parametrize("config", ("setup.cfg", "pyproject.toml")) @pytest.mark.parametrize("envvar", (False, True)) @pytest.mark.parametrize("limited_api", (None, "cp310")) @pytest.mark.parametrize("extension_type", ("c", "pyx", "both")) def test_limited_api(tmp_path, config, envvar, limited_api, extension_type): if sys.version_info < (3, 11): pytest.skip( "This test requires setuptools>=65.4 which is only available for Python 3.11 and later" ) package = _extension_test_package( tmp_path, extension_type=extension_type, include_numpy=True, include_setup_py=False ) if config == "setup.cfg": setup_cfg = dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: setup_cfg += f"\n[bdist_wheel]\npy_limited_api={limited_api}" elif envvar: # Make sure if we are using the environment variable that it takes # precedence over this setting (this only works for setup.cfg) setup_cfg += "\n[bdist_wheel]\npy_limited_api=cp35" (package / "setup.cfg").write_text(setup_cfg) # Still require a minimal pyproject.toml file if no setup.py file (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [tool.extension-helpers] use_extension_helpers = true """ ) ) elif config == "pyproject.toml": pyproject_toml = dedent( """\ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' [project] name = "helpers_test_package" version = "0.1" [tool.setuptools.packages] find = {namespaces = false} [tool.extension-helpers] use_extension_helpers = true """ ) if limited_api and not envvar: pyproject_toml += f'\n[tool.distutils.bdist_wheel]\npy-limited-api = "{limited_api}"' (package / "pyproject.toml").write_text(pyproject_toml) env = os.environ.copy() if envvar: if limited_api: env["EXTENSION_HELPERS_PY_LIMITED_API"] = limited_api else: env["EXTENSION_HELPERS_PY_LIMITED_API"] = "" with chdir(package): > subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], env=env, check=True ) extension_helpers/tests/test_setup_helpers.py:562: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ input = None, capture_output = False, timeout = None, check = True popenargs = (['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'],) kwargs = {'env': {'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --rea...-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection', 'CONFIG_SITE': 'NONE', ...}} process = stdout = None, stderr = None, retcode = 1 def run(*popenargs, input=None, capture_output=False, timeout=None, check=False, **kwargs): """Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them, or pass capture_output=True to capture both. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, and output & stderr attributes if those streams were captured. If timeout is given, and the process takes too long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument you may not also use the Popen constructor's "stdin" argument, as it will be used internally. By default, all communication is in bytes, and therefore any "input" should be bytes, and the stdout and stderr will be bytes. If in text mode, any "input" should be a string, and stdout and stderr will be strings decoded according to locale encoding, or by "encoding" if set. Text mode is triggered by setting any of text, encoding, errors or universal_newlines. The other arguments are the same as for the Popen constructor. """ if input is not None: if kwargs.get('stdin') is not None: raise ValueError('stdin and input arguments may not both be used.') kwargs['stdin'] = PIPE if capture_output: if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None: raise ValueError('stdout and stderr arguments may not be used ' 'with capture_output.') kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE with Popen(*popenargs, **kwargs) as process: try: stdout, stderr = process.communicate(input, timeout=timeout) except TimeoutExpired as exc: process.kill() if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() else: # POSIX _communicate already populated the output so # far into the TimeoutExpired exception. process.wait() raise except: # Including KeyboardInterrupt, communicate handled that. process.kill() # We don't call process.wait() as .__exit__ does that for us. raise retcode = process.poll() if check and retcode: > raise CalledProcessError(retcode, process.args, output=stdout, stderr=stderr) E subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation']' returned non-zero exit status 1. /usr/lib64/python3.11/subprocess.py:571: CalledProcessError ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named build _________________________ test_limited_api_invalid_abi _________________________ tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_limited_api_invalid_abi0') capsys = <_pytest.capture.CaptureFixture object at 0x7f0b0317fb10> def test_limited_api_invalid_abi(tmp_path, capsys): package = _extension_test_package( tmp_path, extension_type="c", include_numpy=True, include_setup_py=False ) (package / "setup.cfg").write_text( dedent( """\ [metadata] name = helpers_test_package version = 0.1 [options] packages = find: [extension-helpers] use_extension_helpers = true [bdist_wheel] py_limited_api=invalid """ ) ) (package / "pyproject.toml").write_text( dedent( """ [build-system] requires = ["setuptools>=43.0.0", "wheel"] build-backend = 'setuptools.build_meta' """ ) ) with chdir(package): result = subprocess.run( [sys.executable, "-m", "build", "--wheel", "--no-isolation"], stderr=subprocess.PIPE ) > assert result.stderr.strip().endswith( b"ValueError: Unrecognized abi version for limited API: invalid" ) E AssertionError: assert False E + where False = (b'ValueError: Unrecognized abi version for limited API: invalid') E + where = b'/usr/bin/python3: No module named build'.endswith E + where b'/usr/bin/python3: No module named build' = () E + where = b'/usr/bin/python3: No module named build\n'.strip E + where b'/usr/bin/python3: No module named build\n' = CompletedProcess(args=['/usr/bin/python3', '-m', 'build', '--wheel', '--no-isolation'], returncode=1, stderr=b'/usr/bin/python3: No module named build\n').stderr extension_helpers/tests/test_setup_helpers.py:613: AssertionError =========================== short test summary info ============================ FAILED extension_helpers/tests/test_setup_helpers.py::test_only_pyproject[True] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[c-None-False-setup.cfg] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[c-None-False-pyproject.toml] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[c-None-True-setup.cfg] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[c-None-True-pyproject.toml] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[c-cp310-False-setup.cfg] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[c-cp310-False-pyproject.toml] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[c-cp310-True-setup.cfg] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[c-cp310-True-pyproject.toml] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[pyx-None-False-setup.cfg] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[pyx-None-False-pyproject.toml] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[pyx-None-True-setup.cfg] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[pyx-None-True-pyproject.toml] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[pyx-cp310-False-setup.cfg] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[pyx-cp310-False-pyproject.toml] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[pyx-cp310-True-setup.cfg] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[pyx-cp310-True-pyproject.toml] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[both-None-False-setup.cfg] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[both-None-False-pyproject.toml] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[both-None-True-setup.cfg] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[both-None-True-pyproject.toml] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[both-cp310-False-setup.cfg] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[both-cp310-False-pyproject.toml] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[both-cp310-True-setup.cfg] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api[both-cp310-True-pyproject.toml] FAILED extension_helpers/tests/test_setup_helpers.py::test_limited_api_invalid_abi 26 failed, 27 passed in 134.62s (0:02:14) RPM build errors: error: Bad exit status from /var/tmp/rpm-tmp.Ch6GiK (%check) Bad exit status from /var/tmp/rpm-tmp.Ch6GiK (%check) Child return code was: 1 EXCEPTION: [Error('Command failed: \n # bash --login -c /usr/bin/rpmbuild -ba --noprep --noclean --target x86_64 --nodeps /builddir/build/SPECS/python-extension-helpers.spec\n', 1)] 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 597, 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 --noclean --target x86_64 --nodeps /builddir/build/SPECS/python-extension-helpers.spec