feat(cli)!: actually switch directory with --directory/-C #9831
feat(cli)!: actually switch directory with --directory/-C #9831finswimmer merged 3 commits intopython-poetry:mainfrom
Conversation
2b8a3b6 to
85d74a7
Compare
|
Deploy preview for website ready! Built with commit e5e553b. |
radoering
left a comment
There was a problem hiding this comment.
Can we add some sort of test for the new option?
I really would like to add some tests. But until now I wasn't able to do so because I don't know how. The scenario I have in mind goes like this:
So any help is appreciated 😃 |
|
Most similar test is probably poetry/tests/console/commands/test_run.py Line 153 in 341071a which runs a scripts entrypoint and checks the error output. In https://github.com/python-poetry/poetry/tree/main/tests/fixtures/scripts, there is a project, which already has some entry points. There, you can add another one. |
|
Thanks @radoering. 👍 I played around a while, but due to the creation of venv I find it to complicated. In finally choose the |
805c746 to
6322aa7
Compare
Secrus
left a comment
There was a problem hiding this comment.
What is the expected behaviour when user passes both --project and --directory? I feel like there should be some more info on that matter, it doesn't feel intuitive right now and the docs are quite vague on the difference between those two.
I did not check, but my expectation is that the working directory is changed but the pyproject.toml is searched in
I agree it makes sense to add a sentence about this special case. Maybe, we should even add a test case where both parameters are used. |
6322aa7 to
f4459cb
Compare
I've added a test case. Any suggestion for extending the docs? |
Maybe an info box below the global options. However, while thinking about what to write I did not come up with something that is saying more than what has already been added in #9831 (comment). Maybe, that is sufficient. |
f4459cb to
e5e553b
Compare
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Pull Request Check List
--directorynow switch the current working folder, so that relative paths are resolved relative to the given folder.To retain the old behavior the
--projectflag is introduced.Resolves: #7897