-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
Working directory unexpectedly set to wherever noxfile.py is. #469
Comments
This is very much intentional behavior and it's to let noxfiles care less about how it was executed - specifically, so it can make assumptions about where it's working from so it can read, edit, import, etc files as expected. I think we could make the original cwd available as a property of the session, though. The chdir happens here. |
Available as a session property would be perfect. |
Hello @theacodes. I'm interested on this issue, if no one is working on it. Can you please tell me what do I have to do (I'm a bit new to the concept)? |
@DiddiLeija you could store the original cwd in |
Got it. I will open a PR on the next week. |
Describe the bug
Trying to invoke nox from a different folder using the --noxfile flag sets the current working directory to where the noxfile lives. This makes reusing a noxfile across multiple projects in a monorepo very difficult, since I can't find a good way to set the current working directory to where nox was called from. Even passing '.' as a posarg will end up being interpreted as the directory where the noxfile lives
Expected behavior
Either the cwd stays as wherever nox is called from, or we have some command line arg for what to treat as the cwd. If this feature already exists and I've missed it, or there are some other recommendations for how to use a single nox file across multiple projects, please let me know!
The text was updated successfully, but these errors were encountered: