Replace pkg_resources with importlib_resources#91
Replace pkg_resources with importlib_resources#91tvuotila wants to merge 1 commit into4teamwork:masterfrom
Conversation
|
Is there anything I can do to get this merged? |
|
As python 3.12 is now the new stable python version and raise a deprecated warning on using pkg_resources api, this merge is really needed |
|
Was about to look into fixing this. Thanks @tvuotila for taking care of it. |
|
Hoping to see this merged soon ... |
|
I'm joining to the crowd waiting this PR merged soon... |
|
Bump |
|
Throw us a Christmas gift @lukasgraf Pretty please :-) |
|
Hoping to see this merged too... |
2 similar comments
|
Hoping to see this merged too... |
|
Hoping to see this merged too... |
|
Same. Maybe @buchi can help? |
|
+1 |
|
@buchi Save us please, deprecation warnings are ugly. |
|
can you tell me if this update will be included in the master branch? |
|
Hoping to see this merged too... |
|
bump |
|
Can this fix be merged and released soon? |
|
@lukasgraf is this on your radar? Dependants on docxtpl are currently getting this warning: Any help with this issue will be much appreciated by many! Best to you 😎 |
|
Hey @acanalis and everyone else, |
|
hi |
|
If people at 4teamwork are not interested in maintaining this anymore,
the repo might even be transferred rather than forked.
Could it be to [JazzBand](https://jazzband.co/about)? If only for
security, to avoid giving it to some anonymous GH account.
@buchi, is 4teamwork still interested in this? Would you be open to
transfer (this and PyPI project) to volunteers? You may even keep it
here and just invite external contributors.
|
from july 2025 |
|
@lukasgraf Who does still work for 4teamwork that you recommend reaching out to? Thanks! |
|
@jcardali, maybe @buchi. Looks like is the only one who touch the project after @lukasgraf quit. |
|
@etienned I tagged him in #105 (comment), but no response yet 🤞 |
|
@lukasgraf even if you're no longer with 4teamwork, perhaps you can point us to a reliable contact at the organization who could approve this PR and get eyes on making sure external contributors could approve a PR and publish a new version to PyPI? @buchi doesn't appear to be responsive. It looks like we're only a few weeks out from possible package removal on the 30th of this month; perhaps darkvision's repo or another fork will be the best alternative, but it'd be a shame to need to publish a new package to PyPI instead of a new version! |
|
is there any forked and fixed repository? I want to add to my pyproject directly from github |
setup.py
Outdated
| include_package_data=True, | ||
| zip_safe=True, | ||
| install_requires=[ | ||
| 'importlib-resources >= 1.3;python_version<"3.9"', |
There was a problem hiding this comment.
This backport needs to be imported differently: the module name is importlib_resources, not importlib.resources.
However, given that Python 3.8 EOL date was in October 2024, I think you can remove this backport completely and bump required Python to 3.9.
There was a problem hiding this comment.
You are completely right!
I will bump the required Python to 3.9.
Fixes 4teamwork#90 Require Python 3.9+, because importlib.resources.files is used.
|
I wish a maintainer would notice this pull request. |
|
setuptools 82 was released 9th Feb 2026 and has removed pkg_resources So importing docxcompose now causes This affects all python versions that setuptools is released for I suspect this will push someone to fork and publish a fixed version of this to pypi :) |
|
I think newer PR #113 should be preferred over this one :) |
|
I have published a new pypi package called docxcompose3 https://pypi.org/project/docxcompose3/ You should be able to simply swap your dependency to this and then work with newer setuptools Hopefully this can help others :) |
|
looks like the maintainer of this repo came back / was replaced and there is a new version 2. which supports latest setuptools! yah |
|
I will close this as the issue has been fixed on the main branch. |
Fixes #90
Use
importlib.resources.files(usage copied from documentation) instead of deprecatedpkg_resources.resource_string(function documentation).Install
importlib-resourcesbackport package on Python versions less than 3.9 (documentation on how to do that).importlib.resources.fileswas introduced in Python 3.9 (function documentation).Use minimum version of 1.3 forI was importing theimportlib-resourcespackage as that matches the Python 3.9 (compatibility table)importlib-resourcespackage wrong. I instead bumped the required Python version to 3.9.