Python coverage is 0% on Windows: project virtualenv is only looked up at .venv/bin/python
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start in _python_executable in src/crapper/runners.py, where the candidate interpreter paths are listed; the fallback to python3 and the warning that coverage is missing are there too. Add the Windows venv locations (.venv/Scripts/python.exe, venv/Scripts/python.exe) and change the fallback on os.name == "nt" to sys.executable or python. The issue also notes the ./crapper launcher hard-codes python3 and .venv/bin/python; treat that as a separate, optional follow-up. Done means running crapper src on Windows picks up the project venv and reports non-zero Python coverage instead of the Store alias warning.
Written by the indexing model from the issue text.
Description
On Windows, a virtualenv puts its interpreter at .venv\Scripts\python.exe, not .venv/bin/python. _python_executable in src/crapper/runners.py only checks .venv/bin/python and venv/bin/python, then falls back to python3. On a stock Windows install, python3 is the Microsoft Store alias, which only prints an "install from the Store" message. Coverage never runs, and every Python function scores 0% coverage.
Repro (Windows 11, Git Bash, Python 3.14, crapper c757ec7)
- A small pytest project with
.venvcreated bypython -m venv .venvand withpytestandcoverageinstalled in it. - Run
crapper src. - stderr prints the Store alias message and "coverage is missing … Python coverage will score 0%". Every row shows
0.0%.
Expected: coverage measured with the project's venv.
Workaround: generate target/coverage/python/lcov.info by hand and pass --use-existing-coverage. That gives correct numbers.
Possible fix: also check .venv/Scripts/python.exe and venv/Scripts/python.exe. When neither exists, fall back to sys.executable (or python) instead of python3 on os.name == "nt".
A related detail: the ./crapper launcher script uses python3 and .venv/bin/python, so on Windows the tool has to be installed by hand with python -m venv .venv && .venv/Scripts/python -m pip install -e ..
- Dominant language
- Python
- Stars
- 255
- Forks
- 101
- Avg merge
- 7m
- Merged PRs (30d)
- 4
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from unclebob/crapper
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Functions missing from the coverage report score 0% with no warningPossibly taken @warxhead1 claimed this 14 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
All issues in unclebob/crapper
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
AIR-Bench Foundation reads the first letter of the word after "answer" as the model's choicePossibly taken @beartester34 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
modelscope/evalscope#2330 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Distribution plot crashes when a numeric feature is constant in the train or test setPossibly taken @adembilge claimed this today. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
MAIF/shapash#847 · 1 comment ·
Maintainers usually reply within 10 days