I'm randomly getting this error when trying to gen...
# general
a
I'm randomly getting this error when trying to generate coverage in my repo - can somebody explain to me what this means?
Copy code
stderr:
Failed to resolve compatible artifacts from lock tools.lock for 1 target:
1. /opt/pyenv/versions/3.8.20/bin/python3.8:
    Failed to resolve all requirements for cp38-cp38-manylinux_2_27_x86_64 interpreter at /opt/pyenv/versions/3.8.20/bin/python3.8 from tools.lock:
Configured with:
    build: True
    use_wheel: True
Dependency on exceptiongroup (via: pytest -> exceptiongroup>=1.0.0rc8; python_version < "3.11") not satisfied, no candidates found.
Dependency on tomli not satisfied, no candidates found:
    requirers:
    via: pytest -> tomli>=1; python_version < "3.11"
    via: pytest-cov -> coverage[toml]>=5.2.1 -> tomli; python_full_version <= "3.11.0a6" and extra == "toml"
Dependency on coverage not satisfied, 1 incompatible candidate found:
1.) coverage 7.6.2 (via: pytest-cov -> coverage[toml]>=5.2.1) requires Python >=3.9
I've tried my tools lockfile with Pythons from 3.8->3.12 all with the same result.
e
Has this been working previously, or not at all? It does look like this current log was from trying with python 3.8 and coverage is asking for >=3.9. What does it give as the issue when you run with a higher python version?
a
Figured it out, it looks like coverage >6.x does not support Python 3.8 and the lockfile doesn't automatically pull down these requirements only needed for specific versions, so they have to be included explicitly. I think errors for versions >3.8 was me misinterpreting the output because I have lots of tests parametrized for different Python versions.
c
Figured it out, it looks like coverage >6.x does not support Python 3.8 and the lockfile doesn't automatically pull down these
This is with the bundled with Pants coverage lockfile, or your own?
a
My own, but the one bundled with Pants does not support some newer Python syntax. Namely multi-with context managers (
with a() as b, c() as d:
) and the
match
statement.
Also I was wrong about which versions support Python 3.8, 7.6.1 is the last release that supports 3.8 and seems to be the sweet spot of "supports 3.8 and newer Python syntax."