Accessing github from work is annoying.
I hope someone else in the world files a bug soon on flake8 not being compatible with a fresh python 3.12+ virtualenv, now that setuptools 82 is out and flake8 is still using the deprecated (now removed) pkg_resources.

clacke: exhausted pixie dream boy πΈπͺππ°ππ
in reply to clacke: exhausted pixie dream boy πΈπͺππ°ππ • • •For some reason our python 3.10 nightlies are still working, because they get setuptools 80.9.0. Does virtualenv include a setuptools in the environment on 3.10, but not on 3.12+?
If the environment had to install setuptools, it would get 82 and break. There is no caching, it's being built fresh.
David Zaslavsky
in reply to clacke: exhausted pixie dream boy πΈπͺππ°ππ • • •Yeah I think that's right, they dropped setuptools from some default configurations on 3.12+. Or at least that's when distutils was removed from the standard library, and I *think* removal of setuptools from places happened at the same time, but don't take my word for that part, I might be misremembering.
I wasn't able to reproduce the problem you described, though. I made a 3.12 venv and installed and tested flake8, both from PyPI and from source, and it works fine. Could you share more details? I wouldn't mind filing a bug report if you want, but I'd have to know what I'm reporting and be able to trigger it myself.
#Python
clacke: exhausted pixie dream boy πΈπͺππ°ππ likes this.
clacke: exhausted pixie dream boy πΈπͺππ°ππ
in reply to David Zaslavsky • • •@David Zaslavsky I'm using flake8 with a plugin, and it breaks when finding the plugin.
Specifically flake8-import-order, but should break on any plugin.
flake8/plugins/finder.py breaks with flake8.exceptions.FailedToLoadPlugins "...due to No module named 'pkg_resources'".
clacke: exhausted pixie dream boy πΈπͺππ°ππ
in reply to clacke: exhausted pixie dream boy πΈπͺππ°ππ • • •@David Zaslavsky Oh! Maybe I'm wrong!
It's flake8 reporting it, but the plugin is importing pkg_resources and flake8 isn't, so it must be flake8 catching the error and masking the origin.
That's why no issues on flake8! Thank you for the feedback.
David Zaslavsky
in reply to clacke: exhausted pixie dream boy πΈπͺππ°ππ • • •Ah yep that sounds more like it. Though even with the plugin I wasn't able to reproduce it. I ran this shell script:
python3.12 -m venv venv
source venv/bin/activate
python -m pip install flake8 flake8-import-order
cat >something.py <<EOF
from flake8_import_order.styles import Cryptography
import sys
print(sys.path, repr(Cryptography))
EOF
python -m flake8 something.py
and it gave the expected error message about the imports being out of order.
clacke: exhausted pixie dream boy πΈπͺππ°ππ
in reply to David Zaslavsky • • •David Zaslavsky
in reply to clacke: exhausted pixie dream boy πΈπͺππ°ππ • • •clacke: exhausted pixie dream boy πΈπͺππ°ππ
in reply to clacke: exhausted pixie dream boy πΈπͺππ°ππ • • •Yep. Fixed!
Thank you @David Zaslavsky for prodding me to solve this instead of just pinning setuptools. π
David Zaslavsky
in reply to clacke: exhausted pixie dream boy πΈπͺππ°ππ • • •clacke: exhausted pixie dream boy πΈπͺππ°ππ likes this.
clacke: exhausted pixie dream boy πΈπͺππ°ππ
in reply to clacke: exhausted pixie dream boy πΈπͺππ°ππ • • •Things bumped this week to fix pkg_resources deprecation:
- flake8-import-order
- connexion
- jsonschema
Flask 2.0 has a pkg_resources reference that was fixed in 2.1, but we don't seem to be triggering it.
clacke: exhausted pixie dream boy πΈπͺππ°ππ
in reply to clacke: exhausted pixie dream boy πΈπͺππ°ππ • • •Found this out
/via pull request "Replace pkg_resources with importlib.metadata #203" (2025-06-09)
github.com/PyCQA/flake8-importβ¦
/via issue "DeprecationWarning: pkg_resources is deprecated as an API on python 3.11 #201" (2023-12-08)
github.com/PyCQA/flake8-importβ¦
clacke: exhausted pixie dream boy πΈπͺππ°ππ
in reply to clacke: exhausted pixie dream boy πΈπͺππ°ππ • • •Yup, that's exactly what's happening. (confirmed with virtualenv 20.35.3 and latest, 20.36.1)
clacke: exhausted pixie dream boy πΈπͺππ°ππ
in reply to clacke: exhausted pixie dream boy πΈπͺππ°ππ • • •Other packages we have upgraded to fix pkg_resources dependency:
- jsonschema ( libranet.de/display/0b6b25a8-1… )
- connexion
For some reason we don't have to bump flask to 2.1+ across the board. It seems that even though a quick examination shows that flask.cli is imported by flask root, and flask.cli imports pkg_resources, in practice it's done in such a way or context that our application code does not break.
c
Other packages we have upgraded to fix pkg_resources dependency:
- jsonschema ( libranet.de/display/0b6b25a8-1β¦ )
- connexion
For some reason we don't have to bump flask to 2.1+ across the board. It seems that even though a quick examination shows that flask.cli is imported by flask root, and flask.cli imports pkg_resources, in practice it's done in such a way or context that our application code does not break.
clacke: exhausted pixie dream boy πΈπͺππ°ππ
2026-02-10 11:30:46