Skip to content

Fixed SVG file generation on windows (#93)#99

Merged
eeaston merged 7 commits intoman-group:masterfrom
smarie:master
Dec 8, 2019
Merged

Fixed SVG file generation on windows (#93)#99
eeaston merged 7 commits intoman-group:masterfrom
smarie:master

Conversation

@smarie
Copy link
Contributor

@smarie smarie commented Oct 25, 2018

This pull request fixes #93.

It basically replaces the use of pipes.Template, that does not work on windows, with use of subprocess.Popen. An alternate code, using a temporary file, that is probably even more portable, is also included and commented out - just in case this version does not work on ALL targets (I expect it to work on both POSIX-compliant and WIN though).

The final terminal prints are also improved so as to display a correct error message in case of failure.

…e of pipes and using a temporary file instead. Also improved the terminal message at the end depending on the result of this operation. Fixes man-group#93.
…ution with temp file, and now using the solution with POpen.
@smarie
Copy link
Contributor Author

smarie commented Nov 15, 2018

Hi there, any news concerning this PR ?
It is relatively small and straightforward so it should really not take long to review.
Thanks in advance! By the way I also opened a bug so that it works on PyCharm when graphviz is installed using conda: https://youtrack.jetbrains.com/issue/PY-32408

So if the bug is fixed on your side and on their side, windows users will finally be able to generate the svg file directly :)

@eeaston
Copy link
Collaborator

eeaston commented Mar 20, 2019

Many thanks @smarie, this is really great! Very sorry for the super-slow reply - I'll pop my comments in-line

@eeaston eeaston self-requested a review March 20, 2019 18:38
Copy link
Collaborator

@eeaston eeaston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice, thanks - just a couple of small tidies and we can merge it in.

@smarie
Copy link
Contributor Author

smarie commented Mar 21, 2019

Thanks for the review !

@smarie
Copy link
Contributor Author

smarie commented Mar 21, 2019

It seems that you have an error in your continuous integration system:

INFO:coveralls:{"message":"Couldn't find a repository matching this job.","error":true}

@eeaston
Copy link
Collaborator

eeaston commented Mar 21, 2019

Hi, can you rebase from master? We've fixed this one now.

@smarie
Copy link
Contributor Author

smarie commented Mar 21, 2019

I'm not sure what you mean - I'm already on my master branch here. I'll just push a dummy commit

@smarie
Copy link
Contributor Author

smarie commented Mar 21, 2019

Still same error. Maybe the best is to merge on your side using commandline (github explains how on this page) then push

@smarie
Copy link
Contributor Author

smarie commented Mar 26, 2019

Any news on this @eeaston ? It would be great to close it asap now - it is quite old already. As noted above if your CI is not working for external PRs, you can always merge the PR into your local environment and then push yourself.

@smarie
Copy link
Contributor Author

smarie commented Apr 19, 2019

I tried to reproduce the error. It does not seem to come from my changes, but from the fact that pytest-profiling\\tests\\unit\\prof\\combined.prof is not created during the unit test execution. So the svg generation fails. See test_generates_svg (in unit tests) for details.

Maybe this was already the case before but the new method is less tolerant to the file not actually existing ?

I have to admit that I can't make more progress by myself here because I have troubles understanding the structure of your unit test, in particular where the .prof file is supposed to be generated.

@smarie
Copy link
Contributor Author

smarie commented Jul 3, 2019

Up: could this be merged ? It seems to me that this is a very small issue, but unfortunately I have absolutely no clue how to make your test environment work on my local computer: it seems to use advanced combinations of virtualenv and other things, that simply do not work on my windows config :(

@eeaston , could you try to run to checkout the PR code and run the tests locally to see what is the side-effect that was introduced ?

Thanks a lot for this great plugin, again - this PR would make it so much easier to use on windows !

@malthe
Copy link

malthe commented Nov 19, 2019

Bump?

@smarie
Copy link
Contributor Author

smarie commented Nov 19, 2019

I'd love that :) but unfortunately this particular plugin does not seem to be very much maintained. @eeaston do you have more information on this plugin status and the possibility to fix this important issue ?

@eeaston
Copy link
Collaborator

eeaston commented Dec 1, 2019

Hey guys, apologies again for the long delays. I've had some time over the holidays to spend on this and am setting up a Windows build on Travis which I've just about got working now. Once I have the tests going for the profiling plugin I'll merge this one in.
Thanks for your patience!

@eeaston
Copy link
Collaborator

eeaston commented Dec 8, 2019

Windows build is a-go now, I'll merge this in and add it to the build. Sorry again for the long delay!

@eeaston eeaston merged commit b798cc2 into man-group:master Dec 8, 2019
@smarie
Copy link
Contributor Author

smarie commented Dec 10, 2019

Great news !!! Thanks so much @eeaston . Cant wait for the new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pytest-profiling not generating SVG file

3 participants