I’ve got a pytest lockfile question… seems like it...
# general
c
I’ve got a pytest lockfile question… seems like it fails to generate lockfile for me when I have
interpreter_constraints = [">=3.8.*"]
in my
pants.toml
. [SOLVED]
I get this, then:
Copy code
Exception message: 1 Exception encountered:

  ProcessExecutionFailure: Process 'Generate lockfile for pytest' failed with exit code 1.
stdout:
Creating virtualenv pants-lockfile-generation-PBLaiCgC-py3.8 in /Users/aadt/Library/Caches/pypoetry/virtualenvs
Updating dependencies
Resolving dependencies...

  SolverProblemError

  The current project's Python requirement (>=3.8) is not compatible with some of the required packages Python requirement:
    - coverage requires Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4, so it will not be satisfied for Python >=4
    - coverage requires Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4, so it will not be satisfied for Python >=4
    - coverage requires Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4, so it will not be satisfied for Python >=4
    - coverage requires Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4, so it will not be satisfied for Python >=4
    - coverage requires Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4, so it will not be satisfied for Python >=4
  
  Because no versions of coverage match >5.2.1,<5.3 || >5.3,<5.3.1 || >5.3.1,<5.4 || >5.4,<5.5 || >5.5
   and coverage (5.2.1) requires Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4, coverage is forbidden.
  And because coverage (5.3) requires Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4
   and coverage (5.3.1) requires Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4, coverage is forbidden.
  And because coverage (5.4) requires Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4
   and coverage (5.5) requires Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4, coverage is forbidden.
  Because no versions of pytest-cov match >2.12.1,<2.13
   and pytest-cov (2.12.1) depends on coverage (>=5.2.1), pytest-cov (>=2.12.1,<2.13) requires coverage (>=5.2.1).
  Thus, pytest-cov is forbidden.
  So, because pants-lockfile-generation depends on pytest-cov (<2.13,>=2.12.1), version solving failed.

  at ~/.cache/pants/named_caches/pex_root/venvs/short/b6b1d4a7/lib/python3.8/site-packages/poetry/puzzle/solver.py:241 in _solve
      237│             packages = result.packages
      238│         except OverrideNeeded as e:
      239│             return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
      240│         except SolveFailure as e:
    → 241│             raise SolverProblemError(e)
      242│ 
      243│         results = dict(
      244│             depth_first_search(
      245│                 PackageNode(self._package, packages), aggregate_package_nodes

  • Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties
    
    For coverage, a possible solution would be to set the `python` property to ">=3.8,<4"
    For coverage, a possible solution would be to set the `python` property to ">=3.8,<4"
    For coverage, a possible solution would be to set the `python` property to ">=3.8,<4"
    For coverage, a possible solution would be to set the `python` property to ">=3.8,<4"
    For coverage, a possible solution would be to set the `python` property to ">=3.8,<4"

    <https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies>,
    <https://python-poetry.org/docs/dependency-specification/#using-environment-markers>
where as when I comment the IC out, it works…
h
Set to
'>=3.8,<4'
Idk how to make that error better because it's confusing that it comes from Poetry so gives non-Pants specific advice Earlier I proposed that Pants ~try/catch errors from tools and try to augment with Pants-specific info. Maybe that'd help here? We never got around to that
c
Ah, the comma, I tried a few variations, but failed to try that one.
Well, I actually was trying with the above, so I got pretty close, just didn’t have the syntax right.
heh, I see now there is a comma in the err output too, 😛
Thanks.
❤️ 1