https://pantsbuild.org/ logo
h

helpful-jackal-12093

10/14/2021, 11:03 AM
Does
pants
handle packages installed from VCS? It seems I’m always getting a stack trace during the parsing of the
poetry.lock
file when
pants
reaches a dependency that is installed from a VCS:
Copy code
14:02:18.06 [ERROR] Exception caught: (pants.engine.internals.scheduler.ExecutionError)
  File "/Users/jbasila/.cache/pants/setup/bootstrap-Darwin-x86_64/pants.czNsHH/install/lib/python3.9/site-packages/pants/bin/local_pants_runner.py", line 236, in _run_inner
    return self._perform_run(goals)
  File "/Users/jbasila/.cache/pants/setup/bootstrap-Darwin-x86_64/pants.czNsHH/install/lib/python3.9/site-packages/pants/bin/local_pants_runner.py", line 175, in _perform_run
    return self._perform_run_body(goals, poll=False)
  File "/Users/jbasila/.cache/pants/setup/bootstrap-Darwin-x86_64/pants.czNsHH/install/lib/python3.9/site-packages/pants/bin/local_pants_runner.py", line 192, in _perform_run_body
    return self.graph_session.run_goal_rules(
  File "/Users/jbasila/.cache/pants/setup/bootstrap-Darwin-x86_64/pants.czNsHH/install/lib/python3.9/site-packages/pants/init/engine_initializer.py", line 135, in run_goal_rules
    exit_code = self.scheduler_session.run_goal_rule(
  File "/Users/jbasila/.cache/pants/setup/bootstrap-Darwin-x86_64/pants.czNsHH/install/lib/python3.9/site-packages/pants/engine/internals/scheduler.py", line 538, in run_goal_rule
    self._raise_on_error([t for _, t in throws])
  File "/Users/jbasila/.cache/pants/setup/bootstrap-Darwin-x86_64/pants.czNsHH/install/lib/python3.9/site-packages/pants/engine/internals/scheduler.py", line 506, in _raise_on_error
    raise ExecutionError(

Exception message: 1 Exception encountered:

  MappingError: Failed to parse BUILD:
Invalid URL: git+git@github.com:ourrepo/somerepo.git#1112223334354322362625662
I have tried to also convert the file to a
requirements.txt
but still I get the same result. What did I miss?
c

curved-television-6568

10/14/2021, 11:51 AM
p

polite-garden-50641

10/14/2021, 2:25 PM
@happy-kitchen-89482 fyi , very similar issue to what I mentioned yesterday
h

happy-kitchen-89482

10/14/2021, 3:37 PM
Yep, am looking at this
h

helpful-jackal-12093

10/14/2021, 3:55 PM
yes indeed - I’m not sure how to overcome this with poetry, but I exported the poetry to a requirements.txt file (and it seems by default it includes hashes which also crash the poetry so I removed them) it worked just fine.
h

happy-kitchen-89482

10/14/2021, 4:59 PM
@helpful-jackal-12093 are you blocked on this, or it sounds like you have a workaround?
We don't support those old-style VCS urls because the standard pkg_resources.Requirement doesn't
it fails to parse them, so we do as well
possibly we could preprocess them somehow
h

helpful-jackal-12093

10/14/2021, 5:03 PM
I’m not blocked on this - I’m currently exporting things to requirements.txt without hashes --- BTW: it would have been nice if poetry fails due to the old style VCS to point the user to the documentation of poetry itself, it would really help - but not a must
h

hundreds-father-404

10/14/2021, 5:05 PM
John, are you able to share how you set that problematic requirement in
pyproject.toml
? FYI,
poetry_requirements
is not looking at
poetry.lock
at all. It instead parses
pyproject.toml
and convert's Poetry's properitaty format to the standard
pkg_resources.Requirement
. I think that you have an edge case our parsing code fails to handle
p

polite-garden-50641

10/14/2021, 5:36 PM
As a data point , pip tools (specifically, pip-compile )does the same thing even when the proper base requirement is provided , see https://github.com/PostHog/posthog/pull/5864
h

helpful-jackal-12093

10/14/2021, 6:26 PM
@hundreds-father-404 - yes I know - here is a sample line:
Copy code
sonar-parser = {git = "git@github.com:orcasecurity/sonar-parser.git", rev = "76668d3c681dd0bcfd049063a3b5d83819309bdc"}
Taken from pyproject.toml
👍 1
@hundreds-father-404 Just a followup - will this be addressed? was an issue opened? Would you like me to open an issue?
h

happy-kitchen-89482

10/21/2021, 2:34 PM
If you could open an issue that would be great!
3 Views