Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't add local packages with git dependencies #2649

Closed
3 tasks done
brain4power opened this issue Jul 10, 2020 · 2 comments
Closed
3 tasks done

can't add local packages with git dependencies #2649

brain4power opened this issue Jul 10, 2020 · 2 comments
Labels
kind/bug Something isn't working as expected

Comments

@brain4power
Copy link

brain4power commented Jul 10, 2020

  • I am on the latest Poetry version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: MacOS Catalina 10.15.5.

  • Poetry version: 1.0.9

  • **my pyproject.toml file

Issue

I downloaded the lamb package to my computer. Trying:
poetry add ../lamb -vvv
getting an error:

[RuntimeError]
Unable to retrieve the package version for /var/folders/r1/65bwz63x3dd_zcr5vnrgm7m80000gn/T/pypoetry-git-dpath-pythonmqyoos_1

with praceback:

  File "/Users/user/.poetry/lib/poetry/_vendor/py3.6/clikit/console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "/Users/user/.poetry/lib/poetry/_vendor/py3.6/clikit/api/command/command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "/Users/user/.poetry/lib/poetry/_vendor/py3.6/clikit/api/command/command.py", line 171, in _do_handle
    return getattr(handler, handler_method)(args, io, self)
  File "/Users/user/.poetry/lib/poetry/_vendor/py3.6/cleo/commands/command.py", line 92, in wrap_handle
    return self.handle()
  File "/Users/user/.poetry/lib/poetry/console/commands/add.py", line 149, in handle
    status = installer.run()
  File "/Users/user/.poetry/lib/poetry/installation/installer.py", line 74, in run
    self._do_install(local_repo)
  File "/Users/user/.poetry/lib/poetry/installation/installer.py", line 161, in _do_install
    ops = solver.solve(use_latest=self._whitelist)
  File "/Users/user/.poetry/lib/poetry/puzzle/solver.py", line 36, in solve
    packages, depths = self._solve(use_latest=use_latest)
  File "/Users/user/.poetry/lib/poetry/puzzle/solver.py", line 181, in _solve
    self._package, self._provider, locked=locked, use_latest=use_latest
  File "/Users/user/.poetry/lib/poetry/mixology/__init__.py", line 7, in resolve_version
    return solver.solve()
  File "/Users/user/.poetry/lib/poetry/mixology/version_solver.py", line 80, in solve
    next = self._choose_package_version()
  File "/Users/user/.poetry/lib/poetry/mixology/version_solver.py", line 388, in _choose_package_version
    version = self._provider.complete_package(version)
  File "/Users/user/.poetry/lib/poetry/puzzle/provider.py", line 601, in complete_package
    self.search_for_vcs(r)
  File "/Users/user/.poetry/lib/poetry/puzzle/provider.py", line 175, in search_for_vcs
    name=dependency.name,
  File "/Users/user/.poetry/lib/poetry/puzzle/provider.py", line 213, in get_package_from_vcs
    package = cls.get_package_from_directory(tmp_dir, name=name)
  File "/Users/user/.poetry/lib/poetry/puzzle/provider.py", line 374, in get_package_from_directory
    directory

trying to fix that and edit dpath dependence at setup.py:

install_requires=[
        ...
        'dpath @ git+https://git@github.com/MrJuicyBacon/dpath-python@2.0.1#egg=dpath',
       ...

]

trying again poetry add ../lamb -vvv
getting an error:

[CalledProcessError]
Command '['git', '--git-dir', '/var/folders/r1/65bwz63x3dd_zcr5vnrgm7m80000gn/T/pypoetry-git-dpath-pythonfffloo11/.git', '--work-tree', '/var/folders/r1/65bwz63x3dd_zcr5vnrgm7m80000gn/T/pypoetry-git-dpath-pythonfffloo11', 'checkout', '2.0.1']' returned non-zero exit status 1

with traceback

  File "/Users/user/.poetry/lib/poetry/_vendor/py3.6/clikit/console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "/Users/user/.poetry/lib/poetry/_vendor/py3.6/clikit/api/command/command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "/Users/user/.poetry/lib/poetry/_vendor/py3.6/clikit/api/command/command.py", line 171, in _do_handle
    return getattr(handler, handler_method)(args, io, self)
  File "/Users/user/.poetry/lib/poetry/_vendor/py3.6/cleo/commands/command.py", line 92, in wrap_handle
    return self.handle()
  File "/Users/user/.poetry/lib/poetry/console/commands/add.py", line 149, in handle
    status = installer.run()
  File "/Users/user/.poetry/lib/poetry/installation/installer.py", line 74, in run
    self._do_install(local_repo)
  File "/Users/user/.poetry/lib/poetry/installation/installer.py", line 161, in _do_install
    ops = solver.solve(use_latest=self._whitelist)
  File "/Users/user/.poetry/lib/poetry/puzzle/solver.py", line 36, in solve
    packages, depths = self._solve(use_latest=use_latest)
  File "/Users/user/.poetry/lib/poetry/puzzle/solver.py", line 181, in _solve
    self._package, self._provider, locked=locked, use_latest=use_latest
  File "/Users/user/.poetry/lib/poetry/mixology/__init__.py", line 7, in resolve_version
    return solver.solve()
  File "/Users/user/.poetry/lib/poetry/mixology/version_solver.py", line 80, in solve
    next = self._choose_package_version()
  File "/Users/user/.poetry/lib/poetry/mixology/version_solver.py", line 388, in _choose_package_version
    version = self._provider.complete_package(version)
  File "/Users/user/.poetry/lib/poetry/puzzle/provider.py", line 601, in complete_package
    self.search_for_vcs(r)
  File "/Users/user/.poetry/lib/poetry/puzzle/provider.py", line 175, in search_for_vcs
    name=dependency.name,
  File "/Users/user/.poetry/lib/poetry/puzzle/provider.py", line 207, in get_package_from_vcs
    git.checkout(reference, tmp_dir)
  File "/Users/user/.poetry/lib/poetry/vcs/git.py", line 217, in checkout
    return self.run(*args)
  File "/Users/user/.poetry/lib/poetry/vcs/git.py", line 284, in run
    subprocess.check_output(['git'] + list(args), stderr=subprocess.STDOUT)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/Users/user/.poetry/lib/poetry/utils/_compat.py", line 206, in run
    retcode, process.args, output=stdout, stderr=stderr

what do I need to do to fix the problem?

@brain4power brain4power added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jul 10, 2020
@finswimmer
Copy link
Member

Hello @brain4power,

the version is set dynamically in the setup.py of dpath. poetry isn't able to read this mandatory information by design, as it doesn't execute the setup.py.

We are discussion ways how to support this in the future, see #2632

fin swimmer

@abn abn removed the status/triage This issue needs to be triaged label Sep 25, 2020
Copy link

github-actions bot commented Mar 3, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

3 participants