collective / Products.LoginLockout

Prevents endless login attempts in Plone, making it more secure.
https://pypi.python.org/pypi/Products.LoginLockout
2 stars 7 forks source link

Adding python 3 support #34

Closed HybridAU closed 3 years ago

HybridAU commented 4 years ago

For me it's installed and running well under Plone 5.2.1 and Python 3.8.3

HybridAU commented 4 years ago

I've created this pull request and I made a few changes which I squashed back into a single commit there aren't a bunch of commits like "Trying to get Travis to work".

All the tests are passing for Plone 4.3, 5.0 and 5.1

But I've run into a bit of an issue, Plone 5.2 requires zope.testing==4.7 which has removed doctest and replaced it with doctestcase. I can't migrate all the tests to doctestcase because Plone 4.3 requires zope.testing==3.9.7.

I'm wondering if the maintainers might have any advice on how to tackle this?

djay commented 4 years ago

@HybridAU I can't find much documentation about doctestcase. There is a plone 5.2 migration guide and plenty of plone code with doctests so there should be lots written about how to handle this, or existing code examples. If that fails, ask the community. We aren't using 5.2 yet so haven't done any 5.2 addon work

djay commented 4 years ago

@HybridAU I think I've found the documentation. It doesn't seem to say doctest is not supported but doctestcase is prefered. https://pypi.org/project/zope.testing/#doctests-in-testcase-classes. In anycase I think you can combine the advice I give in the link below to move the doctests into doctestcase decorated functions. https://gist.github.com/djay/c047a90622b3dae86be5d819e8dfda12 Also it looks like doctestfiles decorator would work as a replacement for doctestsuite without too much changes

djay commented 3 years ago

Ok, tests are passing now so I'll merge it

HybridAU commented 3 years ago

Oh wow this is amazing, I'd kind of forgotten about this but thanks for all your hard work to get this over the line @djay. Python 3 here we come :smile: