DEV Community

Cover image for Build Command Line Tools with Python Poetry

Build Command Line Tools with Python Poetry

Jonathan Bowman on August 04, 2020

Poetry is a robust and convenient tool for building Python projects. The article Getting Started with Python Poetry demonstrated this in simple ter...
Collapse
 
mklengel profile image
Michael Klengel • Edited

Great article but I have a problem with the scripting part in pyproject.toml:

[tool.poetry.scripts]
greet = "greet.location:cli"
Enter fullscreen mode Exit fullscreen mode

The location of my project folder contains a space and this results in an error:

(.venv) ➜  pygreet greet
zsh: /Volumes/Macintosh SR0/Users/mklengel/Development/pygreet/.venv/bin/greet: bad interpreter: /Volumes/Macintosh: no such file or directory
Enter fullscreen mode Exit fullscreen mode

The question is how to improve the scripting part in pyproject.toml.

Regards
Michael

Collapse
 
bowmanjd profile image
Jonathan Bowman

Interesting. You are right; that space in Macintosh SR0 is causing problems. What version of poetry are you using, and how did you install it?

It looks like your issue was supposed to have been resolved by Poetry Issue 1774, which is why I ask.

Collapse
 
mklengel profile image
Michael Klengel • Edited

Hi Jonathan,

I've detected another bug in conjunction with a space in the path:
Poetry Issue 3630

I've created a new issue:
Poetry Issue 3643

Seems to be insufficient automated testing during the development of poetry.

➜  ~ poetry --version
Poetry version 1.1.4
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
bowmanjd profile image
Jonathan Bowman

Good job finding the first issue, and logging the other! Are both resolved by #3631, or just the first?

Thread Thread
 
mklengel profile image
Michael Klengel • Edited

Thx - I do my best to learn python so currently I can only help with bug reports :-)
#3631 doesn’t solve the shebang problem, therefore the bug report.

Thread Thread
 
mklengel profile image
Michael Klengel • Edited

Hi Jonathan,

I saw your comment on GitHub. May be I have to check the consequences of renaming the mount paths on my Mac. Should be the practical solution of the problem.

Collapse
 
jamescarr profile image
James Carr

Thanks, this was really great to catch up on poetry's features and usage.

Collapse
 
bowmanjd profile image
Jonathan Bowman

Glad to hear it was useful! Thanks.

Collapse
 
jermwatt profile image
Jeremy Watt

great article! unblocked me.