


















For me this fixed it. Seems that libvcs from system-packages shadows gitconfig from pytest-gitconfig
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -63,7 +63,7 @@ check() {
rm -rf test-env
python -m venv --system-site-packages test-env
test-env/bin/python -m installer "dist/copier-$pkgver-"*.whl
- LC_ALL=C test-env/bin/python -m pytest -k 'not test_types and not test_commit_hooks_respected'
+ LC_ALL=C test-env/bin/python -m pytest -p no:libvcs -k 'not test_types and not test_commit_hooks_respected'
}
package() {
> gitconfig.set({"user.signinkey": "123456", "commit.gpgsign": "true"})
^^^^^^^^^^^^^
E AttributeError: 'PosixPath' object has no attribute 'set'
tests/test_dirty_local.py:110: AttributeError
> gitconfig.set({"user.signinkey": "123456", "commit.gpgsign": "true"})
^^^^^^^^^^^^^
E AttributeError: 'PosixPath' object has no attribute 'set'
tests/test_dirty_local.py:251: AttributeError
The cause for my comment was a recurring message from apdatifier that an update for python-copier is available. But the update failed again and again. Now with a fresh update it works without any more messages regarding python-copier.
@R41zW4z: What commands are you running to build the package and run the check function? python-questionary is already in depends and normally that should be enough for the packages listed there to be also available when check is run.
"Build fails during check() because of missing dependency: ModuleNotFoundError: No module named 'questionary'. Adding python-questionary to checkdepends should fix this."
python-copier failed to build
==> Starting check()...
ImportError while loading conftest '/home/wang1zhen/.cache/paru/clone/python-copier/src/copier/tests/conftest.py'.
tests/conftest.py:16: in <module>
from pytest_gitconfig.plugin import DELETE, GitConfig
E ModuleNotFoundError: No module named 'pytest_gitconfig'
==> ERROR: A failure occurred in check().
Aborting...
error: failed to build 'python-copier-9.11.1-1':
cachyos: paru -Syu
checkdeps arent being loaded? what am i doing wrong?
==> Starting check()...
ImportError while loading conftest '/home/XXX/.cache/paru/clone/python-copier/src/copier/tests/conftest.py'.
tests/conftest.py:14: in <module>
from pytest_gitconfig.plugin import DELETE, GitConfig
E ModuleNotFoundError: No module named 'pytest_gitconfig'
==> ERROR: A failure occurred in check().
Aborting...
error: failed to build 'python-copier-9.7.1-1':
error: packages failed to build: python-copier-9.7.1-1
checkdepends=(
'python-pexpect'
'python-poethepoet'
'python-pytest'
'python-pytest-cov'
'python-pytest-gitconfig'
'python-pytest-xdist'
)
The tests fail because of argument parser help output i18n. Building with LC_ALL=C makepkg makes the test pass.
The check function also fails when the package has already been built before and the src directory exists.
In summary, adding the following to check() fixes both issues:
check() {
cd copier
export LC_ALL=C
rm -rf test-env
...
}
Crashes on tests and won't install.
The same goes for python-copier-templates-extensions.
SKIPPED [1] tests/test_prompt.py:544: TODO: fix this
XFAIL tests/test_updatediff.py::test_update_needs_more_context[True-1] - Not enough context lines to resolve the conflict.
XFAIL tests/test_updatediff.py::test_update_needs_more_context[True-2] - Not enough context lines to resolve the conflict.
XFAIL tests/test_updatediff.py::test_update_needs_more_context[False-1] - Not enough context lines to resolve the conflict.
XFAIL tests/test_updatediff.py::test_update_needs_more_context[False-2] - Not enough context lines to resolve the conflict.
FAILED tests/test_cli.py::test_help - AssertionError: assert 'copier copy [SWITCHES] template_src destination_path' in 'copier 9.1.1\n\nCreate a new project from a template.\n\nDocs in https://copier.readthedocs.io/\n\nWAR...
FAILED tests/test_cli.py::test_copy_help - AssertionError: assert 'copier copy [SWITCHES] template_src destination_path' in 'copier copy 9.1.1\n\nCopy from a template source to a destination.\n\nИспользование:\n copier copy ...
FAILED tests/test_cli.py::test_update_help - AssertionError: assert 'copier update [SWITCHES] [destination_path=.]' in 'copier update 9.1.1\n\nUpdate a subproject from its original template\n\nThe copy must have a valid answers f...
======================================================== 3 failed, 783 passed, 1 skipped, 4 xfailed, 6 warnings in 110.08s (0:01:50) ========================================================
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。
The testing issue was resolved in python-libvcs 0.41.0.