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
Inconsistent drive letter on Windows when using tox and pytest #1381
Comments
Hello, @eine |
@al-cheb, unfortunately, I don't know how to simplify it further. The workflows linked above do only:
The first thing tox does, which is to setup the environment, is already inconsistent: I will try with powershell. |
@eine,
Second variant:
|
@al-cheb see this run: https://github.com/eine/vunit/runs/966666285?check_suite_focus=true It is a stripped down version of the master workflow: eine/vunit@a1378eb As you see, it works with powershell, not with bash. Compare the following lines: |
@al-cheb, please note that the error seems not to be consistent. That is, sometimes |
@eine,
https://github.com/eine/vunit/runs/966666285?check_suite_focus=true (only first one in lowercase)
|
I'm pinging @gaborbernat (maintainer of tox). Bernát, can you help us understand whether this is an issue with tox, with Python or with GitHub's virtual environment? Basically, FTR, not the same issue, but related to another bash on Windows: tox-dev/tox#1648 |
I'll check but first thing first, no one should be using the sdist mode anymore, and users are encouraged to switch to the isoalted build mode https://tox.readthedocs.io/en/latest/example/package.html?highlight=isolated_build |
@gaborbernat, I was not aware of isolated builds or
EDIT Maybe |
It seems that pytest v5 was able to handle this inconsistency, i.e., it uppercased the drive regardless of how it was retrieved. However, v6 preserves it as received from the environment, which is not correct (dunno if due to tox or GitHub, yet). See:
pinging @fabioz, @bluetech and @nicoddemus, who have been modifying path related features in pytest: pytest-dev/pytest#6523, pytest-dev/pytest#7619. |
Hi folks, sorry for the delay. Note that you can get upper case/lower case paths depending on how you change
I see the inconsistent drive letters are being seen right at the start of the tox run, so I suspect is something related to how it the environment |
@nicoddemus thanks for stepping by! I'm not sure I understand which is "the environment" in your comment. tox seems to report uppercases (after the changes suggested by @gaborbernat). I believe the first lowercase log is generated by pytest (https://github.com/eine/vunit/runs/967060891?check_suite_focus=true#step:6:18). How does pytests read/get Note that with v5.4.3 pytest will report |
What change was that pytest resolved the path and it doesn't anymore (because, if you had some subst Now it just accepts and keeps what's passed to it. So, in this case it's probably the caller of pytest that needs fixing to keep it consistent (apparently tox?). Although I must say that if a test fails due to how you call it having an uppercase or lowercase drive letter (which is pretty inconsistent on windows itself) I'd probably fix the test... |
Thanks for clarifying.
This is what I'm trying to understand. I'd say that VUnit preserves what's passed too. Hence, I don't know where is the inconsistency being created.
These are some unit tests for some Python code. It "just" calls some functions, generates some logs and it then compares the output. Aanyway, I will look deeper into it. |
In this case I meant the GH actions envirionment, sorry for not being clearer.
As @fabioz commented, now pytest won't try to resolve the paths anymore (resolve meaning to follow symlinks/subst drives), so it should keep the same paths internally as given by it externally. If that's not happening then I agree it is probably a bug in pytest, but I'm not sure that's what is happenning here because the different uppercase/lowercase drive letters show up as early as the start of the |
…images#1381" This reverts commit 7c3f930.
I tried to investigate this a bit more, but it seems to be fixed magically. Even though neither of the dependencies changed (tox 3.19.0, pytest 6.0.1) it's successful now. Hence, I'm closing this issue. I'll reopen if I find the problem again. |
I'm finding that the same branch/commit works in a repo but fails in a fork. The difference I found is that drive letters are uppercase in the former and lowercase in the latter:
The command that is being tested is
tox -e py36-unit -- --color=yes
from VUnit/vunit, which executes{envpython} -m pytest -v -ra tests/unit {posargs}
.AFAIU, Windows is not case sensitive, hence I'd expect drive letters to always be uppercase.
The text was updated successfully, but these errors were encountered: