wagtail-django-recaptcha icon indicating copy to clipboard operation
wagtail-django-recaptcha copied to clipboard

Namespace change in django_recaptcha library as of 4.0: captcha changed to django_recaptcha

Open DanielSwain opened this issue 1 year ago • 9 comments

DanielSwain avatar Nov 16 '23 23:11 DanielSwain

Context: https://github.com/torchbox/django-recaptcha/releases/tag/4.0.0

Package namespace renamed!

The package namespace captcha has been renamed to django_recaptcha to avoid conflicts with other captcha packages.

Please see the full CHANGELOG for all changes and upgrade considerations

wadevries avatar Nov 17 '23 10:11 wadevries

@DanielSwain If you're modifying the import, I reckon the requirements in setup.py be updated as well to only install >=4? Otherwise, make the imports work with both versions (assuming everything else is compatible?) like so:

try:
    from django_captcha.fields import ReCaptchaField  # >= 4.0
except ImportError:
    from captcha.fields import ReCaptchaField  # < 4.0

Until this is merged, I reckon you can add django_recaptcha < 4 in your own requirements.

@tacitus @haydngreatnews Do you think someone can look at this issue, this is breaking some builds.

loicteixeira avatar Nov 19 '23 14:11 loicteixeira

Hi there, thanks for the contribution. Seeing as the interface to the widget has also changed, I think we should probably set a maximum version in the dependencies for this case, and make a point release.

I'll get started down that road now, and then look into merging #49 for a better time down the road, also.

Until then, I think @loicteixeira's suggestion, of setting the requirement explicitly in your project would be the best option.

haydngreatnews avatar Nov 20 '23 02:11 haydngreatnews

With the cloning of this repo by Torchbox into Torchbox Forks, it appears that Torchbox will now be maintaining wagtail-django-recaptcha. Their just-released version addresses the django_recaptcha namespace problem. Therefore, I'm closing this PR with an additional note to @thibaudcolas and @brylie that the PyPI project has not yet been updated.

Note: The Installation section on PyPI mentions cloning from Springload's private repo rather than using pip install wagtail-django-recaptcha.

DanielSwain avatar Nov 28 '23 14:11 DanielSwain

@DanielSwain Torchbox isn’t maintaining wagtail-django-recaptcha. We do have @katdom13 from Torchbox contributing to this project via maintenance-related PRs like #49. I work for Torchbox and have access to the package on PyPI but only because I used to help maintain this project at Springload years ago. Please see our description of the purpose of torchbox-forks for more info about our fork.

So I’d recommend keeping this PR open. Regardless of who maintains the package, they’ll benefit from this work.


And as far as future maintenance of this package, let’s keep chatting in #51 ?

thibaudcolas avatar Dec 08 '23 11:12 thibaudcolas

Reopening per the comment from @thibaudcolas above.

DanielSwain avatar Dec 08 '23 14:12 DanielSwain

Hello everyone, any ideas when this will be fixed or can a workaround be provided?

raudu avatar Jan 24 '24 11:01 raudu

Hello everyone, any ideas when this will be fixed or can a workaround be provided?

The workaround is above. Go into the package folder in your virtual environment, edit forms.py and update the import manually until this is resolved.

https://github.com/springload/wagtail-django-recaptcha/pull/50#pullrequestreview-1738739252

enzedonline avatar Jan 26 '24 00:01 enzedonline

@brylie Any chance you could review this - it seems you're the only one with access to do this

enzedonline avatar Apr 15 '24 22:04 enzedonline

As of 14th opf September 2024 the issue still remains. Any news on of this is going to be fixed?

seanpaulharsevoort avatar Sep 14 '24 19:09 seanpaulharsevoort

This package has been updated as of v2.1.1 to support django-recaptcha 4+, and drop support for previous versions

If you have a particular need to run django-recaptcha < 3, then I would recommend you use an older version of this package, or specifically state your case here.

haydngreatnews avatar Sep 15 '24 23:09 haydngreatnews