pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/devel/py-pyparsing



Module Name:    pkgsrc
Committed By:   adam
Date:           Mon Oct 14 17:01:57 UTC 2024

Modified Files:
        pkgsrc/devel/py-pyparsing: Makefile distinfo

Log Message:
py-pyparsing: updated to 3.2.0

Version 3.2.0 - October, 2024

- Discontinued support for Python 3.6, 3.7, and 3.8. Adopted new Python features from
  Python versions 3.7-3.9:
  - Updated type annotations to use built-in container types instead of names
    imported from the `typing` module (e.g., `list[str]` vs `List[str]`).
  - Reworked portions of the packrat cache to leverage insertion-preserving ordering
    in dicts (including removal of uses of `OrderedDict`).
  - Changed `pdb.set_trace()` call in `ParserElement.set_break()` to `breakpoint()`.
  - Converted `typing.NamedTuple` to `dataclasses.dataclass` in railroad diagramming
    code.
  - Added `from __future__ import annotations` to clean up some type annotations.

- POSSIBLE BREAKING CHANGES

    The following bugfixes may result in subtle changes in the results returned or
    exceptions raised by pyparsing.

    - Fixed code in `ParseElementEnhance` subclasses that
      replaced 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 whitespace
      in the input string was not properly preserved in the output string.

      If your code uses `transform_string`, this bugfix may require changes in
      your code.

    - Fixed bug where an `IndexError` raised in a parse action was
      incorrectly handled as an `IndexError` raised as part of the `ParserElement`
      parsing methods, and reraised as a `ParseException`. Now an `IndexError`
      that raises inside a parse action will properly propagate out as an `IndexError`.

      If your code raises `IndexError`s in parse actions, this bugfix may require
      changes in your code.

- FIXES AND NEW FEATURES

    - Added type annotations to remainder of `pyparsing` package, and added `mypy`
      run to `tox.ini`, so that type annotations are now run as part of pyparsing's CI.

    - Exception message format can now be customized, by overriding
      `ParseBaseException.format_message`:

          def custom_exception_message(exc) -> str:
              found_phrase = f", found {exc.found}" if exc.found else ""
              return f"{exc.lineno}:{exc.column} {exc.msg}{found_phrase}"

          ParseBaseException.formatted_message = custom_exception_message

    - `run_tests` now detects if an exception is raised in a parse action, and will
      report it with an enhanced error message, with the exception type, string,
      and parse action name.

    - `QuotedString` now handles translation of escaped integer, hex, octal, and
      Unicode sequences to their corresponding characters.

    - Fixed the displayed output of `Regex` terms 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 Regex element
      defined 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`.

    - `Regex` instances can now be created using a callable that takes no arguments
      and 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 `flatten` Boolean argument to `ParseResults.as_list()`, to
      return the parsed values in a flattened list.

    - Added `indent` and `base_1` arguments to `pyparsing.testing.with_line_numbers`. When
      using `with_line_numbers` inside a parse action, set `base_1`=False, since the
      reported `loc` value is 0-based. `indent` can be a leading string (typically of
      spaces or tabs) to indent the numbered string passed to `with_line_numbers`.

- NEW/ENHANCED EXAMPLES

    - Added query syntax to `mongodb_query_expression.py` with:
      - better support for array fields ("contains all",
        "contains any", and "contains none")
      - "like" and "not like" operators to support SQL "%" wildcard matching
        and "=~" operator to support regex matching
      - text search using "search for"
      - dates and datetimes as query values
      - `a[0]` style array referencing

    - Added `lox_parser.py` example, a parser for the Lox language used as a tutorial in
      Robert Nystrom's "Crafting Interpreters" (http://craftinginterpreters.com/).
      With helpful corrections from RoDuth.

    - Added `complex_chemical_formulas.py` example, to add parsing capability for
      formulas such as "3(C₆H₅OH)₂".

    - Updated `tag_emitter.py` to use new `Tag` class, introduced in pyparsing
      3.1.3.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 pkgsrc/devel/py-pyparsing/Makefile
cvs rdiff -u -r1.31 -r1.32 pkgsrc/devel/py-pyparsing/distinfo

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/devel/py-pyparsing/Makefile
diff -u pkgsrc/devel/py-pyparsing/Makefile:1.33 pkgsrc/devel/py-pyparsing/Makefile:1.34
--- pkgsrc/devel/py-pyparsing/Makefile:1.33     Mon Aug 26 14:58:06 2024
+++ pkgsrc/devel/py-pyparsing/Makefile  Mon Oct 14 17:01:57 2024
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.33 2024/08/26 14:58:06 adam Exp $
+# $NetBSD: Makefile,v 1.34 2024/10/14 17:01:57 adam Exp $
 
-DISTNAME=      pyparsing-3.1.4
+DISTNAME=      pyparsing-3.2.0
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
 CATEGORIES=    devel python
 MASTER_SITES=  ${MASTER_SITE_PYPI:=p/pyparsing/}

Index: pkgsrc/devel/py-pyparsing/distinfo
diff -u pkgsrc/devel/py-pyparsing/distinfo:1.31 pkgsrc/devel/py-pyparsing/distinfo:1.32
--- pkgsrc/devel/py-pyparsing/distinfo:1.31     Mon Aug 26 14:58:06 2024
+++ pkgsrc/devel/py-pyparsing/distinfo  Mon Oct 14 17:01:57 2024
@@ -1,5 +1,5 @@
-$NetBSD: distinfo,v 1.31 2024/08/26 14:58:06 adam Exp $
+$NetBSD: distinfo,v 1.32 2024/10/14 17:01:57 adam Exp $
 
-BLAKE2s (pyparsing-3.1.4.tar.gz) = df048ef1feb94c8ea769f4ab2ec5e98a86235acbca3ad5b5f3f7bf90b669ed97
-SHA512 (pyparsing-3.1.4.tar.gz) = b475e5571510cd7b07fecbc8ae583b1e75a6308b64018d2884570dfa461e0529b96d02d11403cecac41f92b5d802a5dd4bbf9f8321d58ffa2d24cb89b86652e1
-Size (pyparsing-3.1.4.tar.gz) = 900231 bytes
+BLAKE2s (pyparsing-3.2.0.tar.gz) = 7d21a4ce94d1e957c13d99783196f1048992d99f8339bedeab40d017ee6882bc
+SHA512 (pyparsing-3.2.0.tar.gz) = 0a3096f07c41d3ff954c9aba8bd259a1c8af7ecb391add863e5743262b34778d32f05a617736295dcadbda80d94ca9af2e395a2077f616ac4d1557459a0b7cff
+Size (pyparsing-3.2.0.tar.gz) = 920984 bytes



Home | Main Index | Thread Index | Old Index