-C / --directory equivalent for the toml conf? #10162
Replies: 1 comment
|
There isn't a per-script working-directory setting in Poetry's entry-point configuration. For the traceback shown, change the import in from . import globals
# or: from bot import globals
Also uncomment your package selection, since the distribution is named [tool.poetry]
packages = [{ include = "bot" }]Keep For files such as from pathlib import Path
config_path = Path(__file__).resolve().parent / "conf" / "neo.yaml"Changing directory with |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I don't know if I'm being stupid or have missed something in the docs so apologies in advance (I am extremely tired) but I would like to know if it's possible to set a scripts working directory when run from the toml config. Example, my project setup tree is like so:
My toml config:
Now, what I want to happen, is when I'm in the project root, i.e outside the
botfolder, to be able to runpoetry run neoand it resolves all modules etc inside as if it was running from the bot directory. But, it doesn't, because it's evidently running from the working directory I am running the command from, resulting in things such as:To remediate that for now I can do
poetry -C ./bot run neoand it works just fine, but can I do something inside the poetry config to set it so whenever this script is run it makes it so thebotfolder is the current working directory?All reactions