Skip to content

Actually switch directory with --directory/-C #7897

@brandonchinn178

Description

@brandonchinn178
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the FAQ and general documentation and believe that my question is not already covered.

Feature Request

Previous issues have been raised asking about the behavior of --directory: (#7363, #7507). They have both been closed as "working as expected", so this issue is an official request to change the behavior OR change the flag OR update the docs.

Most GNU tools like make or git will make git -C dir ... equivalent to (cd dir && git ...). Using the same flag implies the same behavior, when it's not currently the case:

this is expected. Poetry just loads the pyproject.toml from the given directory and does not switch to the directory.
#7363 (comment)

Ideally, the behavior would be changed to actually change the directory; I don't see why a simple addition of os.chdir in the beginning of the CLI main function would break things.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureFeature requests/implementationsstatus/triageThis issue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions