chore(deps): update dependency pyparsing to v3.3.2 #11
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.
This PR contains the following updates:
==3.0.9→==3.3.2Release Notes
pyparsing/pyparsing (pyparsing)
v3.3.2Compare Source
Defined pyparsing-specific warning classes so that they can be selectively enabled
or disabled without affecting warnings raised by other libraries in the same Python
app:
PyparsingWarning- base warning for all pyparsing-specific warnings (inheritsfrom
UserWarning)PyparsingDeprecationWarning- warning for using deprecated features (inheritsfrom
PyparsingWarningandDeprecationWarning)PyparsingDiagnosticWarning- warning raised when pyparsing diagnostics areenabled and a diagnostic feature is used (inherits from
PyparsingWarning)Added
as_datetimeparse action topyparsing.common- a more generalizedversion of the
convert_to_datetimeparse action (supports any expression that extractsdate/time fields into "year", "month", "day", etc. results names), and validates
that the parsed fields represent a valid date and time.
Added
iso8601_date_validatedandiso8601_datetime_validatedexpressions topyparsing.common, which return a Pythondatetime.datetimeVarious performance improvements in
ParseResultsclass and core functions, with10-20% performance overall.
Added
regex_inverterweb page (using PyScript) to demonstrate using theinv_regex.pyexample.
Expanded regex forms handled by the
examples/inv_regex.pyexample:?P<name>){m,}and{,n})[^...])Added
SPy(Simplified Python) parser to examples.v3.3.1Compare Source
Marc Mueller for submitted issue and PR. Fixes #626.
v3.3.0Compare Source
===========================================================================================
The version 3.3.0 release will begin emitting
DeprecationWarningsfor pyparsing methodsthat have been renamed to PEP8-compliant names (introduced in pyparsing 3.0.0, in August,
2021, with legacy names retained as aliases). In preparation, I added in pyparsing
3.2.2 a utility for finding and replacing the legacy method names with the new names.
This utility is located at
pyparsing/tools/cvt_pep8_names.py. This script will scan allPython files specified on the command line, and if the
-uoption is selected, willreplace all occurrences of the old method names with the new PEP8-compliant names,
updating the files in place.
Here is an example that converts all the files in the pyparsing
/examplesdirectory:v3.2.5Compare Source
Wordexpressions that include a spacecharacter, if that expression was then copied, either directly with .copy() or
by adding a results name, or included in another construct (like
DelimitedList)that makes a copy internally. Issue #618, reported by mstinberg, among others -
thanks, and sorry for the inconvenience.
v3.2.4Compare Source
Barring any catastrophic bugs in this release, this will be the last release in
the 3.2.x line. The next release, 3.3.0, will begin emitting
DeprecationWarningswhen the pre-PEP8 methods are used (see header notes above for more information,
including available automation for converting any existing code using
pyparsing with the old names).
Fixed bug when using a copy of a
Wordexpression (either by using the explicitcopy()method, or attaching a results name), and setting a new expression name,a raised
ParseExceptionstill used the original expression name. Also affectedRegexexpressions withas_matchoras_group_list= True. Reported byWaqas Ilyas, in Issue #612 - good catch!
Fixed type annotation for
replace_with, to acceptAnytype. Fixes Issue #602,reported by esquonk.
Added locking around potential race condition in
ParserElement.reset_cache, aswell as other cache-related methods. Fixes Issue #604, reported by CarlosDescalziIM.
Substantial update to docstrings and doc generation in preparation for 3.3.0,
great effort by FeRD, thanks!
Notable addition by FeRD to convert docstring examples to work with doctest! This
was long overdue, thanks so much!
v3.2.3Compare Source
nested_exprcould overwrite parse actionsfor defined content, and could truncate list of items within a nested list.
Fixes Issue #600, reported by hoxbro and luisglft, with helpful diag logs and
repro code.
v3.2.2Compare Source
Released
cvt_pyparsing_pep8_names.pyconversion utility to upgrade pyparsing-basedprograms and libraries that use legacy camelCase names to use the new PEP8-compliant
snake_case method names. The converter can also be imported into other scripts as
Fixed bug in
nested_exprwhere nested contents were stripped of whitespace whenthe default whitespace characters were cleared (raised in this StackOverflow
question https://stackoverflow.com/questions/79327649 by Ben Alan). Also addressed
bug in resolving PEP8 compliant argument name and legacy argument name.
Fixed bug in
rest_of_lineand the underlyingRegexclass, in which matching apattern that could match an empty string (such as
".*"or"[A-Z]*"would not raisea
ParseExceptionat or beyond the end of the input string. This could cause aninfinite parsing loop when parsing
rest_of_lineat the end of the input string.Reported by user Kylotan, thanks! (Issue #593)
Enhancements and extra input validation for
pyparsing.util.make_compressed_re- seeusage in
examples/complex_chemical_formulas.pyand result in the generated railroaddiagram
examples/complex_chemical_formulas_diagram.html. Properly escapes characterslike "." and "*" that have special meaning in regular expressions.
Fixed bug in
one_of()to properly escape characters that are regular expression markers(such as '*', '+', '?', etc.) before building the internal regex.
Better exception message for
MatchFirstandOrexpressions, showing all alternativesrather than just the first one. Fixes Issue #592, reported by Focke, thanks!
Added return type annotation of "-> None" for all
__init__()methods, to satisfymypy --stricttype checking. PR submitted by FeRD, thank you!Added optional argument
show_hiddentocreate_diagramto showelements that are used internally by pyparsing, but are not part of the actual
parser grammar. For instance, the
Tagclass can insert values into the parsedresults but it does not actually parse any input, so by default it is not included
in a railroad diagram. By calling
create_diagramwithshow_hidden = True,these internal elements will be included. (You can see this in the tag_metadata.py
script in the examples directory.)
Fixed bug in
number_words.pyexample. Also addedebnf_number_words.pyto demonstrateusing the
ebnf.pyEBNF parser generator to build a similar parser directly fromEBNF.
Fixed syntax warning raised in
bigquery_view_parser.py, invalid escape sequence "\s".Reported by sameer-google, nice catch! (Issue #598)
Added support for Python 3.14.
v3.2.1Compare Source
Updated generated railroad diagrams to make non-terminal elements links to their related
sub-diagrams. This greatly improves navigation of the diagram, especially for
large, complex parsers.
Simplified railroad diagrams emitted for parsers using
infix_notation, by hidinglookahead terms. Renamed internally generated expressions for clarity, and improved
diagramming.
Improved performance of
cpp_style_comment,c_style_comment,common.fnumberand
common.ieee_floatRegexexpressions. PRs submitted by Gabriel Gerlero,nice work, thanks!
Add missing type annotations to
match_only_at_col,replace_with,remove_quotes,with_attribute, andwith_class. Issue #585 reported by rafrafrek.Added generated diagrams for many of the examples.
Replaced old
examples/0README.htmlfile withexamples/README.mdfile.v3.2.0Compare Source
Discontinued support for Python 3.6, 3.7, and 3.8. Adopted new Python features from
Python versions 3.7-3.9:
imported from the
typingmodule (e.g.,list[str]vsList[str]).in dicts (including removal of uses of
OrderedDict).pdb.set_trace()call inParserElement.set_break()tobreakpoint().typing.NamedTupletodataclasses.dataclassin railroad diagrammingcode.
from __future__ import annotationsto clean up some type annotations.(with assistance from ISyncWithFoo, issue #535, thanks for the help!)
POSSIBLE BREAKING CHANGES
The following bugfixes may result in subtle changes in the results returned or
exceptions raised by pyparsing.
Fixed code in
ParseElementEnhancesubclasses thatreplaced detailed exception messages raised in contained expressions with a
less-specific and less-informative generic exception message and location.
If your code has conditional logic based on the message content in raised
ParseExceptions, this bugfix may require changes in your code.Fixed bug in
transform_string()where whitespacein the input string was not properly preserved in the output string.
If your code uses
transform_string, this bugfix may require changes inyour code.
Fixed bug where an
IndexErrorraised in a parse action wasincorrectly handled as an
IndexErrorraised as part of theParserElementparsing methods, and reraised as a
ParseException. Now anIndexErrorthat raises inside a parse action will properly propagate out as an
IndexError.(Issue #573, reported by August Karlstedt, thanks!)
If your code raises
IndexErrors in parse actions, this bugfix may requirechanges in your code.
FIXES AND NEW FEATURES
Added type annotations to remainder of
pyparsingpackage, and addedmypyrun to
tox.ini, so that type annotations are now run as part of pyparsing's CI.Addresses Issue #373, raised by Iwan Aucamp, thanks!
Exception message format can now be customized, by overriding
ParseBaseException.format_message:(PR #571 submitted by Odysseyas Krystalakos, nice work!)
run_testsnow detects if an exception is raised in a parse action, and willreport it with an enhanced error message, with the exception type, string,
and parse action name.
QuotedStringnow handles translation of escaped integer, hex, octal, andUnicode sequences to their corresponding characters.
Fixed the displayed output of
Regexterms to deduplicate repeated backslashes,for easier reading in debugging, printing, and railroad diagrams.
Fixed (or at least reduced) elusive bug when generating railroad diagrams,
where some diagram elements were just empty blocks. Fix submitted by RoDuth,
thanks a ton!
Fixed railroad diagrams that get generated with a parser containing a
Regexelementdefined using a verbose pattern - the pattern gets flattened and comments removed
before creating the corresponding diagram element.
Defined a more performant regular expression used internally by
common_html_entity.Regexinstances can now be created using a callable that takes no argumentsand just returns a string or a compiled regular expression, so that creating complex
regular expression patterns can be deferred until they are actually used for the first
time in the parser.
Added optional
flattenBoolean argument toParseResults.as_list(), toreturn the parsed values in a flattened list.
Added
indentandbase_1arguments topyparsing.testing.with_line_numbers. Whenusing
with_line_numbersinside a parse action, setbase_1=False, since thereported
locvalue is 0-based.indentcan be a leading string (typically ofspaces or tabs) to indent the numbered string passed to
with_line_numbers.Added while working on #557, reported by Bernd Wechner.
NEW/ENHANCED EXAMPLES
Added query syntax to
mongodb_query_expression.pywith:"contains any", and "contains none")
and "=~" operator to support regex matching
a[0]style array referencingAdded
lox_parser.pyexample, a parser for the Lox language used as a tutorial inRobert Nystrom's "Crafting Interpreters" (http://craftinginterpreters.com/).
With helpful corrections from RoDuth.
Added
complex_chemical_formulas.pyexample, to add parsing capability forformulas such as "3(C₆H₅OH)₂".
Updated
tag_emitter.pyto use newTagclass, introduced in pyparsing3.1.3.
v3.1.4Compare Source
referenced
re.Pattern. Since this type was introduced in Python 3.7, using this typedefinition broke Python 3.6 installs of pyparsing 3.1.3. PR submitted by Felix Fontein,
nice work!
v3.1.3Compare Source
Added new
TagParserElement, for inserting metadata into the parsed results.This allows a parser to add metadata or annotations to the parsed tokens.
The
Tagelement also accepts an optionalvalueparameter, defaulting toTrue.See the new
tag_metadata.pyexample in theexamplesdirectory.Example:
add tag indicating mood
prints:
Added example
mongodb_query_expression.py, to convert human-readable infix queryexpressions (such as
a==100 and b>=200) and transform them into the equivalentquery argument for the pymongo package (
{'$and': [{'a': 100}, {'b': {'$gte': 200}}]}).Supports many equality and inequality operators - see the docstring for the
transform_queryfunction for more examples.Fixed issue where PEP8 compatibility names for
ParserElementstatic methods werenot themselves defined as
staticmethods. When called using aParserElementinstance,this resulted in a
TypeErrorexception. Reported by eylenburg (#548).To address a compatibility issue in RDFLib, added a property setter for the
ParserElement.nameproperty, to callParserElement.set_name.Modified
ParserElement.set_name()to accept a None value, to clear the definedname and corresponding error message for a
ParserElement.Updated railroad diagram generation for
ZeroOrMoreandOneOrMoreexpressions withstop_onexpressions, while investigating #558, reported by user Gu_f.Added
<META>tag to HTML generated for railroad diagrams to force UTF-8 encodingwith older browsers, to better display Unicode parser characters.
Fixed some cosmetics/bugs in railroad diagrams:
show_groups=Falseshow_results_names=TrueSome type annotations added for parse action related methods, thanks August
Karlstedt (#551).
Added exception type to
trace_parse_actionexception output, while investigatingSO question posted by medihack.
Added
set_namecalls to internal expressions generated ininfix_notation, forimproved railroad diagramming.
delta_time,lua_parser,decaf_parser, androman_numeralsexamples cleaned upto use latest PEP8 names and add minor enhancements.
Fixed bug (and corresponding test code) in
delta_timeexample that did not handleweekday references in time expressions (like "Monday at 4pm") when the weekday was
the same as the current weekday.
Minor performance speedup in
trim_arity, to benefit any parsers using parse actions.Added early testing support for Python 3.13 with JIT enabled.
v3.1.2Compare Source
Added
ieee_floatexpression topyparsing.common, which parses float values,plus "NaN", "Inf", "Infinity". PR submitted by Bob Peterson (#538).
Updated pep8 synonym wrappers for better type checking compatibility. PR submitted
by Ricardo Coccioli (#507).
Fixed empty error message bug, PR submitted by InSync (#534). This should return
pyparsing's exception messages to a former, more helpful form. If you have code that
parses the exception messages returned by pyparsing, this may require some code
changes.
Added unit tests to test for exception message contents, with enhancement to
pyparsing.testing.assertRaisesParseExceptionto accept an expected exception message.Updated example
select_parser.pyto use PEP8 names and added Groups for better retrievalof parsed values from multiple SELECT clauses.
Added example
email_address_parser.py, as suggested by John Byrd (#539).Added example
directx_x_file_parser.pyto parse DirectX template definitions, andgenerate a Pyparsing parser from a template to parse .x files.
Some code refactoring to reduce code nesting, PRs submitted by InSync.
All internal string expressions using '%' string interpolation and
str.format()converted to f-strings.
v3.1.1Fixed regression in Word(min), reported by Ricardo Coccioli, good catch! (Issue #502)
Fixed bug in bad exception messages raised by Forward expressions. PR submitted
by Kyle Sunden, thanks for your patience and collaboration on this (#493).
Fixed regression in SkipTo, where ignored expressions were not checked when looking
for the target expression. Reported by catcombo, Issue #500.
Fixed type annotation for enable_packrat, PR submitted by Mike Urbach, thanks! (Issue #498)
Some general internal code cleanup. (Instigated by Michal Čihař, Issue #488)
v3.1.0tag_emitter.pyto examples. This example demonstrates how to inserttags into your parsed results that are not part of the original parsed text.
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.