Skip to content
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

Python 2.6 compatibility #29

Merged
merged 7 commits into from
Jun 25, 2015
Merged

Conversation

dpetzold
Copy link

Hello,

This pull requests adds support for Python 2.6 and Tox. I thought this would be a simple exercise but since hypothesis does not support 2.6:

http://www.drmaciver.com/2015/05/if-you-want-python-2-6-support-pay-me/

getting the tests required a bit more effort than I was anticipating :). Since hypothesis uses decorators the tests couldn't just be skipped the decorators also had to be mocked out. I also ran into a issue where the de_DE locale wasn't available on all versions so those are also skipped sometimes.

The motivation for this was to get these pull requests to pass:

https://github.com/timothycrosley/isort/pulls

Just let me know if you have any questions or comments.

Thanks!,

@SethMMorton
Copy link
Owner

This is great! Had stopped testing against Python 2.6 because of hypothesis because it looked like too much work to make it compatible... I'm pretty impressed. I will take a deeper look and make a new release in a hopefully a few days.

@dpetzold
Copy link
Author

Ha yeah I was thinking it would be a small change. The actual commit for py26 compatibility was:

dpetzold@866dd4b

but then I didn't see the point of that without tox. It was a good experience and I was very happy to be able to contribute to natsort :).

@dpetzold
Copy link
Author

I rewrote history on this commit:

dpetzold@9dadb3a

To use sys.version_info. I think the tests just need to be rerun again for it to pass.

Derrick Petzold added 3 commits June 21, 2015 21:52
- Moved compatibility support to compat module.
- Skip hypothesis tests if using Python 2.6.
- Skip locale tests for de_DE on platforms that do not support it.
Derrick Petzold added 2 commits June 21, 2015 22:20
The mock and pathlib modules were not being appended to the test requires.
@SethMMorton
Copy link
Owner

I really like the idea of the compat folder. Most of my files probably belong in there, so I think I will make that change before release. However, I will move the py26.py file that you added to the "test_natsort" folder, since this file will introduce a dependency on hypothesis and mock for all users even if they are not testing, which I do not want to do.

@SethMMorton
Copy link
Owner

This pull request was merged into the develop branch in commit fcda77a.

@SethMMorton SethMMorton merged commit 706ce31 into SethMMorton:master Jun 25, 2015
@dpetzold
Copy link
Author

Hey Seth,

I was just going to followup on your feedback but I see you have already updated. Your changes look really great. Thanks for letting me contribute!

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

Successfully merging this pull request may close these issues.

2 participants