fix(deps): raise tldextract floor to >=5.3.0 to avoid AttributeError on same-domain enqueue#2031
Merged
Merged
Conversation
`_domain_under_public_suffix` in `src/crawlee/_utils/urls.py` reads the `top_domain_under_public_suffix` property of tldextract's `ExtractResult`, which was only added in tldextract 5.3.0. The dependency constraint still allowed `tldextract>=5.1.0`, so installing a resolved tldextract in the 5.1.0-5.2.x range raises `AttributeError: 'ExtractResult' object has no attribute 'top_domain_under_public_suffix'` on the `same-domain` enqueue strategy (and anywhere else registrable-domain matching runs). The bundled lockfile resolves a newer tldextract, so CI never exercises the old versions the metadata permits. Bump the floor to `>=5.3.0` to match the code. Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
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.
_domain_under_public_suffixinsrc/crawlee/_utils/urls.pyreads thetop_domain_under_public_suffixproperty of tldextract'sExtractResult:That property was added in tldextract 5.3.0 (2025-04-21), but the dependency
constraint in
pyproject.tomlis stilltldextract>=5.1.0. Any environment thatresolves tldextract into the permitted
5.1.0-5.2.xrange therefore raisesthe first time registrable-domain matching runs, i.e. on the
same-domainenqueue strategy (
_matches_enqueue_strategy). The bundleduv.lockpins anewer tldextract, so CI always runs a version that has the property and never
exercises the older versions the metadata still allows.
This bumps the floor to
>=5.3.0to match the code.top_domain_under_public_suffixis the only tldextract result property used anywhere in
src/, so 5.3.0 isexactly the version that introduced the API the code relies on. It is a
metadata-only change; the currently resolved tldextract already satisfies the
new floor, so
uv.lockneeds no re-resolution beyond the mirrored specifierline.
Issues
Testing
uv lock --checkpasses (lockfile stays consistent with the new floor).uv run pytest tests/unit/_utils/test_urls.py-> 28 passed, including thesame-domainparametrizations that exercise the property.uv run poe lintpasses (ruff format check + ruff check).red->green against the resolved tldextract (which already has the property);
the
same-domainpath is already covered by the existing URL filter tests.Checklist