setup.py: handle missing pkg_resources import#592
Open
chenrui333 wants to merge 1 commit intohtml5lib:masterfrom
Open
setup.py: handle missing pkg_resources import#592chenrui333 wants to merge 1 commit intohtml5lib:masterfrom
chenrui333 wants to merge 1 commit intohtml5lib:masterfrom
Conversation
Signed-off-by: Rui Chen <rui@chenrui.dev>
hswong3i
added a commit
to alvistack/html5lib-html5lib-python
that referenced
this pull request
Feb 10, 2026
git clean -xdf
tar zcvf ../python-html5lib_1.1.orig.tar.gz --exclude=.git .
debuild -uc -us
cp python-html5lib.spec ../python-html5lib_1.1-1.spec
cp ../python*-html5lib*1.1*.{gz,xz,spec,dsc} /osc/home\:alvistack/html5lib-html5lib-python-1.1/
rm -rf ../python*-html5lib*1.1*.*
See html5lib#583
See html5lib#587
See html5lib#592
Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
|
@chenrui333 will you also be doing a pull for pkg_resources use in html5lib/tests/conftest.py? |
loqs
reviewed
Feb 13, 2026
| from pkg_resources import parse_version | ||
| import pkg_resources | ||
| except ModuleNotFoundError: | ||
| from setuptools._vendor.packaging.version import parse as parse_version |
There was a problem hiding this comment.
@chenrui333 @grawlinson this does not work on Arch linux. The vendor namespace is an internal implementation detail that should not be relied upon. setuptools 82 that removed pkg_resources requires the packaging package so if pkg_resources is not provided by setuptools packing will be available not withstanding a broken installation.
There was a problem hiding this comment.
Like @loqs has said; It is 100% better to just do from packaging import parse as parse_version rather than depending on an internal implementation which will change at some point in the future.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
relates to Homebrew/homebrew-core#266589