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

Failed add dependency with submodule #1828

Closed
3 tasks done
matemax opened this issue Jan 5, 2020 · 6 comments · Fixed by #2427
Closed
3 tasks done

Failed add dependency with submodule #1828

matemax opened this issue Jan 5, 2020 · 6 comments · Fixed by #2427
Labels
kind/bug Something isn't working as expected

Comments

@matemax
Copy link
Contributor

matemax commented Jan 5, 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: Windows 10

  • Poetry version: 1.0.0 + changes from (Github SSH String and SdistBuilder Incompatible #1697)

  • Link of a with the contents of your pyproject.toml file: Gist

Issue

Command failed

poetry add -vvv  git+https://github.com/matemax/test_poetry_submodule.git
Updating dependencies
Resolving dependencies...
   1: fact: test-poetry-private-deps is 0.1.0
   1: derived: test-poetry-private-deps
   1: fact: test-poetry-private-deps depends on private-module (*)
   1: fact: test-poetry-private-deps depends on test-poetry-submodule (*)
   1: selecting test-poetry-private-deps (0.1.0)
   1: derived: test-poetry-submodule (*)
   1: derived: private-module (*)
   1: selecting test-poetry-submodule (0.1.0 deca5b4)
   1: selecting private-module (0.1.0 829aa65)
   1: Version solving took 16.899 seconds.
   1: Tried 1 solutions.


Package operations: 2 installs, 0 updates, 0 removals

  - Installing private-module (0.1.0 829aa65)
  - Installing test_poetry_submodule (0.1.0 deca5b4)

[EnvCommandError]
Command ['pip', 'install', '--no-deps', '-U', '-e', 'C:\\Users\\matem\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\test-poetry-private-deps-XkzVeGoR-py3.7\\src\\test-poetry-submodule'] errored with the following return code 1, and output:
Obtaining file:///C:/Users/matem/AppData/Local/pypoetry/Cache/virtualenvs/test-poetry-private-deps-XkzVeGoR-py3.7/src/test-poetry-submodule
    ERROR: Command errored out with exit status 1:
     command: 'c:\python37\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\matem\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\test-poetry-private-deps-XkzVeGoR-py3.7\\src\\test-poetry-submodule\\setup.py'"'"'; __file__='"'
"'C:\\Users\\matem\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\test-poetry-private-deps-XkzVeGoR-py3.7\\src\\test-poetry-submodule\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.c
lose();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info
         cwd: C:\Users\matem\AppData\Local\pypoetry\Cache\virtualenvs\test-poetry-private-deps-XkzVeGoR-py3.7\src\test-poetry-submodule\
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\matem\AppData\Local\pypoetry\Cache\virtualenvs\test-poetry-private-deps-XkzVeGoR-py3.7\src\test-poetry-submodule\setup.py", line 3, in <module>
        from test_poetry_submodule.poetry_private_module.private_module.foo import bar
    ModuleNotFoundError: No module named 'test_poetry_submodule.poetry_private_module.private_module'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.


Traceback (most recent call last):
  File "c:\python37\lib\site-packages\clikit\console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "c:\python37\lib\site-packages\clikit\api\command\command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "c:\python37\lib\site-packages\clikit\api\command\command.py", line 171, in _do_handle
    return getattr(handler, handler_method)(args, io, self)
  File "c:\python37\lib\site-packages\cleo\commands\command.py", line 92, in wrap_handle
    return self.handle()
  File "c:\python37\lib\site-packages\poetry\console\commands\add.py", line 149, in handle
    status = installer.run()
  File "c:\python37\lib\site-packages\poetry\installation\installer.py", line 74, in run
    self._do_install(local_repo)
  File "c:\python37\lib\site-packages\poetry\installation\installer.py", line 286, in _do_install
    self._execute(op)
  File "c:\python37\lib\site-packages\poetry\installation\installer.py", line 302, in _execute
    getattr(self, '_execute_{}'.format(method))(operation)
  File "c:\python37\lib\site-packages\poetry\installation\installer.py", line 327, in _execute_install
    self._installer.install(operation.package)
  File "c:\python37\lib\site-packages\poetry\installation\pip_installer.py", line 37, in install
    self.install_git(package)
  File "c:\python37\lib\site-packages\poetry\installation\pip_installer.py", line 246, in install_git
    self.install_directory(pkg)
  File "c:\python37\lib\site-packages\poetry\installation\pip_installer.py", line 221, in install_directory
    return self.run(*args)
  File "c:\python37\lib\site-packages\poetry\installation\pip_installer.py", line 118, in run
    return self._env.run_pip(*args, **kwargs)
  File "c:\python37\lib\site-packages\poetry\utils\env.py", line 824, in run_pip
    return self._run(cmd, **kwargs)
  File "c:\python37\lib\site-packages\poetry\utils\env.py", line 1052, in _run
    return super(VirtualEnv, self)._run(cmd, **kwargs)
  File "c:\python37\lib\site-packages\poetry\utils\env.py", line 856, in _run
    raise EnvCommandError(e, input=input_)

Script setup.py of package https://github.com/matemax/test_poetry_submodule.git has import from submodule. Also instead import setup.py may be contains reference on files from manifest.
Following command clone repository with all submodules.

    def clone(self, repository, dest):  # type: (...) -> str
        return self.run("clone", "--recurse-submodules", repository, str(dest))

PR: #1826

@matemax matemax added the kind/bug Something isn't working as expected label Jan 5, 2020
@finswimmer
Copy link
Member

Hello @matemax,

as you found out, this happens due to the fact, that poetry doesn't fetch submodules. This is already a feature request (#611) and @sdispater confirmed, that it would be a good idea, that poetry always fetches submodules (#611 (comment)).

@matemax
Copy link
Contributor Author

matemax commented Jan 5, 2020

Sorry that i not found this issue. My PR clone repository with all submodules.

@matemax
Copy link
Contributor Author

matemax commented Jan 5, 2020

I think that there are two side effect:

  • sometimes command git clone will longer than without cloning submodules.
  • may be problem with permissions

But if i want to install package i should clone all submodules and have all permissions

@matemax
Copy link
Contributor Author

matemax commented Mar 7, 2020

Is there any news? @sdispater @finswimmer

@matemax
Copy link
Contributor Author

matemax commented Nov 18, 2022

Hi. It seems that in the new poetry it's broken again =(

Copy link

github-actions bot commented Mar 1, 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 1, 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
2 participants