<86>Aug 1 07:42:05 userdel[241412]: delete user 'rooter' <86>Aug 1 07:42:05 userdel[241412]: removed group 'rooter' owned by 'rooter' <86>Aug 1 07:42:05 userdel[241412]: removed shadow group 'rooter' owned by 'rooter' <86>Aug 1 07:42:05 groupadd[241453]: group added to /etc/group: name=rooter, GID=2573 <86>Aug 1 07:42:05 groupadd[241453]: group added to /etc/gshadow: name=rooter <86>Aug 1 07:42:05 groupadd[241453]: new group: name=rooter, GID=2573 <86>Aug 1 07:42:05 useradd[241493]: new user: name=rooter, UID=2573, GID=2573, home=/root, shell=/bin/bash, from=none <86>Aug 1 07:42:05 userdel[241552]: delete user 'builder' <86>Aug 1 07:42:05 userdel[241552]: removed group 'builder' owned by 'builder' <86>Aug 1 07:42:05 userdel[241552]: removed shadow group 'builder' owned by 'builder' <86>Aug 1 07:42:05 groupadd[241587]: group added to /etc/group: name=builder, GID=2574 <86>Aug 1 07:42:05 groupadd[241587]: group added to /etc/gshadow: name=builder <86>Aug 1 07:42:05 groupadd[241587]: new group: name=builder, GID=2574 <86>Aug 1 07:42:05 useradd[241634]: new user: name=builder, UID=2574, GID=2574, home=/usr/src, shell=/bin/bash, from=none <13>Aug 1 07:42:07 rpmi: libgdbm6-1.26-alt1 sisyphus+418729.200.2.1 1779276077 installed <13>Aug 1 07:42:07 rpmi: libgdbm_compat4-1.26-alt1 sisyphus+418729.200.2.1 1779276077 installed <13>Aug 1 07:42:07 rpmi: rpm-build-compat-2.4.9-alt1 sisyphus+385024.100.1.1 1747938414 installed <13>Aug 1 07:42:07 rpmi: libsqlite3-3.50.4-alt1 sisyphus+391668.100.1.1 1754321138 installed <13>Aug 1 07:42:07 rpmi: libmpdec3-2.5.1-alt3 sisyphus+314490.500.5.1 1675432033 installed <13>Aug 1 07:42:07 rpmi: libexpat-2.7.4-alt1 sisyphus+407132.100.1.1 1770196717 installed <13>Aug 1 07:42:07 rpmi: openssl-config-3.5.0-alt1 sisyphus+399237.100.1.1 1762346864 installed <13>Aug 1 07:42:07 rpmi: libp11-kit-1:0.26.2-alt3.g0eedd4d sisyphus+424637.100.1.1 1783530782 installed <13>Aug 1 07:42:07 rpmi: libtasn1-4.21.0-alt2 sisyphus+420751.100.1.1 1781163748 installed <13>Aug 1 07:42:07 rpmi: rpm-macros-alternatives-0.5.3-alt1 sisyphus+371878.100.1.1 1737988822 installed <13>Aug 1 07:42:07 rpmi: alternatives-0.5.3-alt1 sisyphus+371878.100.1.1 1737988822 installed <13>Aug 1 07:42:07 rpmi: ca-certificates-2026.04.22-alt1 sisyphus+415942.100.6.1 1777316293 installed <13>Aug 1 07:42:07 rpmi: ca-trust-0.2.0-alt1 sisyphus+344843.100.1.1 1712743326 installed <13>Aug 1 07:42:07 rpmi: p11-kit-trust-1:0.26.2-alt3.g0eedd4d sisyphus+424637.100.1.1 1783530782 installed <13>Aug 1 07:42:07 rpmi: libcrypto3-3.5.7-alt1 sisyphus+425332.100.3.1 1784733668 installed <13>Aug 1 07:42:07 rpmi: libssl3-3.5.7-alt1 sisyphus+425332.100.3.1 1784733668 installed <13>Aug 1 07:42:07 rpmi: python3-modules-sqlite3-3.14.6-alt1 sisyphus+423624.100.33.1 1784227742 installed <13>Aug 1 07:42:07 rpmi: python3-3.14.6-alt1 sisyphus+423624.100.33.1 1784227742 installed <13>Aug 1 07:42:08 rpmi: python3-base-3.14.6-alt1 sisyphus+423624.100.33.1 1784227742 installed <13>Aug 1 07:42:08 rpmi: python3-module-py3dephell-0.3.1-alt1 sisyphus+365261.200.1.1 1734463433 installed <13>Aug 1 07:42:08 rpmi: tests-for-installed-python3-pkgs-0.1.29-alt1 sisyphus+398029.2500.12.1 1762716341 installed <13>Aug 1 07:42:08 rpmi: rpm-build-python3-0.1.29-alt1 sisyphus+398029.2500.12.1 1762716341 installed <13>Aug 1 07:42:08 rpmi: rpm-build-intro-2.4.9-alt1 sisyphus+385024.100.1.1 1747938414 installed <13>Aug 1 07:42:09 rpmi: python3-module-packaging-26.2-alt1 sisyphus+416502.100.2.1 1777385153 installed <13>Aug 1 07:42:09 rpmi: python3-module-more-itertools-11.1.0-alt1 sisyphus+419223.100.2.1 1779891386 installed <13>Aug 1 07:42:09 rpmi: python3-module-jaraco.functools-4.6.0-alt1 sisyphus+425293.100.1.2 1784631981 installed <13>Aug 1 07:42:09 rpmi: python3-module-typing_extensions-4.16.0-alt1 sisyphus+426470.2600.5.1 1785153849 installed <13>Aug 1 07:42:09 rpmi: python3-module-Pygments-2.20.0-alt1 sisyphus+413985.100.1.1 1775208360 installed <13>Aug 1 07:42:09 rpmi: python3-module-wheel-0.47.0-alt1 sisyphus+416101.100.1.1 1776938753 installed <13>Aug 1 07:42:09 rpmi: python3-module-wcwidth-0.8.2-alt1 sisyphus+423417.100.1.1 1782812581 installed <13>Aug 1 07:42:09 rpmi: python3-module-pyperclip-1.9.0-alt1 sisyphus+353859.100.1.1 1722231798 installed <13>Aug 1 07:42:09 rpmi: python3-module-pluggy-1.6.0-alt1.1 sisyphus+413474.300.2.1 1774829688 installed <13>Aug 1 07:42:09 rpmi: python3-module-platformdirs-4.10.0-alt1 sisyphus+419460.100.1.1 1779982322 installed <13>Aug 1 07:42:09 rpmi: python3-module-shellingham-1.5.4-alt1 sisyphus+332574.100.1.1 1698135363 installed <13>Aug 1 07:42:09 rpmi: python3-module-uc-micro-py-2.0.0-alt1 sisyphus+411114.100.1.1 1773327270 installed <13>Aug 1 07:42:09 rpmi: python3-module-linkify-it-py-2.1.0-alt1.1 sisyphus+413476.100.1.1 1774817789 installed <13>Aug 1 07:42:09 rpmi: python3-module-mdurl-0.1.2-alt1 sisyphus+318894.1000.3.1 1682420700 installed <13>Aug 1 07:42:09 rpmi: python3-module-markdown-it-4.0.0-alt1 sisyphus+394327.100.1.1 1757330325 installed <13>Aug 1 07:42:09 rpmi: python3-module-rich-15.0.0-alt1 sisyphus+415092.100.2.1 1776162196 installed <13>Aug 1 07:42:09 rpmi: python3-module-jaraco.context-6.1.2-alt1 sisyphus+412384.100.1.1 1774283927 installed <13>Aug 1 07:42:09 rpmi: python3-module-iniconfig-2.3.0-alt1 sisyphus+397749.100.2.1 1761040670 installed <13>Aug 1 07:42:09 rpmi: python3-module-decorator-5.2.1-alt1 sisyphus+376067.100.1.1 1740491622 installed <13>Aug 1 07:42:09 rpmi: python3-module-pycparser-2.23-alt1 sisyphus+410417.100.1.1 1772989663 installed <13>Aug 1 07:42:09 rpmi: python3-module-cffi-2.1.0-alt1 sisyphus+423624.540.33.1 1784228272 installed <13>Aug 1 07:42:10 rpmi: python3-module-cryptography-49.0.0-alt1 sisyphus+423624.1000.33.1 1784228350 installed <13>Aug 1 07:42:10 rpmi: python3-module-openssl-26.3.0-alt1 sisyphus+422651.200.1.1 1782380583 installed <13>Aug 1 07:42:10 rpmi: python3-module-pycryptodome-3.23.0-alt1 sisyphus+423624.1300.33.1 1784228528 installed <13>Aug 1 07:42:10 rpmi: python3-module-annotated_doc-0.0.5-alt1 sisyphus+427370.300.1.1 1785267228 installed <13>Aug 1 07:42:10 rpmi: python3-module-typer-0.27.0-alt1 sisyphus+426477.440.2.1 1784895769 installed <13>Aug 1 07:42:10 rpmi: python3-module-typer-slim-0.27.0-alt1 sisyphus+426477.440.2.1 1784895769 installed <13>Aug 1 07:42:10 rpmi: python3-module-jaraco.text-4.2.0-alt1 sisyphus+408107.100.3.1 1771429608 installed <13>Aug 1 07:42:10 rpmi: python3-module-pkg-resources-1:80.10.2-alt2.1 sisyphus+413485.1000.2.3 1774838477 installed <13>Aug 1 07:42:10 rpmi: libverto-0.3.2-alt1_1 sisyphus+321176.2200.10.2 1684806164 installed <13>Aug 1 07:42:10 rpmi: libpython3-3.14.6-alt1 sisyphus+423624.100.33.1 1784227742 installed <13>Aug 1 07:42:10 rpmi: python3-dev-3.14.6-alt1 sisyphus+423624.100.33.1 1784227742 installed <13>Aug 1 07:42:10 rpmi: liblmdb-0.9.35-alt1 sisyphus+408541.100.2.1 1771588201 installed <13>Aug 1 07:42:10 rpmi: libkeyutils-1.6.3-alt1 sisyphus+346336.200.2.2 1716472658 installed <13>Aug 1 07:42:10 rpmi: libcom_err-1.47.4.0.2.a9f48-alt1 sisyphus+416421.100.2.1 1777378671 installed <86>Aug 1 07:42:10 groupadd[346972]: group added to /etc/group: name=_keytab, GID=999 <86>Aug 1 07:42:10 groupadd[346972]: group added to /etc/gshadow: name=_keytab <86>Aug 1 07:42:10 groupadd[346972]: new group: name=_keytab, GID=999 <13>Aug 1 07:42:11 rpmi: libkrb5-1.22.2-alt2 sisyphus+426323.100.1.2 1784761603 installed <13>Aug 1 07:42:11 rpmi: python3-module-gssapi-1.11.1-alt1 sisyphus+407885.100.2.1 1770882637 installed <13>Aug 1 07:42:11 rpmi: python3-module-asyncssh-2.22.0-alt1 sisyphus+405462.100.1.1 1768762543 installed <13>Aug 1 07:42:11 rpmi: python3-module-prompt_toolkit-3.0.53-alt1 sisyphus+427139.100.1.1 1785145558 installed <13>Aug 1 07:42:11 rpmi: python3-module-setuptools-1:83.0.0-alt1 sisyphus+424341.100.2.1 1783427124 installed <13>Aug 1 07:42:11 rpmi: python3-module-pytest-9.0.3-alt1 sisyphus+414567.100.1.1 1775647126 installed <13>Aug 1 07:42:11 rpmi: python3-module-six-1.17.0-alt1.1 sisyphus+373470.100.1.1 1738920023 installed <13>Aug 1 07:42:11 rpmi: python3-module-click-8.4.2-alt1 sisyphus+422757.100.2.1 1782720497 installed Building target platforms: i586 Building for target i586 Wrote: /usr/src/in/nosrpm/python3-module-click-repl-0.3.0-alt2.nosrc.rpm (w1.gzdio) <13>Aug 1 07:42:12 rpmi: python3-module-pyproject-installer-0.6.0-alt1 sisyphus+424779.100.1.1 1783678406 installed Installing python3-module-click-repl-0.3.0-alt2.src.rpm Building target platforms: i586 Building for target i586 Executing(%prep): /bin/sh -e /usr/src/tmp/rpmb-tmp.Kb5hJA + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + rm -rf python3-module-click-repl-0.3.0 + echo 'Source #0 (python3-module-click-repl-0.3.0.tar):' Source #0 (python3-module-click-repl-0.3.0.tar): + /bin/tar -xf /usr/src/RPM/SOURCES/python3-module-click-repl-0.3.0.tar + cd python3-module-click-repl-0.3.0 + /bin/chmod -c -Rf u+rwX,go-w . + exit 0 Executing(%build): /bin/sh -e /usr/src/tmp/rpmb-tmp.6xqP00 + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + cd python3-module-click-repl-0.3.0 + export 'CFLAGS=-pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto -march=i586 -mtune=generic' + CFLAGS='-pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto -march=i586 -mtune=generic' + export 'CXXFLAGS=-pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto -march=i586 -mtune=generic' + CXXFLAGS='-pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto -march=i586 -mtune=generic' + export 'FFLAGS=-pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto -march=i586 -mtune=generic' + FFLAGS='-pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto -march=i586 -mtune=generic' + /usr/bin/python3 -m pyproject_installer -v build INFO : pyproject_installer.build_cmd._build : Building wheel INFO : pyproject_installer.build_cmd._build : Source tree: /usr/src/RPM/BUILD/python3-module-click-repl-0.3.0 INFO : pyproject_installer.build_cmd._build : Output dir: /usr/src/RPM/BUILD/python3-module-click-repl-0.3.0/dist DEBUG : pyproject_installer.lib.build_backend : Validating source path DEBUG : pyproject_installer.lib.build_backend : Checking for PEP517 spec DEBUG : pyproject_installer.lib.build_backend : Parsing configuration file: /usr/src/RPM/BUILD/python3-module-click-repl-0.3.0/pyproject.toml INFO : backend_caller.py : Calling hook build_wheel in subprocess INFO : backend_caller.py : Build backend: setuptools.build_meta INFO : backend_caller.py : Hook args: ['/usr/src/RPM/BUILD/python3-module-click-repl-0.3.0/dist'] INFO : backend_caller.py : Hook kwargs: {'config_settings': None} INFO : root : running bdist_wheel INFO : root : running build INFO : root : running build_py INFO : root : creating build/lib/click_repl INFO : root : copying click_repl/utils.py -> build/lib/click_repl INFO : root : copying click_repl/exceptions.py -> build/lib/click_repl INFO : root : copying click_repl/_repl.py -> build/lib/click_repl INFO : root : copying click_repl/_completer.py -> build/lib/click_repl INFO : root : copying click_repl/__init__.py -> build/lib/click_repl INFO : root : installing to build/bdist.linux-i686/wheel INFO : root : running install INFO : root : running install_lib INFO : root : creating build/bdist.linux-i686/wheel INFO : root : creating build/bdist.linux-i686/wheel/click_repl INFO : root : copying build/lib/click_repl/__init__.py -> build/bdist.linux-i686/wheel/./click_repl INFO : root : copying build/lib/click_repl/_completer.py -> build/bdist.linux-i686/wheel/./click_repl INFO : root : copying build/lib/click_repl/_repl.py -> build/bdist.linux-i686/wheel/./click_repl INFO : root : copying build/lib/click_repl/exceptions.py -> build/bdist.linux-i686/wheel/./click_repl INFO : root : copying build/lib/click_repl/utils.py -> build/bdist.linux-i686/wheel/./click_repl INFO : root : running install_egg_info INFO : root : running egg_info INFO : root : creating click_repl.egg-info INFO : root : writing click_repl.egg-info/PKG-INFO INFO : root : writing dependency_links to click_repl.egg-info/dependency_links.txt INFO : root : writing requirements to click_repl.egg-info/requires.txt INFO : root : writing top-level names to click_repl.egg-info/top_level.txt INFO : root : writing manifest file 'click_repl.egg-info/SOURCES.txt' INFO : root : reading manifest file 'click_repl.egg-info/SOURCES.txt' INFO : root : reading manifest template 'MANIFEST.in' INFO : root : adding license file 'LICENSE' INFO : root : writing manifest file 'click_repl.egg-info/SOURCES.txt' INFO : root : Copying click_repl.egg-info to build/bdist.linux-i686/wheel/./click_repl-0.3.0-py3.14.egg-info INFO : root : running install_scripts INFO : root : creating build/bdist.linux-i686/wheel/click_repl-0.3.0.dist-info/WHEEL INFO : wheel : creating '/usr/src/RPM/BUILD/python3-module-click-repl-0.3.0/dist/.tmp-f5nevrcp/click_repl-0.3.0-py3-none-any.whl' and adding 'build/bdist.linux-i686/wheel' to it INFO : wheel : adding 'click_repl/__init__.py' INFO : wheel : adding 'click_repl/_completer.py' INFO : wheel : adding 'click_repl/_repl.py' INFO : wheel : adding 'click_repl/exceptions.py' INFO : wheel : adding 'click_repl/utils.py' INFO : wheel : adding 'click_repl-0.3.0.dist-info/licenses/LICENSE' INFO : wheel : adding 'click_repl-0.3.0.dist-info/METADATA' INFO : wheel : adding 'click_repl-0.3.0.dist-info/WHEEL' INFO : wheel : adding 'click_repl-0.3.0.dist-info/top_level.txt' INFO : wheel : adding 'click_repl-0.3.0.dist-info/RECORD' INFO : root : removing build/bdist.linux-i686/wheel INFO : pyproject_installer.build_cmd._build : Built wheel: click_repl-0.3.0-py3-none-any.whl + exit 0 Executing(%install): /bin/sh -e /usr/src/tmp/rpmb-tmp.qydFur + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + /bin/chmod -Rf u+rwX -- /usr/src/tmp/python3-module-click-repl-buildroot + : + /bin/rm -rf -- /usr/src/tmp/python3-module-click-repl-buildroot + PATH=/usr/libexec/rpm-build:/usr/src/bin:/usr/bin:/bin:/usr/local/bin:/usr/games + cd python3-module-click-repl-0.3.0 + /usr/bin/python3 -m pyproject_installer -v install --destdir=/usr/src/tmp/python3-module-click-repl-buildroot INFO : pyproject_installer.install_cmd._install : Installing wheel INFO : pyproject_installer.install_cmd._install : Wheel directory: /usr/src/RPM/BUILD/python3-module-click-repl-0.3.0/dist INFO : pyproject_installer.install_cmd._install : Wheel filename: click_repl-0.3.0-py3-none-any.whl INFO : pyproject_installer.install_cmd._install : Destination: /usr/src/tmp/python3-module-click-repl-buildroot DEBUG : pyproject_installer.lib.wheel : Parsing wheel filename DEBUG : pyproject_installer.lib.wheel : Validating wheel file DEBUG : pyproject_installer.lib.wheel : Validating wheel spec version DEBUG : pyproject_installer.lib.wheel : Parsing wheel spec metadata DEBUG : pyproject_installer.lib.wheel : Validating RECORD INFO : pyproject_installer.install_cmd._install : Wheel installation root: /usr/src/tmp/python3-module-click-repl-buildroot/usr/lib/python3/site-packages DEBUG : pyproject_installer.install_cmd._install : Filtering out not allowed file: click_repl-0.3.0.dist-info/licenses/LICENSE DEBUG : pyproject_installer.install_cmd._install : Filtering out not allowed file: click_repl-0.3.0.dist-info/WHEEL DEBUG : pyproject_installer.install_cmd._install : Filtering out not allowed file: click_repl-0.3.0.dist-info/top_level.txt DEBUG : pyproject_installer.install_cmd._install : Filtering out not allowed file: click_repl-0.3.0.dist-info/RECORD INFO : pyproject_installer.install_cmd._install : Extracting wheel INFO : pyproject_installer.install_cmd._install : Wheel was installed + /usr/lib/rpm/brp-alt Cleaning files in /usr/src/tmp/python3-module-click-repl-buildroot (auto) Verifying and fixing files in /usr/src/tmp/python3-module-click-repl-buildroot (binconfig,pkgconfig,libtool,desktop,gnuconfig) Checking contents of files in /usr/src/tmp/python3-module-click-repl-buildroot/ (default) Compressing files in /usr/src/tmp/python3-module-click-repl-buildroot (auto) Adjusting library links in /usr/src/tmp/python3-module-click-repl-buildroot ./usr/lib: (from :0) Verifying ELF objects in /usr/src/tmp/python3-module-click-repl-buildroot (arch=normal,fhs=normal,lfs=relaxed,lint=relaxed,rpath=normal,stack=normal,textrel=normal,unresolved=normal) Splitting links to aliased files under /{,s}bin in /usr/src/tmp/python3-module-click-repl-buildroot Bytecompiling python3 modules in /usr/src/tmp/python3-module-click-repl-buildroot using /usr/bin/python3 compile /usr/src/tmp/python3-module-click-repl-buildroot/usr/lib/python3/site-packages/click_repl/__init__.py compile /usr/src/tmp/python3-module-click-repl-buildroot/usr/lib/python3/site-packages/click_repl/_completer.py compile /usr/src/tmp/python3-module-click-repl-buildroot/usr/lib/python3/site-packages/click_repl/_repl.py compile /usr/src/tmp/python3-module-click-repl-buildroot/usr/lib/python3/site-packages/click_repl/exceptions.py compile /usr/src/tmp/python3-module-click-repl-buildroot/usr/lib/python3/site-packages/click_repl/utils.py Bytecompiling python3 modules with optimization in /usr/src/tmp/python3-module-click-repl-buildroot using /usr/bin/python3 -O compile /usr/src/tmp/python3-module-click-repl-buildroot/usr/lib/python3/site-packages/click_repl/__init__.py compile /usr/src/tmp/python3-module-click-repl-buildroot/usr/lib/python3/site-packages/click_repl/_completer.py compile /usr/src/tmp/python3-module-click-repl-buildroot/usr/lib/python3/site-packages/click_repl/_repl.py compile /usr/src/tmp/python3-module-click-repl-buildroot/usr/lib/python3/site-packages/click_repl/exceptions.py compile /usr/src/tmp/python3-module-click-repl-buildroot/usr/lib/python3/site-packages/click_repl/utils.py Bytecompiling python3 modules with optimization-2 in /usr/src/tmp/python3-module-click-repl-buildroot using /usr/bin/python3 -OO compile /usr/src/tmp/python3-module-click-repl-buildroot/usr/lib/python3/site-packages/click_repl/__init__.py compile /usr/src/tmp/python3-module-click-repl-buildroot/usr/lib/python3/site-packages/click_repl/_completer.py compile /usr/src/tmp/python3-module-click-repl-buildroot/usr/lib/python3/site-packages/click_repl/_repl.py compile /usr/src/tmp/python3-module-click-repl-buildroot/usr/lib/python3/site-packages/click_repl/exceptions.py compile /usr/src/tmp/python3-module-click-repl-buildroot/usr/lib/python3/site-packages/click_repl/utils.py Hardlinking identical .pyc and .opt-?.pyc files './usr/lib/python3/site-packages/click_repl/__pycache__/__init__.cpython-314.opt-1.pyc' => './usr/lib/python3/site-packages/click_repl/__pycache__/__init__.cpython-314.pyc' './usr/lib/python3/site-packages/click_repl/__pycache__/__init__.cpython-314.opt-2.pyc' => './usr/lib/python3/site-packages/click_repl/__pycache__/__init__.cpython-314.opt-1.pyc' './usr/lib/python3/site-packages/click_repl/__pycache__/_completer.cpython-314.opt-1.pyc' => './usr/lib/python3/site-packages/click_repl/__pycache__/_completer.cpython-314.pyc' './usr/lib/python3/site-packages/click_repl/__pycache__/_completer.cpython-314.opt-2.pyc' => './usr/lib/python3/site-packages/click_repl/__pycache__/_completer.cpython-314.opt-1.pyc' './usr/lib/python3/site-packages/click_repl/__pycache__/_repl.cpython-314.opt-1.pyc' => './usr/lib/python3/site-packages/click_repl/__pycache__/_repl.cpython-314.pyc' './usr/lib/python3/site-packages/click_repl/__pycache__/exceptions.cpython-314.opt-1.pyc' => './usr/lib/python3/site-packages/click_repl/__pycache__/exceptions.cpython-314.pyc' './usr/lib/python3/site-packages/click_repl/__pycache__/exceptions.cpython-314.opt-2.pyc' => './usr/lib/python3/site-packages/click_repl/__pycache__/exceptions.cpython-314.opt-1.pyc' './usr/lib/python3/site-packages/click_repl/__pycache__/utils.cpython-314.opt-1.pyc' => './usr/lib/python3/site-packages/click_repl/__pycache__/utils.cpython-314.pyc' Executing(%check): /bin/sh -e /usr/src/tmp/rpmb-tmp.8V9BhF + umask 022 + /bin/mkdir -p /usr/src/RPM/BUILD + cd /usr/src/RPM/BUILD + cd python3-module-click-repl-0.3.0 + export 'CFLAGS=-pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto -march=i586 -mtune=generic' + CFLAGS='-pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto -march=i586 -mtune=generic' + export 'CXXFLAGS=-pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto -march=i586 -mtune=generic' + CXXFLAGS='-pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto -march=i586 -mtune=generic' + export 'FFLAGS=-pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto -march=i586 -mtune=generic' + FFLAGS='-pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto -march=i586 -mtune=generic' + export NO_INTERNET=YES + NO_INTERNET=YES + /usr/bin/python3 -m pyproject_installer run -- python3 -m pytest -vra -o=addopts= INFO : Creating venv INFO : Installing console scripts INFO : Installing package: /usr/src/RPM/BUILD/python3-module-click-repl-0.3.0/dist/click_repl-0.3.0-py3-none-any.whl INFO : Running command: ['/usr/src/RPM/BUILD/python3-module-click-repl-0.3.0/.run_venv/bin/python3', '-m', 'pyproject_installer', 'install', '/usr/src/RPM/BUILD/python3-module-click-repl-0.3.0/dist/click_repl-0.3.0-py3-none-any.whl'] INFO : Running command: ['python3', '-m', 'pytest', '-vra', '-o=addopts='] ============================= test session starts ============================== platform linux -- Python 3.14.6, pytest-9.0.3, pluggy-1.6.0 -- /usr/src/RPM/BUILD/python3-module-click-repl-0.3.0/.run_venv/bin/python3 cachedir: .pytest_cache rootdir: /usr/src/RPM/BUILD/python3-module-click-repl-0.3.0 configfile: pyproject.toml testpaths: tests collecting ... collected 61 items / 2 skipped tests/test_basic.py::test_arg_completion FAILED [ 1%] tests/test_basic.py::test_option_completion[option-cmd -expected0] FAILED [ 3%] tests/test_basic.py::test_option_completion[option-cmd -h-expected1] FAILED [ 4%] tests/test_basic.py::test_option_completion[option-cmd --h-expected2] FAILED [ 6%] tests/test_command_collection.py::test_command_collection FAILED [ 8%] tests/test_command_collection.py::test_subcommand_invocation_from_group[ -expected0] PASSED [ 9%] tests/test_command_collection.py::test_subcommand_invocation_from_group[c1 -expected1] PASSED [ 11%] tests/test_completion/test_click_version_le_7/test_arg_completion_v7.py::test_click7_autocomplete_arg SKIPPED [ 13%] tests/test_completion/test_click_version_le_7/test_arg_completion_v7.py::test_tuple_return_type_shell_complete_func_click7 SKIPPED [ 14%] tests/test_completion/test_click_version_le_7/test_option_completion_v7.py::test_click7_autocomplete_option SKIPPED [ 16%] tests/test_completion/test_common_tests/test_arg_completion.py::test_boolean_arg PASSED [ 18%] tests/test_completion/test_common_tests/test_arg_completion.py::test_arg_choices PASSED [ 19%] tests/test_completion/test_common_tests/test_hidden_cmd_and_args.py::test_hidden_cmd PASSED [ 21%] tests/test_completion/test_common_tests/test_hidden_cmd_and_args.py::test_hidden_option FAILED [ 22%] tests/test_completion/test_common_tests/test_hidden_cmd_and_args.py::test_args_of_hidden_command FAILED [ 24%] tests/test_completion/test_common_tests/test_hidden_cmd_and_args.py::test_completion_multilevel_command FAILED [ 26%] tests/test_completion/test_common_tests/test_option_completion.py::test_option_choices PASSED [ 27%] tests/test_completion/test_common_tests/test_option_completion.py::test_boolean_option PASSED [ 29%] tests/test_completion/test_path_type/test_path_type.py::test_path_type_arg[path-type-arg -expected0] PASSED [ 31%] tests/test_completion/test_path_type/test_path_type.py::test_path_type_arg[path-type-arg tests/-expected1] PASSED [ 32%] tests/test_completion/test_path_type/test_path_type.py::test_path_type_arg[path-type-arg src/*-expected2] PASSED [ 34%] tests/test_completion/test_path_type/test_path_type.py::test_path_type_arg[path-type-arg src/**-expected3] PASSED [ 36%] tests/test_completion/test_path_type/test_path_type.py::test_path_type_arg[path-type-arg tests/testdir/-expected4] PASSED [ 37%] tests/test_dev/test_get_internal_cmds.py::test_get_registered_target_help_cmd[help-_help_internal] PASSED [ 39%] tests/test_dev/test_get_internal_cmds.py::test_get_registered_target_help_cmd[h-_help_internal] PASSED [ 40%] tests/test_dev/test_get_internal_cmds.py::test_get_registered_target_help_cmd[?-_help_internal] PASSED [ 42%] tests/test_dev/test_get_internal_cmds.py::test_get_registered_target_exit_cmd[exit-_exit_internal] PASSED [ 44%] tests/test_dev/test_get_internal_cmds.py::test_get_registered_target_exit_cmd[quit-_exit_internal] PASSED [ 45%] tests/test_dev/test_get_internal_cmds.py::test_get_registered_target_exit_cmd[q-_exit_internal] PASSED [ 47%] tests/test_dev/test_get_internal_cmds.py::test_get_registered_target[hi] PASSED [ 49%] tests/test_dev/test_get_internal_cmds.py::test_get_registered_target[hello] PASSED [ 50%] tests/test_dev/test_get_internal_cmds.py::test_get_registered_target[76q358767] PASSED [ 52%] tests/test_dev/test_internal_cmds.py::test_internal_help_commands[:help] PASSED [ 54%] tests/test_dev/test_internal_cmds.py::test_internal_help_commands[:h] PASSED [ 55%] tests/test_dev/test_internal_cmds.py::test_internal_help_commands[:?] PASSED [ 57%] tests/test_dev/test_internal_cmds.py::test_internal_exit_commands[:exit] PASSED [ 59%] tests/test_dev/test_internal_cmds.py::test_internal_exit_commands[:quit] PASSED [ 60%] tests/test_dev/test_internal_cmds.py::test_internal_exit_commands[:q] PASSED [ 62%] tests/test_dev/test_internal_cmds.py::test_no_internal_commands[:exit] PASSED [ 63%] tests/test_dev/test_internal_cmds.py::test_no_internal_commands[:quit] PASSED [ 65%] tests/test_dev/test_internal_cmds.py::test_no_internal_commands[:q] PASSED [ 67%] tests/test_dev/test_register_internal_cmds.py::test_register_cmd_from_str PASSED [ 68%] tests/test_dev/test_register_internal_cmds.py::test_register_func_xfails[test_input0] PASSED [ 70%] tests/test_dev/test_register_internal_cmds.py::test_register_func_xfails[test_input1] PASSED [ 72%] tests/test_dev/test_sys_cmds.py::test_system_commands[!echo hi-hi\n] PASSED [ 73%] tests/test_dev/test_sys_cmds.py::test_system_commands[!echo hi hi-hi hi\n] PASSED [ 75%] tests/test_dev/test_sys_cmds.py::test_system_commands[!-] PASSED [ 77%] tests/test_dev/test_sys_cmds.py::test_no_system_commands[!echo hi] PASSED [ 78%] tests/test_dev/test_sys_cmds.py::test_no_system_commands[!echo hi hi] PASSED [ 80%] tests/test_dev/test_sys_cmds.py::test_no_system_commands[!] PASSED [ 81%] tests/test_repl.py::test_simple_repl PASSED [ 83%] tests/test_repl.py::test_repl_dispatches_subcommand FAILED [ 85%] tests/test_repl.py::test_group_command_called FAILED [ 86%] tests/test_repl.py::test_group_argument_with_required_false[args0-foo\n-InvalidGroupFormat-] PASSED [ 88%] tests/test_repl.py::test_group_argument_with_required_false[args1--SystemExit-] PASSED [ 90%] tests/test_repl.py::test_group_argument_with_required_false[args2-foo\n-SystemExit-Foo\n] FAILED [ 91%] tests/test_repl.py::test_group_with_multiple_optional_args[args0-cli(hi, 1, None)\ncli(hi, 1, None)\nFoo!\n] FAILED [ 93%] tests/test_repl.py::test_group_with_multiple_optional_args[args1-cli(hi, opt1, None)\ncli(hi, opt1, None)\nFoo!\n] FAILED [ 95%] tests/test_repl.py::test_group_with_multiple_optional_args[args2-cli(hi, 1, opt2)\ncli(hi, 1, opt2)\nFoo!\n] FAILED [ 96%] tests/test_repl.py::test_group_with_multiple_optional_args[args3-cli(hi, opt1, opt2)\ncli(hi, opt1, opt2)\nFoo!\n] FAILED [ 98%] tests/test_repl.py::test_inputs PASSED [100%] =================================== FAILURES =================================== _____________________________ test_arg_completion ______________________________ def test_arg_completion(): @root_command.command() @click.argument("handler", type=click.Choice(("foo", "bar"))) def arg_cmd(handler): pass > completions = list(c.get_completions(Document("arg-cmd "))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tests/test_basic.py:21: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ click_repl/_completer.py:257: in get_completions self.parsed_ctx = _resolve_context(args, self.ctx) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ click_repl/utils.py:46: in _resolve_context name, cmd, args = command.resolve_command(ctx, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , ctx = args = ['arg-cmd'] def resolve_command( self, ctx: Context, args: list[str] ) -> tuple[str | None, Command | None, list[str]]: cmd_name = make_str(args[0]) # Get the command cmd = self.get_command(ctx, cmd_name) # If we can't find the command but there is a normalization # function available, we try with that one. if cmd is None and ctx.token_normalize_func is not None: cmd_name = ctx.token_normalize_func(cmd_name) cmd = self.get_command(ctx, cmd_name) # If we don't find the command we want to show an error message # to the user that it was not provided. However, there is # something else we should do: if the first argument looks like # an option we want to kick off parsing again for arguments to # resolve things like --help which now should go to the main # place. if cmd is None and not ctx.resilient_parsing: if _split_opt(cmd_name)[0]: self.parse_args(ctx, args) > raise NoSuchCommand(cmd_name, possibilities=self.commands, ctx=ctx) E click.exceptions.NoSuchCommand: No such command 'arg-cmd'. /usr/lib/python3/site-packages/click/core.py:2027: NoSuchCommand ________________ test_option_completion[option-cmd -expected0] _________________ test_input = 'option-cmd ', expected = {'--handler', '-h'} @pytest.mark.parametrize( "test_input,expected", [ ("option-cmd ", {"--handler", "-h"}), ("option-cmd -h", {"-h"}), ("option-cmd --h", {"--handler"}), ], ) def test_option_completion(test_input, expected): > completions = list(c.get_completions(Document(test_input))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tests/test_basic.py:40: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ click_repl/_completer.py:257: in get_completions self.parsed_ctx = _resolve_context(args, self.ctx) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ click_repl/utils.py:46: in _resolve_context name, cmd, args = command.resolve_command(ctx, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , ctx = args = ['option-cmd'] def resolve_command( self, ctx: Context, args: list[str] ) -> tuple[str | None, Command | None, list[str]]: cmd_name = make_str(args[0]) # Get the command cmd = self.get_command(ctx, cmd_name) # If we can't find the command but there is a normalization # function available, we try with that one. if cmd is None and ctx.token_normalize_func is not None: cmd_name = ctx.token_normalize_func(cmd_name) cmd = self.get_command(ctx, cmd_name) # If we don't find the command we want to show an error message # to the user that it was not provided. However, there is # something else we should do: if the first argument looks like # an option we want to kick off parsing again for arguments to # resolve things like --help which now should go to the main # place. if cmd is None and not ctx.resilient_parsing: if _split_opt(cmd_name)[0]: self.parse_args(ctx, args) > raise NoSuchCommand(cmd_name, possibilities=self.commands, ctx=ctx) E click.exceptions.NoSuchCommand: No such command 'option-cmd'. /usr/lib/python3/site-packages/click/core.py:2027: NoSuchCommand _______________ test_option_completion[option-cmd -h-expected1] ________________ test_input = 'option-cmd -h', expected = {'-h'} @pytest.mark.parametrize( "test_input,expected", [ ("option-cmd ", {"--handler", "-h"}), ("option-cmd -h", {"-h"}), ("option-cmd --h", {"--handler"}), ], ) def test_option_completion(test_input, expected): completions = list(c.get_completions(Document(test_input))) > assert {x.text for x in completions} == expected E AssertionError: assert set() == {'-h'} E E Extra items in the right set: E '-h' E E Full diff: E + set() E - { E - '-h', E - } tests/test_basic.py:41: AssertionError _______________ test_option_completion[option-cmd --h-expected2] _______________ test_input = 'option-cmd --h', expected = {'--handler'} @pytest.mark.parametrize( "test_input,expected", [ ("option-cmd ", {"--handler", "-h"}), ("option-cmd -h", {"-h"}), ("option-cmd --h", {"--handler"}), ], ) def test_option_completion(test_input, expected): completions = list(c.get_completions(Document(test_input))) > assert {x.text for x in completions} == expected E AssertionError: assert set() == {'--handler'} E E Extra items in the right set: E '--handler' E E Full diff: E + set() E - { E - '--handler', E - } tests/test_basic.py:41: AssertionError ___________________________ test_command_collection ____________________________ def test_command_collection(): @click.group() def foo_group(): pass @foo_group.command() def foo_cmd(): pass @click.group() def foobar_group(): pass @foobar_group.command() def foobar_cmd(): pass cmd = click.CommandCollection(sources=(foo_group, foobar_group)) c = ClickCompleter(cmd, click.Context(cmd)) completions = list(c.get_completions(Document("foo"))) > assert {x.text for x in completions} == {"foo-cmd", "foobar-cmd"} E AssertionError: assert {'foo', 'foobar'} == {'foo-cmd', 'foobar-cmd'} E E Extra items in the left set: E 'foobar' E 'foo' E Extra items in the right set: E 'foo-cmd' E 'foobar-cmd'... E E ...Full output truncated (10 lines hidden), use '-vv' to show tests/test_command_collection.py:28: AssertionError ______________________________ test_hidden_option ______________________________ def test_hidden_option(): @root_command.command() @click.option("--handler", "-h", hidden=True) def hidden_option_cmd(handler): pass > completions = list(c.get_completions(Document("hidden-option-cmd "))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tests/test_completion/test_common_tests/test_hidden_cmd_and_args.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ click_repl/_completer.py:257: in get_completions self.parsed_ctx = _resolve_context(args, self.ctx) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ click_repl/utils.py:46: in _resolve_context name, cmd, args = command.resolve_command(ctx, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , ctx = args = ['hidden-option-cmd'] def resolve_command( self, ctx: Context, args: list[str] ) -> tuple[str | None, Command | None, list[str]]: cmd_name = make_str(args[0]) # Get the command cmd = self.get_command(ctx, cmd_name) # If we can't find the command but there is a normalization # function available, we try with that one. if cmd is None and ctx.token_normalize_func is not None: cmd_name = ctx.token_normalize_func(cmd_name) cmd = self.get_command(ctx, cmd_name) # If we don't find the command we want to show an error message # to the user that it was not provided. However, there is # something else we should do: if the first argument looks like # an option we want to kick off parsing again for arguments to # resolve things like --help which now should go to the main # place. if cmd is None and not ctx.resilient_parsing: if _split_opt(cmd_name)[0]: self.parse_args(ctx, args) > raise NoSuchCommand(cmd_name, possibilities=self.commands, ctx=ctx) E click.exceptions.NoSuchCommand: No such command 'hidden-option-cmd'. /usr/lib/python3/site-packages/click/core.py:2027: NoSuchCommand _________________________ test_args_of_hidden_command __________________________ def test_args_of_hidden_command(): @root_command.command(hidden=True) @click.argument("handler1", type=click.Choice(("foo", "bar"))) @click.option("--handler2", type=click.Choice(("foo", "bar"))) def args_choices_hidden_cmd(handler): pass completions = list(c.get_completions(Document("option-"))) assert {x.text for x in completions} == set() > completions = list(c.get_completions(Document("args-choices-hidden-cmd foo "))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tests/test_completion/test_common_tests/test_hidden_cmd_and_args.py:44: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ click_repl/_completer.py:257: in get_completions self.parsed_ctx = _resolve_context(args, self.ctx) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ click_repl/utils.py:46: in _resolve_context name, cmd, args = command.resolve_command(ctx, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , ctx = args = ['args-choices-hidden-cmd', 'foo'] def resolve_command( self, ctx: Context, args: list[str] ) -> tuple[str | None, Command | None, list[str]]: cmd_name = make_str(args[0]) # Get the command cmd = self.get_command(ctx, cmd_name) # If we can't find the command but there is a normalization # function available, we try with that one. if cmd is None and ctx.token_normalize_func is not None: cmd_name = ctx.token_normalize_func(cmd_name) cmd = self.get_command(ctx, cmd_name) # If we don't find the command we want to show an error message # to the user that it was not provided. However, there is # something else we should do: if the first argument looks like # an option we want to kick off parsing again for arguments to # resolve things like --help which now should go to the main # place. if cmd is None and not ctx.resilient_parsing: if _split_opt(cmd_name)[0]: self.parse_args(ctx, args) > raise NoSuchCommand(cmd_name, possibilities=self.commands, ctx=ctx) E click.exceptions.NoSuchCommand: No such command 'args-choices-hidden-cmd'. /usr/lib/python3/site-packages/click/core.py:2027: NoSuchCommand ______________________ test_completion_multilevel_command ______________________ def test_completion_multilevel_command(): @click.group() def root_group(): pass @root_group.group() def first_level_command(): pass @first_level_command.command() def second_level_command_one(): pass @first_level_command.command() def second_level_command_two(): pass c = ClickCompleter(root_group, click.Context(root_group)) > completions = list(c.get_completions(Document("first-level-command "))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tests/test_completion/test_common_tests/test_hidden_cmd_and_args.py:72: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ click_repl/_completer.py:257: in get_completions self.parsed_ctx = _resolve_context(args, self.ctx) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ click_repl/utils.py:46: in _resolve_context name, cmd, args = command.resolve_command(ctx, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , ctx = args = ['first-level-command'] def resolve_command( self, ctx: Context, args: list[str] ) -> tuple[str | None, Command | None, list[str]]: cmd_name = make_str(args[0]) # Get the command cmd = self.get_command(ctx, cmd_name) # If we can't find the command but there is a normalization # function available, we try with that one. if cmd is None and ctx.token_normalize_func is not None: cmd_name = ctx.token_normalize_func(cmd_name) cmd = self.get_command(ctx, cmd_name) # If we don't find the command we want to show an error message # to the user that it was not provided. However, there is # something else we should do: if the first argument looks like # an option we want to kick off parsing again for arguments to # resolve things like --help which now should go to the main # place. if cmd is None and not ctx.resilient_parsing: if _split_opt(cmd_name)[0]: self.parse_args(ctx, args) > raise NoSuchCommand(cmd_name, possibilities=self.commands, ctx=ctx) E click.exceptions.NoSuchCommand: No such command 'first-level-command'. /usr/lib/python3/site-packages/click/core.py:2027: NoSuchCommand _______________________ test_repl_dispatches_subcommand ________________________ old_ctx = , prompt_kwargs = {} allow_system_commands = True, allow_internal_commands = True def repl( old_ctx, prompt_kwargs={}, allow_system_commands=True, allow_internal_commands=True ): """ Start an interactive shell. All subcommands are available in it. :param old_ctx: The current Click context. :param prompt_kwargs: Parameters passed to :py:func:`prompt_toolkit.PromptSession`. If stdin is not a TTY, no prompt will be printed, but only commands read from stdin. """ group_ctx = old_ctx # Switching to the parent context that has a Group as its command # as a Group acts as a CLI for all of its subcommands if old_ctx.parent is not None and not isinstance(old_ctx.command, click.Group): group_ctx = old_ctx.parent group = group_ctx.command # An Optional click.Argument in the CLI Group, that has no value # will consume the first word from the REPL input, causing issues in # executing the command # So, if there's an empty Optional Argument for param in group.params: if ( isinstance(param, click.Argument) and group_ctx.params[param.name] is None and not param.required ): raise InvalidGroupFormat( f"{type(group).__name__} '{group.name}' requires value for " f"an optional argument '{param.name}' in REPL mode" ) isatty = sys.stdin.isatty() # Delete the REPL command from those available, as we don't want to allow # nesting REPLs (note: pass `None` to `pop` as we don't want to error if # REPL command already not present for some reason). repl_command_name = old_ctx.command.name if isinstance(group_ctx.command, click.CommandCollection): available_commands = { cmd_name: cmd_obj for source in group_ctx.command.sources for cmd_name, cmd_obj in source.commands.items() } else: available_commands = group_ctx.command.commands original_command = available_commands.pop(repl_command_name, None) if isatty: prompt_kwargs = bootstrap_prompt(group, prompt_kwargs, group_ctx) session = PromptSession(**prompt_kwargs) def get_command(): return session.prompt() else: get_command = sys.stdin.readline while True: try: command = get_command() except KeyboardInterrupt: continue except EOFError: break if not command: if isatty: continue else: break try: args = _execute_internal_and_sys_cmds( command, allow_internal_commands, allow_system_commands ) if args is None: continue except CommandLineParserError: continue except ExitReplException: break try: # The group command will dispatch based on args. old_protected_args = group_ctx.protected_args try: > group_ctx.protected_args = args ^^^^^^^^^^^^^^^^^^^^^^^^ E AttributeError: property 'protected_args' of 'Context' object has no setter click_repl/_repl.py:134: AttributeError During handling of the above exception, another exception occurred: capsys = <_pytest.capture.CaptureFixture object at 0xf5f18300> def test_repl_dispatches_subcommand(capsys): @click.group(invoke_without_command=True) @click.pass_context def cli(ctx): if ctx.invoked_subcommand is None: click_repl.repl(ctx) @cli.command() def foo(): print("Foo!") with mock_stdin("foo\n"): with pytest.raises(SystemExit): > cli(args=[], prog_name="test_repl_dispatch_subcommand") tests/test_repl.py:42: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/site-packages/click/core.py:1569: in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:1490: in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:1948: in invoke rv = super().invoke(ctx) ^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:1353: in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:907: in invoke return callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/decorators.py:34: in new_func return f(get_current_context(), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tests/test_repl.py:34: in cli click_repl.repl(ctx) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ old_ctx = , prompt_kwargs = {} allow_system_commands = True, allow_internal_commands = True def repl( old_ctx, prompt_kwargs={}, allow_system_commands=True, allow_internal_commands=True ): """ Start an interactive shell. All subcommands are available in it. :param old_ctx: The current Click context. :param prompt_kwargs: Parameters passed to :py:func:`prompt_toolkit.PromptSession`. If stdin is not a TTY, no prompt will be printed, but only commands read from stdin. """ group_ctx = old_ctx # Switching to the parent context that has a Group as its command # as a Group acts as a CLI for all of its subcommands if old_ctx.parent is not None and not isinstance(old_ctx.command, click.Group): group_ctx = old_ctx.parent group = group_ctx.command # An Optional click.Argument in the CLI Group, that has no value # will consume the first word from the REPL input, causing issues in # executing the command # So, if there's an empty Optional Argument for param in group.params: if ( isinstance(param, click.Argument) and group_ctx.params[param.name] is None and not param.required ): raise InvalidGroupFormat( f"{type(group).__name__} '{group.name}' requires value for " f"an optional argument '{param.name}' in REPL mode" ) isatty = sys.stdin.isatty() # Delete the REPL command from those available, as we don't want to allow # nesting REPLs (note: pass `None` to `pop` as we don't want to error if # REPL command already not present for some reason). repl_command_name = old_ctx.command.name if isinstance(group_ctx.command, click.CommandCollection): available_commands = { cmd_name: cmd_obj for source in group_ctx.command.sources for cmd_name, cmd_obj in source.commands.items() } else: available_commands = group_ctx.command.commands original_command = available_commands.pop(repl_command_name, None) if isatty: prompt_kwargs = bootstrap_prompt(group, prompt_kwargs, group_ctx) session = PromptSession(**prompt_kwargs) def get_command(): return session.prompt() else: get_command = sys.stdin.readline while True: try: command = get_command() except KeyboardInterrupt: continue except EOFError: break if not command: if isatty: continue else: break try: args = _execute_internal_and_sys_cmds( command, allow_internal_commands, allow_system_commands ) if args is None: continue except CommandLineParserError: continue except ExitReplException: break try: # The group command will dispatch based on args. old_protected_args = group_ctx.protected_args try: group_ctx.protected_args = args group.invoke(group_ctx) finally: > group_ctx.protected_args = old_protected_args ^^^^^^^^^^^^^^^^^^^^^^^^ E AttributeError: property 'protected_args' of 'Context' object has no setter click_repl/_repl.py:137: AttributeError __________________________ test_group_command_called ___________________________ old_ctx = , prompt_kwargs = {} allow_system_commands = True, allow_internal_commands = True def repl( old_ctx, prompt_kwargs={}, allow_system_commands=True, allow_internal_commands=True ): """ Start an interactive shell. All subcommands are available in it. :param old_ctx: The current Click context. :param prompt_kwargs: Parameters passed to :py:func:`prompt_toolkit.PromptSession`. If stdin is not a TTY, no prompt will be printed, but only commands read from stdin. """ group_ctx = old_ctx # Switching to the parent context that has a Group as its command # as a Group acts as a CLI for all of its subcommands if old_ctx.parent is not None and not isinstance(old_ctx.command, click.Group): group_ctx = old_ctx.parent group = group_ctx.command # An Optional click.Argument in the CLI Group, that has no value # will consume the first word from the REPL input, causing issues in # executing the command # So, if there's an empty Optional Argument for param in group.params: if ( isinstance(param, click.Argument) and group_ctx.params[param.name] is None and not param.required ): raise InvalidGroupFormat( f"{type(group).__name__} '{group.name}' requires value for " f"an optional argument '{param.name}' in REPL mode" ) isatty = sys.stdin.isatty() # Delete the REPL command from those available, as we don't want to allow # nesting REPLs (note: pass `None` to `pop` as we don't want to error if # REPL command already not present for some reason). repl_command_name = old_ctx.command.name if isinstance(group_ctx.command, click.CommandCollection): available_commands = { cmd_name: cmd_obj for source in group_ctx.command.sources for cmd_name, cmd_obj in source.commands.items() } else: available_commands = group_ctx.command.commands original_command = available_commands.pop(repl_command_name, None) if isatty: prompt_kwargs = bootstrap_prompt(group, prompt_kwargs, group_ctx) session = PromptSession(**prompt_kwargs) def get_command(): return session.prompt() else: get_command = sys.stdin.readline while True: try: command = get_command() except KeyboardInterrupt: continue except EOFError: break if not command: if isatty: continue else: break try: args = _execute_internal_and_sys_cmds( command, allow_internal_commands, allow_system_commands ) if args is None: continue except CommandLineParserError: continue except ExitReplException: break try: # The group command will dispatch based on args. old_protected_args = group_ctx.protected_args try: > group_ctx.protected_args = args ^^^^^^^^^^^^^^^^^^^^^^^^ E AttributeError: property 'protected_args' of 'Context' object has no setter click_repl/_repl.py:134: AttributeError During handling of the above exception, another exception occurred: capsys = <_pytest.capture.CaptureFixture object at 0xf5f1c0a8> def test_group_command_called(capsys): @click.group(invoke_without_command=True) @click.pass_context def cli(ctx): print("cli()") if ctx.invoked_subcommand is None: click_repl.repl(ctx) @cli.command() def foo(): print("Foo!") @cli.command() def bar(): print("Bar!") with mock_stdin("foo\nbar\n"): with pytest.raises(SystemExit): > cli(args=[], prog_name="test_group_called") tests/test_repl.py:65: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/site-packages/click/core.py:1569: in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:1490: in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:1948: in invoke rv = super().invoke(ctx) ^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:1353: in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:907: in invoke return callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/decorators.py:34: in new_func return f(get_current_context(), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tests/test_repl.py:53: in cli click_repl.repl(ctx) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ old_ctx = , prompt_kwargs = {} allow_system_commands = True, allow_internal_commands = True def repl( old_ctx, prompt_kwargs={}, allow_system_commands=True, allow_internal_commands=True ): """ Start an interactive shell. All subcommands are available in it. :param old_ctx: The current Click context. :param prompt_kwargs: Parameters passed to :py:func:`prompt_toolkit.PromptSession`. If stdin is not a TTY, no prompt will be printed, but only commands read from stdin. """ group_ctx = old_ctx # Switching to the parent context that has a Group as its command # as a Group acts as a CLI for all of its subcommands if old_ctx.parent is not None and not isinstance(old_ctx.command, click.Group): group_ctx = old_ctx.parent group = group_ctx.command # An Optional click.Argument in the CLI Group, that has no value # will consume the first word from the REPL input, causing issues in # executing the command # So, if there's an empty Optional Argument for param in group.params: if ( isinstance(param, click.Argument) and group_ctx.params[param.name] is None and not param.required ): raise InvalidGroupFormat( f"{type(group).__name__} '{group.name}' requires value for " f"an optional argument '{param.name}' in REPL mode" ) isatty = sys.stdin.isatty() # Delete the REPL command from those available, as we don't want to allow # nesting REPLs (note: pass `None` to `pop` as we don't want to error if # REPL command already not present for some reason). repl_command_name = old_ctx.command.name if isinstance(group_ctx.command, click.CommandCollection): available_commands = { cmd_name: cmd_obj for source in group_ctx.command.sources for cmd_name, cmd_obj in source.commands.items() } else: available_commands = group_ctx.command.commands original_command = available_commands.pop(repl_command_name, None) if isatty: prompt_kwargs = bootstrap_prompt(group, prompt_kwargs, group_ctx) session = PromptSession(**prompt_kwargs) def get_command(): return session.prompt() else: get_command = sys.stdin.readline while True: try: command = get_command() except KeyboardInterrupt: continue except EOFError: break if not command: if isatty: continue else: break try: args = _execute_internal_and_sys_cmds( command, allow_internal_commands, allow_system_commands ) if args is None: continue except CommandLineParserError: continue except ExitReplException: break try: # The group command will dispatch based on args. old_protected_args = group_ctx.protected_args try: group_ctx.protected_args = args group.invoke(group_ctx) finally: > group_ctx.protected_args = old_protected_args ^^^^^^^^^^^^^^^^^^^^^^^^ E AttributeError: property 'protected_args' of 'Context' object has no setter click_repl/_repl.py:137: AttributeError ----------------------------- Captured stdout call ----------------------------- cli() ____ test_group_argument_with_required_false[args2-foo\n-SystemExit-Foo\n] _____ old_ctx = , prompt_kwargs = {} allow_system_commands = True, allow_internal_commands = True def repl( old_ctx, prompt_kwargs={}, allow_system_commands=True, allow_internal_commands=True ): """ Start an interactive shell. All subcommands are available in it. :param old_ctx: The current Click context. :param prompt_kwargs: Parameters passed to :py:func:`prompt_toolkit.PromptSession`. If stdin is not a TTY, no prompt will be printed, but only commands read from stdin. """ group_ctx = old_ctx # Switching to the parent context that has a Group as its command # as a Group acts as a CLI for all of its subcommands if old_ctx.parent is not None and not isinstance(old_ctx.command, click.Group): group_ctx = old_ctx.parent group = group_ctx.command # An Optional click.Argument in the CLI Group, that has no value # will consume the first word from the REPL input, causing issues in # executing the command # So, if there's an empty Optional Argument for param in group.params: if ( isinstance(param, click.Argument) and group_ctx.params[param.name] is None and not param.required ): raise InvalidGroupFormat( f"{type(group).__name__} '{group.name}' requires value for " f"an optional argument '{param.name}' in REPL mode" ) isatty = sys.stdin.isatty() # Delete the REPL command from those available, as we don't want to allow # nesting REPLs (note: pass `None` to `pop` as we don't want to error if # REPL command already not present for some reason). repl_command_name = old_ctx.command.name if isinstance(group_ctx.command, click.CommandCollection): available_commands = { cmd_name: cmd_obj for source in group_ctx.command.sources for cmd_name, cmd_obj in source.commands.items() } else: available_commands = group_ctx.command.commands original_command = available_commands.pop(repl_command_name, None) if isatty: prompt_kwargs = bootstrap_prompt(group, prompt_kwargs, group_ctx) session = PromptSession(**prompt_kwargs) def get_command(): return session.prompt() else: get_command = sys.stdin.readline while True: try: command = get_command() except KeyboardInterrupt: continue except EOFError: break if not command: if isatty: continue else: break try: args = _execute_internal_and_sys_cmds( command, allow_internal_commands, allow_system_commands ) if args is None: continue except CommandLineParserError: continue except ExitReplException: break try: # The group command will dispatch based on args. old_protected_args = group_ctx.protected_args try: > group_ctx.protected_args = args ^^^^^^^^^^^^^^^^^^^^^^^^ E AttributeError: property 'protected_args' of 'Context' object has no setter click_repl/_repl.py:134: AttributeError During handling of the above exception, another exception occurred: capsys = <_pytest.capture.CaptureFixture object at 0xf5e8aac0> args = ['temp_arg'], stdin = 'foo\n', expected_err = expected_output = 'Foo\n' @pytest.mark.parametrize( "args, stdin, expected_err, expected_output", [ ([], "foo\n", click_repl.exceptions.InvalidGroupFormat, ""), (["temp_arg"], "", SystemExit, ""), (["temp_arg"], "foo\n", SystemExit, "Foo\n"), ], ) def test_group_argument_with_required_false( capsys, args, stdin, expected_err, expected_output ): with pytest.raises(expected_err): with mock_stdin(stdin): > cli_arg_required_false(args=args, prog_name="cli_arg_required_false") tests/test_repl.py:98: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/site-packages/click/core.py:1569: in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:1490: in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:1948: in invoke rv = super().invoke(ctx) ^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:1353: in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:907: in invoke return callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/decorators.py:34: in new_func return f(get_current_context(), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tests/test_repl.py:77: in cli_arg_required_false click_repl.repl(ctx) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ old_ctx = , prompt_kwargs = {} allow_system_commands = True, allow_internal_commands = True def repl( old_ctx, prompt_kwargs={}, allow_system_commands=True, allow_internal_commands=True ): """ Start an interactive shell. All subcommands are available in it. :param old_ctx: The current Click context. :param prompt_kwargs: Parameters passed to :py:func:`prompt_toolkit.PromptSession`. If stdin is not a TTY, no prompt will be printed, but only commands read from stdin. """ group_ctx = old_ctx # Switching to the parent context that has a Group as its command # as a Group acts as a CLI for all of its subcommands if old_ctx.parent is not None and not isinstance(old_ctx.command, click.Group): group_ctx = old_ctx.parent group = group_ctx.command # An Optional click.Argument in the CLI Group, that has no value # will consume the first word from the REPL input, causing issues in # executing the command # So, if there's an empty Optional Argument for param in group.params: if ( isinstance(param, click.Argument) and group_ctx.params[param.name] is None and not param.required ): raise InvalidGroupFormat( f"{type(group).__name__} '{group.name}' requires value for " f"an optional argument '{param.name}' in REPL mode" ) isatty = sys.stdin.isatty() # Delete the REPL command from those available, as we don't want to allow # nesting REPLs (note: pass `None` to `pop` as we don't want to error if # REPL command already not present for some reason). repl_command_name = old_ctx.command.name if isinstance(group_ctx.command, click.CommandCollection): available_commands = { cmd_name: cmd_obj for source in group_ctx.command.sources for cmd_name, cmd_obj in source.commands.items() } else: available_commands = group_ctx.command.commands original_command = available_commands.pop(repl_command_name, None) if isatty: prompt_kwargs = bootstrap_prompt(group, prompt_kwargs, group_ctx) session = PromptSession(**prompt_kwargs) def get_command(): return session.prompt() else: get_command = sys.stdin.readline while True: try: command = get_command() except KeyboardInterrupt: continue except EOFError: break if not command: if isatty: continue else: break try: args = _execute_internal_and_sys_cmds( command, allow_internal_commands, allow_system_commands ) if args is None: continue except CommandLineParserError: continue except ExitReplException: break try: # The group command will dispatch based on args. old_protected_args = group_ctx.protected_args try: group_ctx.protected_args = args group.invoke(group_ctx) finally: > group_ctx.protected_args = old_protected_args ^^^^^^^^^^^^^^^^^^^^^^^^ E AttributeError: property 'protected_args' of 'Context' object has no setter click_repl/_repl.py:137: AttributeError _ test_group_with_multiple_optional_args[args0-cli(hi, 1, None)\ncli(hi, 1, None)\nFoo!\n] _ old_ctx = , prompt_kwargs = {} allow_system_commands = True, allow_internal_commands = True def repl( old_ctx, prompt_kwargs={}, allow_system_commands=True, allow_internal_commands=True ): """ Start an interactive shell. All subcommands are available in it. :param old_ctx: The current Click context. :param prompt_kwargs: Parameters passed to :py:func:`prompt_toolkit.PromptSession`. If stdin is not a TTY, no prompt will be printed, but only commands read from stdin. """ group_ctx = old_ctx # Switching to the parent context that has a Group as its command # as a Group acts as a CLI for all of its subcommands if old_ctx.parent is not None and not isinstance(old_ctx.command, click.Group): group_ctx = old_ctx.parent group = group_ctx.command # An Optional click.Argument in the CLI Group, that has no value # will consume the first word from the REPL input, causing issues in # executing the command # So, if there's an empty Optional Argument for param in group.params: if ( isinstance(param, click.Argument) and group_ctx.params[param.name] is None and not param.required ): raise InvalidGroupFormat( f"{type(group).__name__} '{group.name}' requires value for " f"an optional argument '{param.name}' in REPL mode" ) isatty = sys.stdin.isatty() # Delete the REPL command from those available, as we don't want to allow # nesting REPLs (note: pass `None` to `pop` as we don't want to error if # REPL command already not present for some reason). repl_command_name = old_ctx.command.name if isinstance(group_ctx.command, click.CommandCollection): available_commands = { cmd_name: cmd_obj for source in group_ctx.command.sources for cmd_name, cmd_obj in source.commands.items() } else: available_commands = group_ctx.command.commands original_command = available_commands.pop(repl_command_name, None) if isatty: prompt_kwargs = bootstrap_prompt(group, prompt_kwargs, group_ctx) session = PromptSession(**prompt_kwargs) def get_command(): return session.prompt() else: get_command = sys.stdin.readline while True: try: command = get_command() except KeyboardInterrupt: continue except EOFError: break if not command: if isatty: continue else: break try: args = _execute_internal_and_sys_cmds( command, allow_internal_commands, allow_system_commands ) if args is None: continue except CommandLineParserError: continue except ExitReplException: break try: # The group command will dispatch based on args. old_protected_args = group_ctx.protected_args try: > group_ctx.protected_args = args ^^^^^^^^^^^^^^^^^^^^^^^^ E AttributeError: property 'protected_args' of 'Context' object has no setter click_repl/_repl.py:134: AttributeError During handling of the above exception, another exception occurred: capsys = <_pytest.capture.CaptureFixture object at 0xf5f31db0>, args = ['hi'] expected = 'cli(hi, 1, None)\ncli(hi, 1, None)\nFoo!\n' @pytest.mark.parametrize( "args, expected", [ (["hi"], "cli(hi, 1, None)\ncli(hi, 1, None)\nFoo!\n"), ( ["--option1", "opt1", "hi"], "cli(hi, opt1, None)\ncli(hi, opt1, None)\nFoo!\n", ), (["--option2", "opt2", "hi"], "cli(hi, 1, opt2)\ncli(hi, 1, opt2)\nFoo!\n"), ( ["--option1", "opt1", "--option2", "opt2", "hi"], "cli(hi, opt1, opt2)\ncli(hi, opt1, opt2)\nFoo!\n", ), ], ) def test_group_with_multiple_optional_args(capsys, args, expected): with pytest.raises(SystemExit): with mock_stdin("foo\n"): > cmd(args=args, prog_name="test_group_with_multiple_args") tests/test_repl.py:137: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/site-packages/click/core.py:1569: in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:1490: in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:1948: in invoke rv = super().invoke(ctx) ^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:1353: in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:907: in invoke return callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/decorators.py:34: in new_func return f(get_current_context(), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tests/test_repl.py:111: in cmd click_repl.repl(ctx) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ old_ctx = , prompt_kwargs = {} allow_system_commands = True, allow_internal_commands = True def repl( old_ctx, prompt_kwargs={}, allow_system_commands=True, allow_internal_commands=True ): """ Start an interactive shell. All subcommands are available in it. :param old_ctx: The current Click context. :param prompt_kwargs: Parameters passed to :py:func:`prompt_toolkit.PromptSession`. If stdin is not a TTY, no prompt will be printed, but only commands read from stdin. """ group_ctx = old_ctx # Switching to the parent context that has a Group as its command # as a Group acts as a CLI for all of its subcommands if old_ctx.parent is not None and not isinstance(old_ctx.command, click.Group): group_ctx = old_ctx.parent group = group_ctx.command # An Optional click.Argument in the CLI Group, that has no value # will consume the first word from the REPL input, causing issues in # executing the command # So, if there's an empty Optional Argument for param in group.params: if ( isinstance(param, click.Argument) and group_ctx.params[param.name] is None and not param.required ): raise InvalidGroupFormat( f"{type(group).__name__} '{group.name}' requires value for " f"an optional argument '{param.name}' in REPL mode" ) isatty = sys.stdin.isatty() # Delete the REPL command from those available, as we don't want to allow # nesting REPLs (note: pass `None` to `pop` as we don't want to error if # REPL command already not present for some reason). repl_command_name = old_ctx.command.name if isinstance(group_ctx.command, click.CommandCollection): available_commands = { cmd_name: cmd_obj for source in group_ctx.command.sources for cmd_name, cmd_obj in source.commands.items() } else: available_commands = group_ctx.command.commands original_command = available_commands.pop(repl_command_name, None) if isatty: prompt_kwargs = bootstrap_prompt(group, prompt_kwargs, group_ctx) session = PromptSession(**prompt_kwargs) def get_command(): return session.prompt() else: get_command = sys.stdin.readline while True: try: command = get_command() except KeyboardInterrupt: continue except EOFError: break if not command: if isatty: continue else: break try: args = _execute_internal_and_sys_cmds( command, allow_internal_commands, allow_system_commands ) if args is None: continue except CommandLineParserError: continue except ExitReplException: break try: # The group command will dispatch based on args. old_protected_args = group_ctx.protected_args try: group_ctx.protected_args = args group.invoke(group_ctx) finally: > group_ctx.protected_args = old_protected_args ^^^^^^^^^^^^^^^^^^^^^^^^ E AttributeError: property 'protected_args' of 'Context' object has no setter click_repl/_repl.py:137: AttributeError ----------------------------- Captured stdout call ----------------------------- cli(hi, 1, None) _ test_group_with_multiple_optional_args[args1-cli(hi, opt1, None)\ncli(hi, opt1, None)\nFoo!\n] _ old_ctx = , prompt_kwargs = {} allow_system_commands = True, allow_internal_commands = True def repl( old_ctx, prompt_kwargs={}, allow_system_commands=True, allow_internal_commands=True ): """ Start an interactive shell. All subcommands are available in it. :param old_ctx: The current Click context. :param prompt_kwargs: Parameters passed to :py:func:`prompt_toolkit.PromptSession`. If stdin is not a TTY, no prompt will be printed, but only commands read from stdin. """ group_ctx = old_ctx # Switching to the parent context that has a Group as its command # as a Group acts as a CLI for all of its subcommands if old_ctx.parent is not None and not isinstance(old_ctx.command, click.Group): group_ctx = old_ctx.parent group = group_ctx.command # An Optional click.Argument in the CLI Group, that has no value # will consume the first word from the REPL input, causing issues in # executing the command # So, if there's an empty Optional Argument for param in group.params: if ( isinstance(param, click.Argument) and group_ctx.params[param.name] is None and not param.required ): raise InvalidGroupFormat( f"{type(group).__name__} '{group.name}' requires value for " f"an optional argument '{param.name}' in REPL mode" ) isatty = sys.stdin.isatty() # Delete the REPL command from those available, as we don't want to allow # nesting REPLs (note: pass `None` to `pop` as we don't want to error if # REPL command already not present for some reason). repl_command_name = old_ctx.command.name if isinstance(group_ctx.command, click.CommandCollection): available_commands = { cmd_name: cmd_obj for source in group_ctx.command.sources for cmd_name, cmd_obj in source.commands.items() } else: available_commands = group_ctx.command.commands original_command = available_commands.pop(repl_command_name, None) if isatty: prompt_kwargs = bootstrap_prompt(group, prompt_kwargs, group_ctx) session = PromptSession(**prompt_kwargs) def get_command(): return session.prompt() else: get_command = sys.stdin.readline while True: try: command = get_command() except KeyboardInterrupt: continue except EOFError: break if not command: if isatty: continue else: break try: args = _execute_internal_and_sys_cmds( command, allow_internal_commands, allow_system_commands ) if args is None: continue except CommandLineParserError: continue except ExitReplException: break try: # The group command will dispatch based on args. old_protected_args = group_ctx.protected_args try: > group_ctx.protected_args = args ^^^^^^^^^^^^^^^^^^^^^^^^ E AttributeError: property 'protected_args' of 'Context' object has no setter click_repl/_repl.py:134: AttributeError During handling of the above exception, another exception occurred: capsys = <_pytest.capture.CaptureFixture object at 0xf5f1e8c8> args = ['--option1', 'opt1', 'hi'] expected = 'cli(hi, opt1, None)\ncli(hi, opt1, None)\nFoo!\n' @pytest.mark.parametrize( "args, expected", [ (["hi"], "cli(hi, 1, None)\ncli(hi, 1, None)\nFoo!\n"), ( ["--option1", "opt1", "hi"], "cli(hi, opt1, None)\ncli(hi, opt1, None)\nFoo!\n", ), (["--option2", "opt2", "hi"], "cli(hi, 1, opt2)\ncli(hi, 1, opt2)\nFoo!\n"), ( ["--option1", "opt1", "--option2", "opt2", "hi"], "cli(hi, opt1, opt2)\ncli(hi, opt1, opt2)\nFoo!\n", ), ], ) def test_group_with_multiple_optional_args(capsys, args, expected): with pytest.raises(SystemExit): with mock_stdin("foo\n"): > cmd(args=args, prog_name="test_group_with_multiple_args") tests/test_repl.py:137: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/site-packages/click/core.py:1569: in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:1490: in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:1948: in invoke rv = super().invoke(ctx) ^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:1353: in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:907: in invoke return callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/decorators.py:34: in new_func return f(get_current_context(), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tests/test_repl.py:111: in cmd click_repl.repl(ctx) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ old_ctx = , prompt_kwargs = {} allow_system_commands = True, allow_internal_commands = True def repl( old_ctx, prompt_kwargs={}, allow_system_commands=True, allow_internal_commands=True ): """ Start an interactive shell. All subcommands are available in it. :param old_ctx: The current Click context. :param prompt_kwargs: Parameters passed to :py:func:`prompt_toolkit.PromptSession`. If stdin is not a TTY, no prompt will be printed, but only commands read from stdin. """ group_ctx = old_ctx # Switching to the parent context that has a Group as its command # as a Group acts as a CLI for all of its subcommands if old_ctx.parent is not None and not isinstance(old_ctx.command, click.Group): group_ctx = old_ctx.parent group = group_ctx.command # An Optional click.Argument in the CLI Group, that has no value # will consume the first word from the REPL input, causing issues in # executing the command # So, if there's an empty Optional Argument for param in group.params: if ( isinstance(param, click.Argument) and group_ctx.params[param.name] is None and not param.required ): raise InvalidGroupFormat( f"{type(group).__name__} '{group.name}' requires value for " f"an optional argument '{param.name}' in REPL mode" ) isatty = sys.stdin.isatty() # Delete the REPL command from those available, as we don't want to allow # nesting REPLs (note: pass `None` to `pop` as we don't want to error if # REPL command already not present for some reason). repl_command_name = old_ctx.command.name if isinstance(group_ctx.command, click.CommandCollection): available_commands = { cmd_name: cmd_obj for source in group_ctx.command.sources for cmd_name, cmd_obj in source.commands.items() } else: available_commands = group_ctx.command.commands original_command = available_commands.pop(repl_command_name, None) if isatty: prompt_kwargs = bootstrap_prompt(group, prompt_kwargs, group_ctx) session = PromptSession(**prompt_kwargs) def get_command(): return session.prompt() else: get_command = sys.stdin.readline while True: try: command = get_command() except KeyboardInterrupt: continue except EOFError: break if not command: if isatty: continue else: break try: args = _execute_internal_and_sys_cmds( command, allow_internal_commands, allow_system_commands ) if args is None: continue except CommandLineParserError: continue except ExitReplException: break try: # The group command will dispatch based on args. old_protected_args = group_ctx.protected_args try: group_ctx.protected_args = args group.invoke(group_ctx) finally: > group_ctx.protected_args = old_protected_args ^^^^^^^^^^^^^^^^^^^^^^^^ E AttributeError: property 'protected_args' of 'Context' object has no setter click_repl/_repl.py:137: AttributeError ----------------------------- Captured stdout call ----------------------------- cli(hi, opt1, None) _ test_group_with_multiple_optional_args[args2-cli(hi, 1, opt2)\ncli(hi, 1, opt2)\nFoo!\n] _ old_ctx = , prompt_kwargs = {} allow_system_commands = True, allow_internal_commands = True def repl( old_ctx, prompt_kwargs={}, allow_system_commands=True, allow_internal_commands=True ): """ Start an interactive shell. All subcommands are available in it. :param old_ctx: The current Click context. :param prompt_kwargs: Parameters passed to :py:func:`prompt_toolkit.PromptSession`. If stdin is not a TTY, no prompt will be printed, but only commands read from stdin. """ group_ctx = old_ctx # Switching to the parent context that has a Group as its command # as a Group acts as a CLI for all of its subcommands if old_ctx.parent is not None and not isinstance(old_ctx.command, click.Group): group_ctx = old_ctx.parent group = group_ctx.command # An Optional click.Argument in the CLI Group, that has no value # will consume the first word from the REPL input, causing issues in # executing the command # So, if there's an empty Optional Argument for param in group.params: if ( isinstance(param, click.Argument) and group_ctx.params[param.name] is None and not param.required ): raise InvalidGroupFormat( f"{type(group).__name__} '{group.name}' requires value for " f"an optional argument '{param.name}' in REPL mode" ) isatty = sys.stdin.isatty() # Delete the REPL command from those available, as we don't want to allow # nesting REPLs (note: pass `None` to `pop` as we don't want to error if # REPL command already not present for some reason). repl_command_name = old_ctx.command.name if isinstance(group_ctx.command, click.CommandCollection): available_commands = { cmd_name: cmd_obj for source in group_ctx.command.sources for cmd_name, cmd_obj in source.commands.items() } else: available_commands = group_ctx.command.commands original_command = available_commands.pop(repl_command_name, None) if isatty: prompt_kwargs = bootstrap_prompt(group, prompt_kwargs, group_ctx) session = PromptSession(**prompt_kwargs) def get_command(): return session.prompt() else: get_command = sys.stdin.readline while True: try: command = get_command() except KeyboardInterrupt: continue except EOFError: break if not command: if isatty: continue else: break try: args = _execute_internal_and_sys_cmds( command, allow_internal_commands, allow_system_commands ) if args is None: continue except CommandLineParserError: continue except ExitReplException: break try: # The group command will dispatch based on args. old_protected_args = group_ctx.protected_args try: > group_ctx.protected_args = args ^^^^^^^^^^^^^^^^^^^^^^^^ E AttributeError: property 'protected_args' of 'Context' object has no setter click_repl/_repl.py:134: AttributeError During handling of the above exception, another exception occurred: capsys = <_pytest.capture.CaptureFixture object at 0xf5f1e4a8> args = ['--option2', 'opt2', 'hi'] expected = 'cli(hi, 1, opt2)\ncli(hi, 1, opt2)\nFoo!\n' @pytest.mark.parametrize( "args, expected", [ (["hi"], "cli(hi, 1, None)\ncli(hi, 1, None)\nFoo!\n"), ( ["--option1", "opt1", "hi"], "cli(hi, opt1, None)\ncli(hi, opt1, None)\nFoo!\n", ), (["--option2", "opt2", "hi"], "cli(hi, 1, opt2)\ncli(hi, 1, opt2)\nFoo!\n"), ( ["--option1", "opt1", "--option2", "opt2", "hi"], "cli(hi, opt1, opt2)\ncli(hi, opt1, opt2)\nFoo!\n", ), ], ) def test_group_with_multiple_optional_args(capsys, args, expected): with pytest.raises(SystemExit): with mock_stdin("foo\n"): > cmd(args=args, prog_name="test_group_with_multiple_args") tests/test_repl.py:137: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/site-packages/click/core.py:1569: in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:1490: in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:1948: in invoke rv = super().invoke(ctx) ^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:1353: in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:907: in invoke return callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/decorators.py:34: in new_func return f(get_current_context(), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tests/test_repl.py:111: in cmd click_repl.repl(ctx) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ old_ctx = , prompt_kwargs = {} allow_system_commands = True, allow_internal_commands = True def repl( old_ctx, prompt_kwargs={}, allow_system_commands=True, allow_internal_commands=True ): """ Start an interactive shell. All subcommands are available in it. :param old_ctx: The current Click context. :param prompt_kwargs: Parameters passed to :py:func:`prompt_toolkit.PromptSession`. If stdin is not a TTY, no prompt will be printed, but only commands read from stdin. """ group_ctx = old_ctx # Switching to the parent context that has a Group as its command # as a Group acts as a CLI for all of its subcommands if old_ctx.parent is not None and not isinstance(old_ctx.command, click.Group): group_ctx = old_ctx.parent group = group_ctx.command # An Optional click.Argument in the CLI Group, that has no value # will consume the first word from the REPL input, causing issues in # executing the command # So, if there's an empty Optional Argument for param in group.params: if ( isinstance(param, click.Argument) and group_ctx.params[param.name] is None and not param.required ): raise InvalidGroupFormat( f"{type(group).__name__} '{group.name}' requires value for " f"an optional argument '{param.name}' in REPL mode" ) isatty = sys.stdin.isatty() # Delete the REPL command from those available, as we don't want to allow # nesting REPLs (note: pass `None` to `pop` as we don't want to error if # REPL command already not present for some reason). repl_command_name = old_ctx.command.name if isinstance(group_ctx.command, click.CommandCollection): available_commands = { cmd_name: cmd_obj for source in group_ctx.command.sources for cmd_name, cmd_obj in source.commands.items() } else: available_commands = group_ctx.command.commands original_command = available_commands.pop(repl_command_name, None) if isatty: prompt_kwargs = bootstrap_prompt(group, prompt_kwargs, group_ctx) session = PromptSession(**prompt_kwargs) def get_command(): return session.prompt() else: get_command = sys.stdin.readline while True: try: command = get_command() except KeyboardInterrupt: continue except EOFError: break if not command: if isatty: continue else: break try: args = _execute_internal_and_sys_cmds( command, allow_internal_commands, allow_system_commands ) if args is None: continue except CommandLineParserError: continue except ExitReplException: break try: # The group command will dispatch based on args. old_protected_args = group_ctx.protected_args try: group_ctx.protected_args = args group.invoke(group_ctx) finally: > group_ctx.protected_args = old_protected_args ^^^^^^^^^^^^^^^^^^^^^^^^ E AttributeError: property 'protected_args' of 'Context' object has no setter click_repl/_repl.py:137: AttributeError ----------------------------- Captured stdout call ----------------------------- cli(hi, 1, opt2) _ test_group_with_multiple_optional_args[args3-cli(hi, opt1, opt2)\ncli(hi, opt1, opt2)\nFoo!\n] _ old_ctx = , prompt_kwargs = {} allow_system_commands = True, allow_internal_commands = True def repl( old_ctx, prompt_kwargs={}, allow_system_commands=True, allow_internal_commands=True ): """ Start an interactive shell. All subcommands are available in it. :param old_ctx: The current Click context. :param prompt_kwargs: Parameters passed to :py:func:`prompt_toolkit.PromptSession`. If stdin is not a TTY, no prompt will be printed, but only commands read from stdin. """ group_ctx = old_ctx # Switching to the parent context that has a Group as its command # as a Group acts as a CLI for all of its subcommands if old_ctx.parent is not None and not isinstance(old_ctx.command, click.Group): group_ctx = old_ctx.parent group = group_ctx.command # An Optional click.Argument in the CLI Group, that has no value # will consume the first word from the REPL input, causing issues in # executing the command # So, if there's an empty Optional Argument for param in group.params: if ( isinstance(param, click.Argument) and group_ctx.params[param.name] is None and not param.required ): raise InvalidGroupFormat( f"{type(group).__name__} '{group.name}' requires value for " f"an optional argument '{param.name}' in REPL mode" ) isatty = sys.stdin.isatty() # Delete the REPL command from those available, as we don't want to allow # nesting REPLs (note: pass `None` to `pop` as we don't want to error if # REPL command already not present for some reason). repl_command_name = old_ctx.command.name if isinstance(group_ctx.command, click.CommandCollection): available_commands = { cmd_name: cmd_obj for source in group_ctx.command.sources for cmd_name, cmd_obj in source.commands.items() } else: available_commands = group_ctx.command.commands original_command = available_commands.pop(repl_command_name, None) if isatty: prompt_kwargs = bootstrap_prompt(group, prompt_kwargs, group_ctx) session = PromptSession(**prompt_kwargs) def get_command(): return session.prompt() else: get_command = sys.stdin.readline while True: try: command = get_command() except KeyboardInterrupt: continue except EOFError: break if not command: if isatty: continue else: break try: args = _execute_internal_and_sys_cmds( command, allow_internal_commands, allow_system_commands ) if args is None: continue except CommandLineParserError: continue except ExitReplException: break try: # The group command will dispatch based on args. old_protected_args = group_ctx.protected_args try: > group_ctx.protected_args = args ^^^^^^^^^^^^^^^^^^^^^^^^ E AttributeError: property 'protected_args' of 'Context' object has no setter click_repl/_repl.py:134: AttributeError During handling of the above exception, another exception occurred: capsys = <_pytest.capture.CaptureFixture object at 0xf5e905d0> args = ['--option1', 'opt1', '--option2', 'opt2', 'hi'] expected = 'cli(hi, opt1, opt2)\ncli(hi, opt1, opt2)\nFoo!\n' @pytest.mark.parametrize( "args, expected", [ (["hi"], "cli(hi, 1, None)\ncli(hi, 1, None)\nFoo!\n"), ( ["--option1", "opt1", "hi"], "cli(hi, opt1, None)\ncli(hi, opt1, None)\nFoo!\n", ), (["--option2", "opt2", "hi"], "cli(hi, 1, opt2)\ncli(hi, 1, opt2)\nFoo!\n"), ( ["--option1", "opt1", "--option2", "opt2", "hi"], "cli(hi, opt1, opt2)\ncli(hi, opt1, opt2)\nFoo!\n", ), ], ) def test_group_with_multiple_optional_args(capsys, args, expected): with pytest.raises(SystemExit): with mock_stdin("foo\n"): > cmd(args=args, prog_name="test_group_with_multiple_args") tests/test_repl.py:137: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/site-packages/click/core.py:1569: in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:1490: in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:1948: in invoke rv = super().invoke(ctx) ^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:1353: in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/core.py:907: in invoke return callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/site-packages/click/decorators.py:34: in new_func return f(get_current_context(), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tests/test_repl.py:111: in cmd click_repl.repl(ctx) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ old_ctx = , prompt_kwargs = {} allow_system_commands = True, allow_internal_commands = True def repl( old_ctx, prompt_kwargs={}, allow_system_commands=True, allow_internal_commands=True ): """ Start an interactive shell. All subcommands are available in it. :param old_ctx: The current Click context. :param prompt_kwargs: Parameters passed to :py:func:`prompt_toolkit.PromptSession`. If stdin is not a TTY, no prompt will be printed, but only commands read from stdin. """ group_ctx = old_ctx # Switching to the parent context that has a Group as its command # as a Group acts as a CLI for all of its subcommands if old_ctx.parent is not None and not isinstance(old_ctx.command, click.Group): group_ctx = old_ctx.parent group = group_ctx.command # An Optional click.Argument in the CLI Group, that has no value # will consume the first word from the REPL input, causing issues in # executing the command # So, if there's an empty Optional Argument for param in group.params: if ( isinstance(param, click.Argument) and group_ctx.params[param.name] is None and not param.required ): raise InvalidGroupFormat( f"{type(group).__name__} '{group.name}' requires value for " f"an optional argument '{param.name}' in REPL mode" ) isatty = sys.stdin.isatty() # Delete the REPL command from those available, as we don't want to allow # nesting REPLs (note: pass `None` to `pop` as we don't want to error if # REPL command already not present for some reason). repl_command_name = old_ctx.command.name if isinstance(group_ctx.command, click.CommandCollection): available_commands = { cmd_name: cmd_obj for source in group_ctx.command.sources for cmd_name, cmd_obj in source.commands.items() } else: available_commands = group_ctx.command.commands original_command = available_commands.pop(repl_command_name, None) if isatty: prompt_kwargs = bootstrap_prompt(group, prompt_kwargs, group_ctx) session = PromptSession(**prompt_kwargs) def get_command(): return session.prompt() else: get_command = sys.stdin.readline while True: try: command = get_command() except KeyboardInterrupt: continue except EOFError: break if not command: if isatty: continue else: break try: args = _execute_internal_and_sys_cmds( command, allow_internal_commands, allow_system_commands ) if args is None: continue except CommandLineParserError: continue except ExitReplException: break try: # The group command will dispatch based on args. old_protected_args = group_ctx.protected_args try: group_ctx.protected_args = args group.invoke(group_ctx) finally: > group_ctx.protected_args = old_protected_args ^^^^^^^^^^^^^^^^^^^^^^^^ E AttributeError: property 'protected_args' of 'Context' object has no setter click_repl/_repl.py:137: AttributeError ----------------------------- Captured stdout call ----------------------------- cli(hi, opt1, opt2) =============================== warnings summary =============================== tests/test_completion/test_click_version_le_7/test_arg_completion_v7.py:16 /usr/src/RPM/BUILD/python3-module-click-repl-0.3.0/tests/test_completion/test_click_version_le_7/test_arg_completion_v7.py:16: DeprecationWarning: The '__version__' attribute is deprecated and will be removed in Click 9.1. Use feature detection or 'importlib.metadata.version("click")' instead. click.__version__[0] > "7", tests/test_completion/test_click_version_le_7/test_arg_completion_v7.py:33 /usr/src/RPM/BUILD/python3-module-click-repl-0.3.0/tests/test_completion/test_click_version_le_7/test_arg_completion_v7.py:33: DeprecationWarning: The '__version__' attribute is deprecated and will be removed in Click 9.1. Use feature detection or 'importlib.metadata.version("click")' instead. click.__version__[0] > "7", tests/test_completion/test_click_version_le_7/test_option_completion_v7.py:16 /usr/src/RPM/BUILD/python3-module-click-repl-0.3.0/tests/test_completion/test_click_version_le_7/test_option_completion_v7.py:16: DeprecationWarning: The '__version__' attribute is deprecated and will be removed in Click 9.1. Use feature detection or 'importlib.metadata.version("click")' instead. click.__version__[0] > "7", tests/test_basic.py: 2 warnings tests/test_command_collection.py: 1 warning tests/test_completion/test_common_tests/test_arg_completion.py: 2 warnings tests/test_completion/test_common_tests/test_hidden_cmd_and_args.py: 3 warnings tests/test_completion/test_common_tests/test_option_completion.py: 2 warnings tests/test_completion/test_path_type/test_path_type.py: 1 warning /usr/src/RPM/BUILD/python3-module-click-repl-0.3.0/click_repl/utils.py:44: DeprecationWarning: 'MultiCommand' is deprecated and will be removed in Click 9.0. Use 'Group' instead. if isinstance(command, click.MultiCommand): tests/test_basic.py: 2 warnings tests/test_command_collection.py: 3 warnings tests/test_completion/test_common_tests/test_arg_completion.py: 3 warnings tests/test_completion/test_common_tests/test_hidden_cmd_and_args.py: 2 warnings tests/test_completion/test_common_tests/test_option_completion.py: 3 warnings tests/test_completion/test_path_type/test_path_type.py: 5 warnings /usr/src/RPM/BUILD/python3-module-click-repl-0.3.0/click_repl/_completer.py:270: DeprecationWarning: 'MultiCommand' is deprecated and will be removed in Click 9.0. Use 'Group' instead. if isinstance(self.ctx_command, click.MultiCommand): tests/test_command_collection.py::test_subcommand_invocation_from_group[c1 -expected1] tests/test_completion/test_common_tests/test_arg_completion.py::test_boolean_arg tests/test_completion/test_common_tests/test_arg_completion.py::test_arg_choices tests/test_completion/test_common_tests/test_option_completion.py::test_option_choices tests/test_completion/test_common_tests/test_option_completion.py::test_boolean_option tests/test_completion/test_path_type/test_path_type.py::test_path_type_arg[path-type-arg -expected0] /usr/src/RPM/BUILD/python3-module-click-repl-0.3.0/click_repl/utils.py:52: DeprecationWarning: 'protected_args' is deprecated and will be removed in Click 9.0. 'args' will contain remaining unparsed tokens. args = ctx.protected_args + ctx.args tests/test_repl.py::test_repl_dispatches_subcommand tests/test_repl.py::test_group_command_called tests/test_repl.py::test_group_argument_with_required_false[args2-foo\n-SystemExit-Foo\n] tests/test_repl.py::test_group_with_multiple_optional_args[args0-cli(hi, 1, None)\ncli(hi, 1, None)\nFoo!\n] tests/test_repl.py::test_group_with_multiple_optional_args[args1-cli(hi, opt1, None)\ncli(hi, opt1, None)\nFoo!\n] tests/test_repl.py::test_group_with_multiple_optional_args[args2-cli(hi, 1, opt2)\ncli(hi, 1, opt2)\nFoo!\n] tests/test_repl.py::test_group_with_multiple_optional_args[args3-cli(hi, opt1, opt2)\ncli(hi, opt1, opt2)\nFoo!\n] /usr/src/RPM/BUILD/python3-module-click-repl-0.3.0/click_repl/_repl.py:132: DeprecationWarning: 'protected_args' is deprecated and will be removed in Click 9.0. 'args' will contain remaining unparsed tokens. old_protected_args = group_ctx.protected_args -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== short test summary info ============================ SKIPPED [1] tests/test_completion/test_click_version_ge_8/test_arg_completion_v8.py:14: click-v8 built-in shell complete is not available, so skipped SKIPPED [1] tests/test_completion/test_click_version_ge_8/test_option_completion_v8.py:14: click-v8 built-in shell complete is not available, so skipped SKIPPED [1] tests/test_completion/test_click_version_le_7/test_arg_completion_v7.py:15: click-v7 old autocomplete function is not available, so skipped SKIPPED [1] tests/test_completion/test_click_version_le_7/test_arg_completion_v7.py:32: click-v7 old autocomplete function is not available, so skipped SKIPPED [1] tests/test_completion/test_click_version_le_7/test_option_completion_v7.py:15: click-v7 old autocomplete function is not available, so skipped FAILED tests/test_basic.py::test_arg_completion - click.exceptions.NoSuchComm... FAILED tests/test_basic.py::test_option_completion[option-cmd -expected0] - c... FAILED tests/test_basic.py::test_option_completion[option-cmd -h-expected1] FAILED tests/test_basic.py::test_option_completion[option-cmd --h-expected2] FAILED tests/test_command_collection.py::test_command_collection - AssertionE... FAILED tests/test_completion/test_common_tests/test_hidden_cmd_and_args.py::test_hidden_option FAILED tests/test_completion/test_common_tests/test_hidden_cmd_and_args.py::test_args_of_hidden_command FAILED tests/test_completion/test_common_tests/test_hidden_cmd_and_args.py::test_completion_multilevel_command FAILED tests/test_repl.py::test_repl_dispatches_subcommand - AttributeError: ... FAILED tests/test_repl.py::test_group_command_called - AttributeError: proper... FAILED tests/test_repl.py::test_group_argument_with_required_false[args2-foo\n-SystemExit-Foo\n] FAILED tests/test_repl.py::test_group_with_multiple_optional_args[args0-cli(hi, 1, None)\ncli(hi, 1, None)\nFoo!\n] FAILED tests/test_repl.py::test_group_with_multiple_optional_args[args1-cli(hi, opt1, None)\ncli(hi, opt1, None)\nFoo!\n] FAILED tests/test_repl.py::test_group_with_multiple_optional_args[args2-cli(hi, 1, opt2)\ncli(hi, 1, opt2)\nFoo!\n] FAILED tests/test_repl.py::test_group_with_multiple_optional_args[args3-cli(hi, opt1, opt2)\ncli(hi, opt1, opt2)\nFoo!\n] ============ 15 failed, 43 passed, 5 skipped, 45 warnings in 0.77s ============= INFO : Command's result: FAILURE INFO : Command's error: Command '['python3', '-m', 'pytest', '-vra', '-o=addopts=']' returned non-zero exit status 1. error: Bad exit status from /usr/src/tmp/rpmb-tmp.8V9BhF (%check) RPM build errors: Bad exit status from /usr/src/tmp/rpmb-tmp.8V9BhF (%check) Command exited with non-zero status 1 2.07user 0.25system 0:02.30elapsed 100%CPU (0avgtext+0avgdata 43176maxresident)k 0inputs+0outputs (0major+98024minor)pagefaults 0swaps hsh-rebuild: rebuild of `python3-module-click-repl-0.3.0-alt2.src.rpm' failed. Command exited with non-zero status 1 3.64user 1.09system 0:10.73elapsed 44%CPU (0avgtext+0avgdata 144368maxresident)k 4320inputs+0outputs (0major+327369minor)pagefaults 0swaps