jazzband / django-formtools

A set of high-level abstractions for Django forms
https://django-formtools.readthedocs.io
BSD 3-Clause "New" or "Revised" License
784 stars 135 forks source link

pkg_resources in current release (2.4.1) clashes with python 3.12 default venv #250

Closed ideesnoires closed 8 months ago

ideesnoires commented 9 months ago

please make a new release, it's fixed in HEAD https://github.com/jazzband/django-formtools/commit/653c82cf27d5f21c3691efded466ac70659ff1c1

here the python docs: https://docs.python.org/3/whatsnew/3.12.html#summary-release-highlights "Do not pre-install setuptools in virtual environments created with venv. This means that distutils, setuptools, pkg_resources, and easy_install will no longer available by default; to access these run pip install setuptools in the activated virtual environment."

AmoahDevLabs commented 8 months ago

This issue is with Python 3.12 and I suggest it should be fixed in no time because some projects using django-formtools are broken after system upgrade (Fedora 39). I guess all other distros that switched to Python 3.12 are having this issue as well.

Error:

venv/lib/python3.12/site-packages/formtools/init.py", line 2, in from pkg_resources import DistributionNotFound, get_distribution ModuleNotFoundError: No module named 'pkg_resources'

Where pkg_resources is called: "venv/lib/python3.12/site-packages/formtools/init.py",

import django from pkg_resources import DistributionNotFound, get_distribution

try: version = get_distribution("django-formtools").version except DistributionNotFound:

package is not installed

__version__ = None

if django.VERSION <= (3, 2): default_app_config = 'formtools.apps.FormToolsConfig'

claudep commented 8 months ago

Closing as it's fixed in head. #253, then #254 will produce a new release.