Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump pyparsing from 2.2.0 to 3.1.4 #173

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Sep 19, 2024

Bumps pyparsing from 2.2.0 to 3.1.4.

Release notes

Sourced from pyparsing's releases.

Pyparsing 3.1.0a1

NOTE: In the future release 3.2.0, use of many of the pre-PEP8 methods (such as ParserElement.parseString) will start to raise DeprecationWarnings. 3.2.0 should get released some time later in 2023. I currently plan to completely drop the pre-PEP8 methods in pyparsing 4.0, though we won't see that release until at least late 2023 if not 2024. So there is plenty of time to convert existing parsers to the new function names before the old functions are completely removed. (Big help from Devin J. Pohly in structuring the code to enable this peaceful transition.)

Version 3.2.0 will also discontinue support for Python versions 3.6 and 3.7.

  • API ENHANCEMENT: Optional(expr) may now be written as expr | ""

    This will make this code:

    "{" + Optional(Literal("A") | Literal("a")) + "}"
    

    writable as:

    "{" + (Literal("A") | Literal("a") | "") + "}"
    

    Some related changes implemented as part of this work:

    • Literal("") now internally generates an Empty() (and no longer raises an exception)
    • Empty is now a subclass of Literal

    Suggested by Antony Lee (issue #412), PR (#413) by Devin J. Pohly.

  • Added new class property identifier to all Unicode set classes in pyparsing.unicode, using the class's values for cls.identchars and cls.identbodychars. Now Unicode-aware parsers that formerly wrote:

    ppu = pyparsing.unicode
    ident = Word(ppu.Greek.identchars, ppu.Greek.identbodychars)
    

    can now write:

    ident = ppu.Greek.identifier
    # or
    # ident = ppu.Ελληνικά.identifier
    
  • Reworked delimited_list function into the new DelimitedList class. DelimitedList has the same constructor interface as delimited_list, and in this release, delimited_list changes from a function to a synonym for DelimitedList. delimited_list and the older delimitedList method will be deprecated in a future release, in favor of DelimitedList.

  • Added new class method ParserElement.using_each, to simplify code that creates a sequence of Literals, Keywords, or other ParserElement subclasses.

    For instance, to define suppressable punctuation, you would previously write:

    LPAR, RPAR, LBRACE, RBRACE, SEMI = map(Suppress, "(){};")
    

    You can now write:

    LPAR, RPAR, LBRACE, RBRACE, SEMI = Suppress.using_each("(){};")
    

    using_each will also accept optional keyword args, which it will pass through to the class initializer. Here is an expression for single-letter variable names that might be used in an algebraic expression:

    algebra_var = MatchFirst(
        Char.using_each(string.ascii_lowercase, as_keyword=True)
    )
    

... (truncated)

Changelog

Sourced from pyparsing's changelog.

Version 3.1.4 - August, 2024

  • Fixed a regression introduced in pyparsing 3.1.3, addition of a type annotation that referenced re.Pattern. Since this type was introduced in Python 3.7, using this type definition broke Python 3.6 installs of pyparsing 3.1.3. PR submitted by Felix Fontein, nice work!

Version 3.1.3 - August, 2024

  • Added new Tag ParserElement, for inserting metadata into the parsed results. This allows a parser to add metadata or annotations to the parsed tokens. The Tag element also accepts an optional value parameter, defaulting to True. See the new tag_metadata.py example in the examples directory.

    Example:

      # add tag indicating mood
      end_punc = "." | ("!" + Tag("enthusiastic")))
      greeting = "Hello" + Word(alphas) + end_punc
    

    result = greeting.parse_string("Hello World.") print(result.dump())

    result = greeting.parse_string("Hello World!") print(result.dump())

    prints:

      ['Hello', 'World', '.']
    

    ['Hello', 'World', '!']

    • enthusiastic: True
  • Added example mongodb_query_expression.py, to convert human-readable infix query expressions (such as a==100 and b>=200) and transform them into the equivalent query argument for the pymongo package ({'$and': [{'a': 100}, {'b': {'$gte': 200}}]}). Supports many equality and inequality operators - see the docstring for the transform_query function for more examples.

  • Fixed issue where PEP8 compatibility names for ParserElement static methods were not themselves defined as staticmethods. When called using a ParserElement instance, this resulted in a TypeError exception. Reported by eylenburg (#548).

  • To address a compatibility issue in RDFLib, added a property setter for the ParserElement.name property, to call ParserElement.set_name.

  • Modified ParserElement.set_name() to accept a None value, to clear the defined name and corresponding error message for a ParserElement.

  • ... (truncated)

    Commits
    • b846e4a Prep for 3.1.4 release
    • 9bd2356 Add Python 3.6 to CI (#566)
    • ee50a19 Add Tag notes to HowToUsePyparsing.rst
    • 3ffc3ef Fix typo
    • e5e97f7 Add mongodb_query_expression.py to examples; updated 0README.html and test_ex...
    • 10cef98 Add Tag ParserElement class
    • cf41d90 Prep for 3.1.3 release
    • d7c163c Some minor code changes in chemical_formulas.py
    • eb56030 Various code cleanups
    • a9e7d47 Added name property setter, and enhanced set_name() to accept a None value to...
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

    Bumps [pyparsing](https://github.com/pyparsing/pyparsing) from 2.2.0 to 3.1.4.
    - [Release notes](https://github.com/pyparsing/pyparsing/releases)
    - [Changelog](https://github.com/pyparsing/pyparsing/blob/master/CHANGES)
    - [Commits](pyparsing/pyparsing@pyparsing_2.2.0...3.1.4)
    
    ---
    updated-dependencies:
    - dependency-name: pyparsing
      dependency-type: direct:development
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    @dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Sep 19, 2024
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    dependencies Pull requests that update a dependency file
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    0 participants