bhch / django-jsonform

A better, user-friendly JSON editing form field for Django admin. Also supports Postgres ArrayField.
https://django-jsonform.rtfd.io
BSD 3-Clause "New" or "Revised" License
352 stars 34 forks source link

DeprecationWarning on pkg_resources usage #129

Closed alexgmin closed 1 year ago

alexgmin commented 1 year ago

https://github.com/bhch/django-jsonform/blob/d181aa4ecb0df4525e3b15b06facf42254ceca02/django_jsonform/models/fields.py#L6

This line throws this error: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html

After some investigation I see three options:

  1. Follow the recommended way and use packaging. This has the issue of adding a new dependency for a single check.
  2. Go back to the previous method of version checking before https://github.com/bhch/django-jsonform/pull/24
  3. Remove the check and drop support for versions to Django 3.1. Django only supports the 3.2 LTS, 4.1 and 4.2 at this moment. This would mean a breaking change so it should be a major release.

Depending on the problems that supporting old Django versions are having right now, I would suggest 2 or 3.

bhch commented 1 year ago

Thanks for the detailed issue. Option 2 seems most convenient. We'll go with that.