Skip to content

report.py Tries to parse non-existent files #1392

Closed as not planned
Closed as not planned
@adam-grant-hendry

Description

@adam-grant-hendry

Describe the bug

After uninstalling PyQt5 and installing PySide6 in my virtual environment (using poetry add/remove), coverage reports warnings that it cannot parse some non-existent files. It is looking for site-packages pyscript, shibokensupport, and signature_bootstrap.py as if they are in my local folder, when they are actually in my .venv/Lib/site-packages folder:

myproj\.venv\lib\site-packages\coverage\report.py:87: CoverageWarning: Couldn't parse 'Myproj\pyscript': No source for code: 'Myproj\pyscript'. (couldnt-parse)
  coverage._warn(msg, slug="couldnt-parse")
myproj\.venv\lib\site-packages\coverage\report.py:87: CoverageWarning: Couldn't parse 'Myproj\shibokensupport\__init__.py': No source for code: 'Myproj\shibokensupport\__init__.py'. (couldnt-parse)
  coverage._warn(msg, slug="couldnt-parse")
myproj\.venv\lib\site-packages\coverage\report.py:87: CoverageWarning: Couldn't parse 'Myproj\shibokensupport\feature.py': No source for code: 'Myproj\shibokensupport\feature.py'. (couldnt-parse)
  coverage._warn(msg, slug="couldnt-parse")
myproj\.venv\lib\site-packages\coverage\report.py:87: CoverageWarning: Couldn't parse 'Myproj\shibokensupport\signature\__init__.py': No source for code: 'Myproj\shibokensupport\signature\__init__.py'. (couldnt-parse)
  coverage._warn(msg, slug="couldnt-parse")
myproj\.venv\lib\site-packages\coverage\report.py:87: CoverageWarning: Couldn't parse 'Myproj\shibokensupport\signature\errorhandler.py': No source for code: 'Myproj\shibokensupport\signature\errorhandler.py'. (couldnt-parse)
  coverage._warn(msg, slug="couldnt-parse")
myproj\.venv\lib\site-packages\coverage\report.py:87: CoverageWarning: Couldn't parse 'Myproj\shibokensupport\signature\importhandler.py': No source for code: 'Myproj\shibokensupport\signature\importhandler.py'. (couldnt-parse)
  coverage._warn(msg, slug="couldnt-parse")
myproj\.venv\lib\site-packages\coverage\report.py:87: CoverageWarning: Couldn't parse 'Myproj\shibokensupport\signature\layout.py': No source for code: 'Myproj\shibokensupport\signature\layout.py'. (couldnt-parse)
  coverage._warn(msg, slug="couldnt-parse")
myproj\.venv\lib\site-packages\coverage\report.py:87: CoverageWarning: Couldn't parse 'Myproj\shibokensupport\signature\lib\__init__.py': No source for code: 'Myproj\shibokensupport\signature\lib\__init__.py'. (couldnt-parse)
  coverage._warn(msg, slug="couldnt-parse")
myproj\.venv\lib\site-packages\coverage\report.py:87: CoverageWarning: Couldn't parse 'Myproj\shibokensupport\signature\lib\enum_sig.py': No source for code: 'Myproj\shibokensupport\signature\lib\enum_sig.py'. (couldnt-parse)
  coverage._warn(msg, slug="couldnt-parse")
myproj\.venv\lib\site-packages\coverage\report.py:87: CoverageWarning: Couldn't parse 'Myproj\shibokensupport\signature\lib\pyi_generator.py': No source for code: 'Myproj\shibokensupport\signature\lib\pyi_generator.py'. (couldnt-parse)
  coverage._warn(msg, slug="couldnt-parse")
myproj\.venv\lib\site-packages\coverage\report.py:87: CoverageWarning: Couldn't parse 'Myproj\shibokensupport\signature\lib\tool.py': No source for code: 'Myproj\shibokensupport\signature\lib\tool.py'. (couldnt-parse)
  coverage._warn(msg, slug="couldnt-parse")
myproj\.venv\lib\site-packages\coverage\report.py:87: CoverageWarning: Couldn't parse 'Myproj\shibokensupport\signature\loader.py': No source for code: 'Myproj\shibokensupport\signature\loader.py'. (couldnt-parse)
  coverage._warn(msg, slug="couldnt-parse")
myproj\.venv\lib\site-packages\coverage\report.py:87: CoverageWarning: Couldn't parse 'Myproj\shibokensupport\signature\mapping.py': No source for code: 'Myproj\shibokensupport\signature\mapping.py'. (couldnt-parse)
  coverage._warn(msg, slug="couldnt-parse")
myproj\.venv\lib\site-packages\coverage\report.py:87: CoverageWarning: Couldn't parse 'Myproj\shibokensupport\signature\parser.py': No source for code: 'Myproj\shibokensupport\signature\parser.py'. (couldnt-parse)
  coverage._warn(msg, slug="couldnt-parse")
myproj\.venv\lib\site-packages\coverage\report.py:87: CoverageWarning: Couldn't parse 'Myproj\signature_bootstrap.py': No source for code: 'Myproj\signature_bootstrap.py'. (couldnt-parse)       
  coverage._warn(msg, slug="couldnt-parse")

To Reproduce
How can we reproduce the problem? Please be specific. Don't link to a failing CI job. Answer the questions below:

  1. What version of Python are you using? 3.8.10
  2. What version of coverage.py shows the problem? The output of coverage debug sys is helpful. 6.4
  3. What versions of what packages do you have installed? The output of pip freeze is helpful.
[tool.poetry.dependencies]
appdirs = "^1.4.4"
h5py = "^3.6.0"
hypothesis = "^6.46.2"
ipython = "^8.3.0"
matplotlib = "^3.5.2"
merry = "^0.3.0"
meshio = "^5.3.4"
ninja = "^1.10.2"
numpy = "^1.22.3"
opencv-python = "^4.5.5.64"
pyembree = "^0.2.11"
pykdtree = "^1.3.4"
pymeshfix = "^0.15.0"
pyqtgraph = "^0.12.4"
PySide6 = "^6.3.0"
pytest-xdist = "^2.5.0"
python = "3.8"
pyvista = "^0.34.1"
pyvistaqt = "^0.9.0"
QtPy = "^2.1.0"
Rtree = "^1.0.0"
trimesh = "^3.11.2"
vtk = "^9.1.0"

[tool.poetry.dev-dependencies]
bandit = {extras = ["toml"], version = "^1.7.4"}
beautifulsoup4 = "4.11.1"
black = "^22.3.0"
bump2version = "^1.0.1"
check-jsonschema = "^0.14.3"
codecov = "^2.1.12"
codespell = "^2.1.0"
commitizen = "^2.27.0"
Cython = "^0.29.28"
docformatter = "^1.4"
flake8 = "^4.0.1"
flake8-docstrings = "^1.6.0"
flake8-quotes = "^3.3.1"
html5lib = "^1.1"
isort = "^5.10.1"
lxml = "^4.8.0"
memory-profiler = "^0.60.0"
MonkeyType = "^22.2.0"
mypy = "^0.950"
myst-parser = "^0.17.2"
pep8-naming = "^0.12.1"
pre-commit = "^2.18.1"
pydocstyle = "^6.1.1"
pyinstaller = "^5.1"
pylint = "^2.13.8"
pytest = "^7.1.2"
pytest-doctestplus = "^0.12.0"
pytest-env = "^0.6.2"
pytest-memprof = "^0.2.0"
pytest-qt = "^4.0.2"
pytest-randomly = "^3.11.0"
requests = "^2.27.1"
rstcheck = "^5.0.0"
Sphinx = "^4.5.0"
sphinx-rtd-theme = "^1.0.0"
sphinxcontrib-email = "^0.3.5"
sphinxcontrib-napoleon = "^0.7"
toml = "^0.10.2"
tox = "^3.25.0"
tqdm = "^4.64.0"
vulture = "^2.3"
wheel = "^0.37.1"
pytest-cov = "^3.0.0"
coverage = {extras = ["toml"], version = "^6.4"}
  1. What code shows the problem? Give us a specific commit of a specific repo that we can check out. If you've already worked around the problem, please provide a commit before that fix.
    Not a specific code example as this is an internal warning.

  2. What commands did you run?

pytest --cov --cov-report term-missing --cov-report html --cov-report xml

Expected behavior
A clear and concise description of what you expected to happen.
These warnings should not occur because these are non-existent file paths.

Additional context
Add any other context about the problem here.

I deleted every single __pycache__ and *.pyc, as well as the .coverage file in the project, but the problem persists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions