New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Actually switch directory with --directory/-C #7897
Comments
You don't need to make an "official request" to fix the docs, just submit a merge request - make it happen yourself! (Reporters in both of the issues that you linked were also invited to fix the docs) |
Sure, but ideally the behavior would be changed, so this is a request mostly for that |
I think a docs clarification is more likely to succeed - two issues declaring this working-as-designed tells its own story - but: same deal. If you care about this and want it to happen, your best shot is to do it yourself. |
Imo it should not change the directory, because this would defy the whole option at all. It is especially useful to run a script entrypoint via So yes, the feature is working as designed I would assume. |
@Makman2 I assume you meant I don't think that should be a supported usecase. If you're using another poetry project as a tool for another project, you should add it as a dependency, which will register the entrypoint in the second project so you can just do |
The second project might not be a Python project, and general-purpose tools/helpers not required for building or similar should not be listed in a requirements section normally. Without this usecase you don't have a chance to sanely invoke a Python entrypoint via poetry and reference any files on command line. |
If it's a poetry project, you should certainly add a If it's not a python project, IMO you should install it the same as any other third-party dev tool you use. But as a workaround, you could always do (or write a script to do) $(poetry -C ../other/dir/ run which entry-point) file1 file2 |
I also don't understand why is When I am outside of
it works as expected. But when I run
it fails with
Same error as if I wouldn't use flag |
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 flagOR update the docs.Most GNU tools like
make
orgit
will makegit -C dir ...
equivalent to(cd dir && git ...)
. Using the same flag implies the same behavior, when it's not currently the case: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.The text was updated successfully, but these errors were encountered: