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.

Ability to specify the directory to run poetry in instead of always using current directory

See original GitHub issue
  • [x ] I have searched the issues of this repo and believe that this is not a duplicate.
  • [ x] I have searched the documentation and believe that my question is not covered.

Feature Request

I’d like to be able to run poetry run X while also setting the current directory to whatever I want. Right now, this appears to be impossible, since I have to set the current directory to wherever my pyproject.toml file is located instead. Can there be a command line option to override this default?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:113
  • Comments:35 (7 by maintainers)

github_iconTop GitHub Comments

65reactions
abncommented, Aug 4, 2020

@noamraph something like this will also work.

[tool.poetry.scripts]
foo = "foo.bar.main:main"

And then execute the follwoing within the project context (any sub directory):

poetry run foo

Is the requirement here for you to be able to run foo in a directory outside the project context? Something like this? (Possible proposal.)

poetry --project=/path/to/project-foo run foo
30reactions
k0t3ncommented, Sep 4, 2021

Extremely needed feature for multirepos!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration | Documentation | Poetry - Python dependency ...
You can override the Data directory by setting the POETRY_DATA_DIR or POETRY_HOME environment variables. If POETRY_HOME is set, it will be given higher...
Read more >
How can I make my project available in the poetry environment?
First, poetry must be able to find the package folder. poetry is able to do this by default, if the folder containing the...
Read more >
Managing your Python dependencies with Poetry - Devopsbay
Poetry is the tool that combines the power of both pip and venv, making development process easier to handle. It has all the...
Read more >
Configure a Poetry environment | PyCharm Documentation
Do one of the following: · Select Add Local Interpreter. · In the left-hand pane of the Add Python Interpreter dialog, select Poetry...
Read more >
Dependency Management With Python Poetry
Add pyproject.toml to a Scripts Folder; Use an Existing ... A dependency manager like Python Poetry helps you specify, install, and resolve ...
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