-
Notifications
You must be signed in to change notification settings - Fork 385
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
fix: Create directories from envs_dirs
if they do not exist
#3796
Conversation
Signed-off-by: Burt Holzman <[email protected]>
envs_dirs
if they do not exist
Ah, my bad. I'll revise the failing tests and update this PR. |
Actually, I think this exposed an issue with #3692: In 2.0.5,
but in 2.0.6:
|
Merging |
I assume the Windows test is failing because it succesfully creates |
Thank you! For your information, looking at the test logs: def test_create_envs_dirs(tmp_root_prefix: Path, tmp_path: Path):
"""Create an environment when the first env dir is not writable."""
os.environ["CONDA_ENVS_DIRS"] = f"{Path('/noperm')},{tmp_path}"
env_name = "myenv"
helpers.create("-n", env_name, "--offline", "--no-rc", no_dry_run=True)
> assert (tmp_path / env_name / "conda-meta" / "history").exists()
E AssertionError: assert False
E + where False = exists()
E + where exists = (((WindowsPath('C:/Users/runneradmin/AppData/Local/Temp/pytest-of-runneradmin/pytest-0/test_create_envs_dirs_False_0') / 'myenv') / 'conda-meta') / 'history').exists
|
So this test was previously successful on both Windows and Linux because |
Ah yes, my bad, I misread the assertion. |
In the meantime, #3836 has been reported. Could we see if this PR fixes it by adding a non-regression test for it? |
Ok, I’m a little stumped on this one; I rolled out a Windows dev environment and the test (as revised) passed… |
7c6a92a
to
eef136f
Compare
@holzman: I tried several alternatives, but I think it would be worth having someone with a Windows machine reproduce and understand the error locally. Feel free to remove / revert my commits. |
Thanks @jjerphan - I did test in a Windows machine, unfortunately. Something must be subtly different about the environment in the actual Windows runner. I'll see if I can figure that out in a separate project; if it turns out it's impossible to make a read-only directory for the test, we should probably just skip the test for Windows. |
eef136f
to
ea0f7ca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM given 🟢 CI.
I am waiting for a review from someone else in the team before merging.
This test failing isn't my fault for a change! I think the latest commit to dateutil has a file with CRLF which gets autoconverted during the pip install (due to dateutil's settings in .gitattributes), showing up as modified and then erroring out. |
Indeed. |
Merging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I'm not the most knowledgeable about the behavior tested in the python tests, it seems fine to me but I'm not sure it's correct. Maybe wait for a review from @Hind-M before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Fix #3790.
Fix #3836.