question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

poetry add git+https:// will fail with CalledProcessError if package name includes illegal file name characters

See original GitHub issue
  • 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).
  • Microsoft Windows 10 Pro: Version 10.0.18363 Build 18363:
  • Poetry version: 1.1.4:
  • Link of a Gist with the contents of your pyproject.toml file:

Issue

I was starting a new project and adding some dependencies and came across a bug in the git clone process.

 % poetry add git+https://github.com/tanj/swissarmy.git

Updating dependencies
Resolving dependencies...

Writing lock file

Package operations: 2 installs, 0 updates, 0 removals

  • Installing python-dateutil (2.8.1)
  • Installing swiss army: untility package (0.1 7e67114)

  CalledProcessError

  Command '['git', 'clone', '--recurse-submodules', 'https://github.com/tanj/swissarmy.git', 'C:\\Users\\REDACTED\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\gkeep-organizer-mzsur4FB-py3.8\\src\\swiss army: untility package']' returned non-zero exit status 128.

  at ~\.poetry\lib\poetry\utils\_compat.py:217 in run
      213│                 process.wait()
      214│                 raise
      215│             retcode = process.poll()
      216│             if check and retcode:
    → 217│                 raise CalledProcessError(
      218│                     retcode, process.args, output=stdout, stderr=stderr
      219│                 )
      220│         finally:
      221│             # None because our context manager __exit__ does not use them.


Failed to add packages, reverting the pyproject.toml file to its original content.

The issue is that my swissarmy package has a : in the package name and that is an illegal character for a windows file path.

The offending code is located at https://github.com/python-poetry/poetry/blob/639d5e05773ed8b91b80ec03c2ee64f500534c10/poetry/installation/executor.py#L562

I realize that naming my package like that probably is breaking some PEP, but python itself has no issue installing and using the package…

pip freeze output for that package -e git+https://github.com/tanj/swissarmy.git@7e671142565cb2b2aa04292ec0775c024bf47547#egg=Swiss_Army_Untility_Package

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
sinoroccommented, Nov 20, 2020

@uda But there are no illegal characters in the name of the project you are trying to install, are there? Maybe you would need to add your voice to a different ticket. Maybe this one: https://github.com/python-poetry/poetry/issues/3366, or just simply correct your pyproject.toml to read branch = 'main', since it seems to be your actual issue.

1reaction
udacommented, Nov 20, 2020

Oy, thanks @singulared , I didn’t even realize that that’s the issue…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Command '['git' 'clone', '--recurse-submodules', '--', 'ssh:// ...
I am trying to create virtualenv with make ...
Read more >
Supported hooks
check-added-large-files - prevents giant files from being committed. ... name-tests-test - verifies that test files are named correctly. no-commit-to-branch ...
Read more >
Repositories | Documentation
Repositories Poetry supports the use of PyPI and private repositories for discovery of packages as well as for publishing your projects.
Read more >
tmuxp Documentation
ORM-based API via libtmux - Utilitizes tmux >= 1.8's unique ID's for panes, windows and sessions to create an object relational view of...
Read more >
poetry install fails with [CalledProcessError] while installing ...
I'm new to python and github. when I'm trying to install few submodules getting below ... package = cls.get_package_from_directory(tmp_dir, name=name) File ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found