Conversation
The ::attr() fix (#167/#175) had selector.py importing adaptive.py's private _attr_str, coupling the selector to the adaptive module's internals. Move the normalization helpers to pyscrappy.generic._attrs (attr_to_str / attr_to_list); adaptive.py and selector.py both import from there. No API or behavior change.
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.
Cuts the 1.6.0 release. A small internal refactor plus the CHANGELOG for the contributor fixes merged since 1.5.9.
Refactor
The
::attr()fix (#167 via #175) leftselector.pyimportingadaptive.py's private_attr_str, coupling the selector to the adaptive module's internals (a rename there would silently break the selector). Moved the normalization helpers to a sharedpyscrappy.generic._attrsmodule (attr_to_str/attr_to_list); bothadaptive.pyandselector.pyimport from it. No API or behavior change.CHANGELOG (1.6.0)
Records the contributor fixes already merged to main since 1.5.9:
::attr()normalizes multi-valued attributes (::attr() returns a Python list repr for multi-valued attributes (class, rel, …) #167)to_markdown()preserves ragged table cells (to_markdown() drops surplus cells from ragged tables (defeats TableExtractor's guarantee) #168)to_markdown()doesn't crash on a malformed heading level (to_markdown() crashes on a heading whose level isn't h1-h6 #176)_attrsrefactor above.Version
Bumped to 1.6.0 across all four sites (pyproject,
__init__, server.json x2). Patch was at.9, so this rolls to the next minor.Testing
::attr(class)still returns"x y",adaptiveno longer exposes_attr_str, adaptive+selector tests green.