You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some of the vendored libraries, e.g. rope and pylama, depend on pkg_resources, but pkg_resources itself is not vendored. Should it be vendored as well?
Background
I'm setting up python-mode using home-manager. home-manager is a package manager that installs neovim, python, etc. To keep it brief, home-manager is very careful about dependencies and the python environment that it sets up for python-mode does not include pkg-resources. So I'm wondering if this should be fixed in python-mode or elsewhere, in the code that creates the Python environment that python-mode uses.
That would be something we can do, indeed (this dependency on setuptools/pkg_resources was a real pain some time ago in this project).
But I was looking at the package website and saw this warning:
Use of pkg_resources is deprecated in favor of importlib.resources, importlib.metadata and their backports (importlib_resources, importlib_metadata). Some useful APIs are also provided by packaging (e.g. requirements and version parsing). Users should refrain from new usage of pkg_resources and should work to port to importlib-based solutions.
So, I was wonder. Would it make more sense to add pkg_resources as a vendored lib in this project or try to replace it in the upstream projects? (honest question!)
I think the effort to replace them in the upstream packages may be smaller than vendoring it over here, but this is just a guess from my side.
My 2 cents, pkg_resources is causing a bunch of issues on an older version of Ubuntu, whenever I run pdm sync or poetry install it removes pkg_ressource==0.0.0 that comes with virtualenv and installs the newest version from pypi. A side effect is that python-mode breaks. Pain!
Would it make more sense to add pkg_resources as a vendored lib in this project or try to replace it in the upstream projects? (honest question!)
I think it would be better to replace it in upstream projects, because of the information you cited, and the fact that importlib.resources has been in the standard library since Python 3.7, which presumably means no one has to vendor it.
I manually vendored setuptools/pkg_resources in my local install and it solved issues with pylama importing. pylama has a single import form pkg_resources and there hasn't been development activity there in some time.
Hey folks, sorry for the long time without news here.
A small kid around the house has consumed all my time to side projects (and I haven't been using the plugin on a daily basis also).
Anyway...
I've just sent a quite big refactor on the project test flow, using docker, and I've also added test steps for newer python versions. (actually, I'm dropping support for python prior to 3.10 since it up to 3.9 is already quite old).
I still need to warm up my mind with the plugin code, but I would love to have it improved - and any help will be very much welcome by the way!
Things like eventually replacing some of the submodules with ruff and deprecating old stuff (such as these dependencies) as much as possible.
Activity
diraol commentedon Jun 27, 2023
Hi @mkohler ! Thanks for reporting it.
That would be something we can do, indeed (this dependency on setuptools/pkg_resources was a real pain some time ago in this project).
But I was looking at the package website and saw this warning:
So, I was wonder. Would it make more sense to add
pkg_resourcesas a vendored lib in this project or try to replace it in the upstream projects? (honest question!)I think the effort to replace them in the upstream packages may be smaller than vendoring it over here, but this is just a guess from my side.
Drachenfels commentedon Jul 12, 2023
My 2 cents, pkg_resources is causing a bunch of issues on an older version of Ubuntu, whenever I run pdm sync or poetry install it removes pkg_ressource==0.0.0 that comes with virtualenv and installs the newest version from pypi. A side effect is that python-mode breaks. Pain!
mkohler commentedon Aug 12, 2023
I think it would be better to replace it in upstream projects, because of the information you cited, and the fact that
importlib.resourceshas been in the standard library since Python 3.7, which presumably means no one has to vendor it.moorepants commentedon May 25, 2024
I manually vendored setuptools/pkg_resources in my local install and it solved issues with pylama importing. pylama has a single import form pkg_resources and there hasn't been development activity there in some time.
rmax commentedon Oct 26, 2024
There is a pylama PR for this klen/pylama#254
pykler commentedon Jul 12, 2025
@mkohler I guess this is still not fixed, this is what I ended up doing to get it working in nixos home-manager
diraol commentedon Jul 12, 2025
Hey folks, sorry for the long time without news here.
A small kid around the house has consumed all my time to side projects (and I haven't been using the plugin on a daily basis also).
Anyway...
I've just sent a quite big refactor on the project test flow, using docker, and I've also added test steps for newer python versions. (actually, I'm dropping support for python prior to 3.10 since it up to 3.9 is already quite old).
I still need to warm up my mind with the plugin code, but I would love to have it improved - and any help will be very much welcome by the way!
Things like eventually replacing some of the submodules with ruff and deprecating old stuff (such as these dependencies) as much as possible.
Again all help will be very much welcome.
diraol commentedon Jul 12, 2025
I've opened a new issue for us to discuss a bit, as community, what's the best approach.
#1190
Please, send your contributions there.