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 Jun 19 08:02:42 UTC 2023
Modified Files:
pkgsrc/devel/py-pyparsing: Makefile distinfo
pkgsrc/devel/py-pyparsing/files: setup.py
Log Message:
py-pyparsing: updated to 3.1.0
Version 3.1.0 - June, 2023
--------------------------
- Added `tag_emitter.py` to examples. This example demonstrates how to insert
tags into your parsed results that are not part of the original parsed text.
Version 3.1.0b2 - May, 2023
---------------------------
- Updated `create_diagram()` code to be compatible with railroad-diagrams package
version 3.0.
- Fixed bug in `NotAny`, where parse actions on the negated expr were not being run.
This could cause `NotAny` to incorrectly fail if the expr would normally match,
but would fail to match if a condition used as a parse action returned False.
- Fixed `create_diagram()` to accept keyword args, to be passed through to the
`template.render()` method to generate the output HTML (PR submitted by Aussie Schnore,
good catch!)
- Fixed bug in `python_quoted_string` regex.
- Added `examples/bf.py` Brainf*ck parser/executor example. Illustrates using
a pyparsing grammar to parse language syntax, and attach executable AST nodes to
the parsed results.
Version 3.1.0b1 - April, 2023
-----------------------------
- Added support for Python 3.12.
- API CHANGE: A slight change has been implemented when unquoting a quoted string
parsed using the `QuotedString` class. Formerly, when unquoting and processing
whitespace markers such as \t and \n, these substitutions would occur first, and
then any additional '\' escaping would be done on the resulting string. This would
parse "\\n" as "\<newline>". Now escapes and whitespace markers are all processed
in a single pass working left to right, so the quoted string "\\n" would get unquoted
to "\n" (a backslash followed by "n").
- Added named field "url" to `pyparsing.common.url`, returning the entire
parsed URL string.
- Fixed bug when parse actions returned an empty string for an expression that
had a results name, that the results name was not saved. That is:
expr = Literal("X").add_parse_action(lambda tokens: "")("value")
result = expr.parse_string("X")
print(result["value"])
would raise a `KeyError`. Now empty strings will be saved with the associated
results name.
- Fixed bug in `SkipTo` where ignore expressions were not properly handled while
scanning for the target expression.
- Updated `ci.yml` permissions to limit default access to source - submitted by Joyce
Brum of Google. Thanks so much!
- Updated the `lucene_grammar.py` example (better support for '*' and '?' wildcards)
and corrected the test cases - brought to my attention by Elijah Nicol, good catch!
Version 3.1.0a1 - March, 2023
-----------------------------
- 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`
- 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
- `ParseResults` now has a new method `deepcopy()`, in addition to the current
`copy()` method. `copy()` only makes a shallow copy - any contained `ParseResults`
are copied as references - changes in the copy will be seen as changes in the original.
In many cases, a shallow copy is sufficient, but some applications require a deep copy.
`deepcopy()` makes a deeper copy: any contained `ParseResults` or other mappings or
containers are built with copies from the original, and do not get changed if the
original is later changed.
- 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`.
- Error messages from `MatchFirst` and `Or` expressions will try to give more details
if one of the alternatives matches better than the others, but still fails.
- 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 suppressible 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)
)
- Added new builtin `python_quoted_string`, which will match any form
of single-line or multiline quoted strings defined in Python.
- Extended `expr[]` notation for repetition of `expr` to accept a
slice, where the slice's stop value indicates a `stop_on`
expression:
test = "BEGIN aaa bbb ccc END"
BEGIN, END = Keyword.using_each("BEGIN END".split())
body_word = Word(alphas)
expr = BEGIN + Group(body_word[...:END]) + END
# equivalent to
# expr = BEGIN + Group(ZeroOrMore(body_word, stop_on=END)) + END
print(expr.parse_string(test))
Prints:
['BEGIN', ['aaa', 'bbb', 'ccc'], 'END']
- `ParserElement.validate()` is deprecated. It predates the support for left-recursive
parsers, and was prone to false positives (warning that a grammar was invalid when
it was in fact valid). It will be removed in a future pyparsing release. In its
place, developers should use debugging and analytical tools, such as `ParserElement.set_debug()`
and `ParserElement.create_diagram()`.
- Added bool `embed` argument to `ParserElement.create_diagram()`.
When passed as True, the resulting diagram will omit the `<DOCTYPE>`,
`<HEAD>`, and `<BODY>` tags so that it can be embedded in other
HTML source. (Useful when embedding a call to `create_diagram()` in
a PyScript HTML page.)
- Added `recurse` argument to `ParserElement.set_debug` to set the
debug flag on an expression and all of its sub-expressions.
- Added '·' (Unicode MIDDLE DOT) to the set of Latin1.identbodychars.
- Fixed bug in `Word` when `max=2`. Also added performance enhancement
when specifying `exact` argument.
- `Word` arguments are now validated if `min` and `max` are both
given, that `min` <= `max`; raises `ValueError` if values are invalid.
- Fixed bug in srange, when parsing escaped '/' and '\' inside a
range set.
- Fixed exception messages for some `ParserElements` with custom names,
which instead showed their contained expression names.
- Fixed bug in pyparsing.common.url, when input URL is not alone
on an input line.
- Multiple added and corrected type annotations. With much help from
Stephen Rosen, thanks!
- Some documentation and error message clarifications on pyparsing's
keyword logic, cited by Basil Peace.
- General docstring cleanup for Sphinx doc generation, PRs submitted
by Devin J. Pohly. A dirty job, but someone has to do it - much
appreciated!
- `invRegex.py` example renamed to `inv_regex.py` and updated to PEP-8
variable and method naming. PR submitted by Ross J. Duff, thanks!
- Removed examples `sparser.py` and `pymicko.py`, since each included its
own GPL license in the header. Since this conflicts with pyparsing's
MIT license, they were removed from the distribution to avoid
confusion among those making use of them in their own projects.
To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 pkgsrc/devel/py-pyparsing/Makefile
cvs rdiff -u -r1.27 -r1.28 pkgsrc/devel/py-pyparsing/distinfo
cvs rdiff -u -r1.1 -r1.2 pkgsrc/devel/py-pyparsing/files/setup.py
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.28 pkgsrc/devel/py-pyparsing/Makefile:1.29
--- pkgsrc/devel/py-pyparsing/Makefile:1.28 Wed May 18 08:50:41 2022
+++ pkgsrc/devel/py-pyparsing/Makefile Mon Jun 19 08:02:42 2023
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.28 2022/05/18 08:50:41 wiz Exp $
+# $NetBSD: Makefile,v 1.29 2023/06/19 08:02:42 adam Exp $
-DISTNAME= pyparsing-3.0.9
+# Important: re-generate files/setup.py before updating.
+DISTNAME= pyparsing-3.1.0
PKGNAME= ${PYPKGPREFIX}-${DISTNAME}
CATEGORIES= devel python
MASTER_SITES= ${MASTER_SITE_PYPI:=p/pyparsing/}
@@ -14,9 +15,6 @@ USE_LANGUAGES= # none
PYTHON_VERSIONS_INCOMPATIBLE= 27
-# bug in 3.0.9
-EGG_NAME= pyparsing-3.0.8
-
# Important: do not use wheel.mk. It depends on py-build,
# which depends py-packaging, and that depends on this package.
pre-configure:
Index: pkgsrc/devel/py-pyparsing/distinfo
diff -u pkgsrc/devel/py-pyparsing/distinfo:1.27 pkgsrc/devel/py-pyparsing/distinfo:1.28
--- pkgsrc/devel/py-pyparsing/distinfo:1.27 Wed May 18 08:50:41 2022
+++ pkgsrc/devel/py-pyparsing/distinfo Mon Jun 19 08:02:42 2023
@@ -1,5 +1,5 @@
-$NetBSD: distinfo,v 1.27 2022/05/18 08:50:41 wiz Exp $
+$NetBSD: distinfo,v 1.28 2023/06/19 08:02:42 adam Exp $
-BLAKE2s (pyparsing-3.0.9.tar.gz) = 00e5055e22545373714ffcaac0ddd7eab4ed54b4054c99875424ee0440adc53e
-SHA512 (pyparsing-3.0.9.tar.gz) = 8877f8733196c757e36e062ddc216153f9cdc51bf43795855a607340bab73fdf4d44745c9f410d151cc4a4d6d0db06133945a4d7d0fee52f3aee521b8095e6b0
-Size (pyparsing-3.0.9.tar.gz) = 1999906 bytes
+BLAKE2s (pyparsing-3.1.0.tar.gz) = 28b642a343e121e4aa19e8a6fa97b0c0c780021f0dd5316ca68a8907389e4103
+SHA512 (pyparsing-3.1.0.tar.gz) = 0ad2e8fff93708426b3675e2d41da12b3f09531bf272799db4095ee618bbaa0f4b90e527ff09dda2acbdb923d59117678fbb28b82a7cfd2b395d686f47b61850
+Size (pyparsing-3.1.0.tar.gz) = 882565 bytes
Index: pkgsrc/devel/py-pyparsing/files/setup.py
diff -u pkgsrc/devel/py-pyparsing/files/setup.py:1.1 pkgsrc/devel/py-pyparsing/files/setup.py:1.2
--- pkgsrc/devel/py-pyparsing/files/setup.py:1.1 Tue Apr 12 07:39:15 2022
+++ pkgsrc/devel/py-pyparsing/files/setup.py Mon Jun 19 08:02:42 2023
@@ -12,7 +12,7 @@ extras_require = \
{'diagrams': ['railroad-diagrams', 'jinja2']}
setup(name='pyparsing',
- version='3.0.8',
+ version='3.1.0',
description='pyparsing module - Classes and methods to define and execute parsing grammars',
author=None,
author_email='Paul McGuire <ptmcg.gm+pyparsing%gmail.com@localhost>',
Home |
Main Index |
Thread Index |
Old Index