Skip to main content


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.

#flake8 #python #setuptools

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.

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

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'".

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.

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.

in reply to clacke: exhausted pixie dream boy πŸ‡ΈπŸ‡ͺπŸ‡­πŸ‡°πŸ’™πŸ’›

This entry was edited (2 days ago)
⇧