Closed lensvol closed 11 years ago
It's hacky, but it's what needs to be done :-) There's already a couple of shims like this in cricket, and Django has them by the bucketload.
The error message isn't needed though; setup.py alters the required_packages based on Python version, so we can force the install of unittest2 if we're working with Python2.6.
Completely forgot about "required_packages", thank you :)
Btw, what is more appropriate way to contribute bugfixes here: start an issue with proposed solution or submit pull requests with ready code? I've got couple more patches coming and not sure how to proceed.
Depends how big the issue/patch is. If it's a relatively minor thing -- e.g., adding an import shim for Python 2.6 compatibility -- then going straight to a pull request is fine. If there's likely to be some discussion needed on the right technical approach, then lodging a ticket first is probably the best idea.
Regarding the pyttk dependency - you mentioned on a different thread that you were testing on Windows 7 -- I'm testing on windows 7 as well, and pyttk wasn't needed.
In response to a recent report from a friend, I added some advice to the docs/README regarding getting going under Windows -- if you're using a virtualenv, you need to set an extra environment variable for Cricket to work, or you'll get "Can't find TTK library" errors. Is this the problem you encountered? Does it go away if you follow the (new) advice in the README?
Ah - and now I've seen your updated PR - it's about ttk specifically, not tkinter. My mistake.
At the moment cricket implicitly relies on ttk and unittest from 2.7, which causes install from PyPi to fail:
After that it fails because of changed module structure in unittest from 2.7:
This because in old unittest TestResult> was import from unittest directly, while in >2.7 it needs to be imported from unittest.result.
While ImportError with ttk can be fixed relatively straightforward with adding pyttk to REQUIREMENTS, I'm not sure how to deal with unittest situation.
Possible solution seems to be falling back to unittest2:
But it seems somewhat hacky. :(