https://pantsbuild.org/ logo
#general
Title
# general
n

narrow-activity-17405

12/10/2020, 3:30 PM
I used to have
Copy code
[test]
use_coverage = true
in my pants.toml but after update to Pants 2.2.0.dev1 my integration tests (using runtime_package_dependencies) started failing with
Copy code
pytest-cov: Failed to setup subprocess coverage. Environ: {'COV_CORE_SOURCE': '.', 'COV_CORE_CONFIG': '/tmp/process-executionN7mCSU/.coveragerc', 'COV_CORE_DATAFILE': '/tmp/process-executionN7mCSU/.coverage'} Exception: CoverageException("Unrecognized option '[run] relative_files=' in config file /tmp/process-executionN7mCSU/.coveragerc")
pytest-cov: Failed to setup subprocess coverage. Environ: {'COV_CORE_SOURCE': '.', 'COV_CORE_CONFIG': '/tmp/process-executionN7mCSU/.coveragerc', 'COV_CORE_DATAFILE': '/tmp/process-executionN7mCSU/.coverage'} Exception: CoverageException("Unrecognized option '[run] relative_files=' in config file /tmp/process-executionN7mCSU/.coveragerc")
Traceback (most recent call last):
  File "/tmp/process-executionN7mCSU/src.python.arcor2_mocks.scripts/mock_scene.pex/.bootstrap/pex/pex.py", line 444, in execute
  File "/tmp/process-executionN7mCSU/src.python.arcor2_mocks.scripts/mock_scene.pex/.bootstrap/pex/pex.py", line 103, in _activate
  File "/tmp/process-executionN7mCSU/src.python.arcor2_mocks.scripts/mock_scene.pex/.bootstrap/pex/environment.py", line 260, in activate
  File "/tmp/process-executionN7mCSU/src.python.arcor2_mocks.scripts/mock_scene.pex/.bootstrap/pex/environment.py", line 425, in _activate
  File "/tmp/process-executionN7mCSU/src.python.arcor2_mocks.scripts/mock_scene.pex/.bootstrap/pex/environment.py", line 160, in _update_module_paths
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named '__mp_main__'
When I remove
use_coverage
from pants.toml, it works ok again. Any idea?
h

hundreds-father-404

12/10/2020, 5:29 PM
Huh, it complains about
relative_files=
being an unrecognized option in coveragerc. Thus, I suspect coverage is failing to be set up. That's fishy. I'm OOO so am not able to look much more closely, but my hunch is that's the issue. Might be helpful to double check if you've override the coverage version, and GitHub to see if any changes to backend/python/goals include coverage changes
f

fast-nail-55400

12/10/2020, 5:35 PM
To follow up on Eric’s message, does your pants.toml set the `--coverage-py-version`option?
(if so, what is its value?)
n

narrow-activity-17405

12/10/2020, 8:31 PM
@fast-nail-55400 I'm not setting this option. The pants.toml can be found here: https://github.com/robofit/arcor2/blob/master/pants.toml
Should I explicitly set the coverage version?
f

fast-nail-55400

12/10/2020, 8:36 PM
The default requirement sets it to
coverage>=5.0.3,<5.1
, I’d more interested to not what version of coverage was resolved.
which would be useful to know as we could check when the
relative_files
option was added to coverage. Their website marks it as “experimental”
h

hundreds-father-404

12/10/2020, 8:40 PM
If [coverage].version is not set, then that’s probably a red herring. Pants uses Coverage 5, so that option should work It also looks like they’re not using a custom .coverage.rc, so this shouldn’t be an issue with how the config file is set up. Instead, Pants should be generating a coveragerc file with that one option Tom (or others), if you have a chance, may help to clone Zdeněk’s repo and use
./pants_from_sources
to check some things like that the contents of the coverage file are what we expect
f

fast-nail-55400

12/10/2020, 9:18 PM
I’ve cloned the repo locally and am attempting to reproduce the issue.
I can’t build the project due to failing to build a wheel:
Failed building wheel for pyk4a
lots of C/C++ compile errors
n

narrow-activity-17405

12/14/2020, 2:32 PM
Unfortunately, it is necessary to install some system dependencies (there is build-support/install_kinect_prerequisites.sh script for that) or you can remove
arcor2_kinect_azure
package which requires this.
6 Views