freezing-area-97131
03/29/2022, 6:57 AM1.17.0
. Now I am at 1.23.0
, and I ran into this error when running ./pants test
, which I have encountered before and solved by specifying the version of coverage
under [pytest]
in pants.ini
.
No cached artifacts for 254 targets.
Invalidated 254 targets.06:44:34 [WARN] /home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.23.0_py36/lib/python3.6/site-packages/pants/backend/python/tasks/pytest_prep.py:92: DeprecationWarning: DEPRECATED: Pants defaulting to a Python 2-compatible Pytest version will be removed in version 1.25.0.dev2.
Pants will soon start defaulting to Pytest 5.x, which no longer supports running tests with Python 2. In preparation for this change, you should explicitly set what version of Pytest to use in your `pants.ini` under the section `pytest`.
If you need to keep running tests with Python 2, set `version` to `pytest>=4.6.6,<4.7` (the current default). If you don't have any tests with Python 2 and want the newest Pytest, set `version` to `pytest>=5.2.4`.
return PyTest.global_instance().get_requirement_strings()
06:44:34 [WARN] /home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.23.0_py36/lib/python3.6/site-packages/pants/backend/python/tasks/pytest_prep.py:92: DeprecationWarning: DEPRECATED: Pants defaulting to a Python 2-compatible Pytest version will be removed in version 1.25.0.dev2.
Pants will soon start defaulting to Pytest 5.x, which no longer supports running tests with Python 2. In preparation for this change, you should explicitly set what version of Pytest to use in your `pants.ini` under the section `pytest`.
If you need to keep running tests with Python 2, set `version` to `pytest>=4.6.6,<4.7` (the current default). If you don't have any tests with Python 2 and want the newest Pytest, set `version` to `pytest>=5.2.4`.
return PyTest.global_instance().get_requirement_strings()
**** Failed to install coverage-6.3.2 (caused by: NonZeroExit("received exit code 1 during execution of `['/usr/bin/python2.7', '-s', '-', 'bdist_wheel', '--dist-dir=/tmp/tmp8zl5tznp']` while trying to execute `['/usr/bin/python2.7', '-s', '-', 'bdist_wheel', '--dist-dir=/tmp/tmp8zl5tznp']`",)
):
stdout:
stderr:
Traceback (most recent call last):
File "<stdin>", line 14, in <module>
File "<string>", line 80
classifier_list.append(f"Development Status :: {devstat}")
^
SyntaxError: invalid syntax
Waiting for background workers to finish.
23:44:37 00:47 [complete]
FAILURE
ERROR: Package SourcePackage('file:///home/cedriczheng/myrepo/.pants.d/python-setup/resolved_requirements/CPython-2.7.12/coverage-6.3.2.tar.gz') is not translateable by ChainedTranslator(WheelTranslator, EggTranslator, SourceTranslator)
(Use --print-exception-stacktrace to see more error details.)
But in previous version (1.22 or 1.21), the instructions suggested me to remove those settings. If I put them back, I will get this error instead:
23:51:52 00:04 [complete]
FAILURE
ERROR: Could not satisfy all requirements for coverage==5.0.3:
coverage==5.0.3, coverage>=5.2.1(from: pytest-cov<3,>=2.8.1)
I don’t know what to do now…happy-kitchen-89482
03/29/2022, 1:45 PMcoverage-6.3.2
uses f-strings in its setup.py, so it cannot run on python 2.7.happy-kitchen-89482
03/29/2022, 1:45 PMhappy-kitchen-89482
03/29/2022, 1:45 PMcoverage==5.0.3
it looks likehappy-kitchen-89482
03/29/2022, 1:47 PMcoverage>=5.2.1
requirement of the version of pytest-cov
you're usinghappy-kitchen-89482
03/29/2022, 1:48 PMcoverage==5.2.1
still works on Python 2.7, so you can try pinning to that instead of to 5.0.3freezing-area-97131
03/29/2022, 1:54 PMfreezing-area-97131
03/29/2022, 2:15 PMNo cached artifacts for 254 targets.
Invalidated 254 targets.14:03:36 [WARN] /home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.23.0_py36/lib/python3.6/site-packages/pex/pep425tags.py:274: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
**** Failed to install importlib_metadata-4.11.3 (caused by: NonZeroExit("received exit code 1 during execution of `['/usr/bin/python2.7', '-s', '-', 'bdist_wheel', '--dist-dir=/tmp/tmpwfro9psz']` while trying to execute `['/usr/bin/python2.7', '-s', '-', 'bdist_wheel', '--dist-dir=/tmp/tmpwfro9psz']`",)
):
stdout:
stderr:
Traceback (most recent call last):
File "<stdin>", line 13, in <module>
IOError: [Errno 2] No such file or directory: 'setup.py'
Waiting for background workers to finish.
07:03:38 00:04 [complete]
FAILURE
happy-kitchen-89482
03/29/2022, 2:25 PMhappy-kitchen-89482
03/29/2022, 2:26 PMfreezing-area-97131
03/29/2022, 2:28 PMNo cached artifacts for 71 targets.
Invalidated 71 targets.14:25:12 [WARN] /home/cedriczheng/.cache/pants/setup/bootstrap-Linux-x86_64/1.23.0_py36/lib/python3.6/site-packages/pex/pep425tags.py:274: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
freezing-area-97131
03/29/2022, 2:36 PMpython_requirement_library(
name='importlib',
dependencies=[
':importlib-metadata',
],
)
freezing-area-97131
03/30/2022, 12:16 AMimportlib-metadata==2.1.3
in requirement.txt but it still failed. Not sure what’s the correct way to pin the version.