-
Notifications
You must be signed in to change notification settings - Fork 181
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
Support Windows #280
Support Windows #280
Conversation
@@ -98,7 +98,7 @@ def get_date(self, hash): | |||
def get_hashes_from_range(self, range_spec): | |||
args = ['log', '--quiet', '--first-parent', '--format=format:%H'] | |||
if range_spec != "": | |||
args += [range_spec] | |||
args += range_spec.split() |
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.
Is this necessary? The range spec is supposed to be a single argument passed to git.
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.
Oh, I have been using this to run a single commit with asv, like asv run "-1 <hash>"
, since git log will take more than one argument.
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.
Does the test suite pass? Did you also check if the peakmem benchmarks work? When I wrote it https://github.com/spacetelescope/asv/blob/master/asv/benchmark.py#L128 worked, but would be useful to check that again now that it has a chance of being actually used. |
Otherwise, looks great to me. @mdboom: could be useful to use appveyor to run tests on windows |
} | ||
|
||
while proc.poll() is None: | ||
fds = { |
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.
There are systems that don't have setpgid that are still Unix-like and can still use select. It looks like you've changed the behavior here so anything that doesn't have setpgid doesn't use select (and thus can't provide feedback that the subprocess is running). Can you fix the logic here so we only fall back to proc.communicate
on Windows?
I would like to set up Appveyor as part of this PR ideally so that this work doesn't get undone in the future. Thanks for setting this up, @rmcgibbo. |
#281 adds Appveyor support. Before merging this PR, we should base it on that one and make sure all the Appveyor tests pass etc. |
It seems like there is a bug somewhere with the terminal colors using colorama. When I run the tests under |
After disabling colorama, here are the results of the test on my windows box. I'm not familiar enough with py.test to know what the error means: https://gist.github.com/rmcgibbo/f053315c620ca9504671 |
The problem probably is that colorama.init() adds some filter to stdout,
which pytest doesn't like. You perhaps should do
`colorama.init(wrap=False)` on top and explicitly use the colorama
AnsiToWin32 stream converter in color_print.
|
proc.kill() | ||
is_timeout = True | ||
else: | ||
try: | ||
if posix: |
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.
Wrong indentation (doesn't do what the original code did) -- only the signal handler part should be inside if posix
The colorama.init() doesn't really seem callable twice. |
Okay, I'll try changing it to use the explicit stream |
The multiprocessing test in `test/test_util.py` seems to hang on
Appveyor. Does it pass on your system?
|
Some extra fixes in gh-282 (separate PR to see if appveyor runs) |
The py.test INTERNALERROR failure is probably https://bitbucket.org/pytest-dev/py/issue/55/broken-comment-parsing; workaround is to pass |
Ok, managed to clear most of the errors up.
There's a weird access denied error remaining in
`test_environment.py:test_presence_checks` --- appears on Appveyor, but
can't reproduce that on my vm. @rmcgibbo: are you able to reproduce that?
|
Using https://github.com/pv/asv/tree/pr-280-windows, I still get black-on-black text in the terminal (powershell or VS command prompt). |
After disabiling colorama, I do not get an error in |
I suppose you don't get For me, the output from pytest is colorless, even when colorama is installed. Colors in asv work fine. |
With your branch, colorama enabled (redirecting stdout), I get.
|
I'll just drop colored printing on windows, not really worth the trouble trying to debug it. |
+1 |
The "Access is denied" error then seems somehow connected to the setup on Appveyor (I didn't get it with admin user or non-admin users). Not sure what to do about this, I don't know much about windows ACL, so it would be tempting to just mark it as a known failure on windows as it seems it's not encountered in actual use. |
Given that the current master doesn't work at all on windows, and your PR works on both of our machines, it seems like a clear improvement, even with this appveyor issue. |
The Appveyor access denied failure appears to be due to Python DLL/exe files inside the environment, probably they have remaining open file handles or something that prevents removal. File removal on NTFS is non-POSIX. Adding sleeps, or using the conda.install.rm_rf implementation for rmtree doesn't seem to help, so this doesn't appear to be an intermittent pending-delete failure that can be solved by retrying the operation. Interestingly, the failure only occurs for the combinations where the Python version asv uses is the same as that used in the environment (2.7 in the test); pytest reports it as xpassed ( I think this failure is fairly unlikely to occur in real use cases --- first, I and @rcmgibbo do not manage to reproduce it on our machines. Second, environment re-creation is not a common occurrence, and when it happens, the Python interpreter inside the environment is unlikely be running. So I think just marking this as xfail won't be so bad in practice. |
Closed by #282. |
I think I still had a problem running
asv gh-pages
from windows, but this fixes some of the major issues.