Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing setuptools-build-hook
Using setuptoolsBuildPhase
Using setuptoolsShellHook
Sourcing pip-install-hook
Using pipInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing python-namespaces-hook
Sourcing setuptools-check-hook
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/6rx1fwd9gbj3d1v0im7mlah96gpxm2wd-source
source root is source
setting SOURCE_DATE_EPOCH to timestamp 315619200 of file source/update_pyparsing_timestamp.py
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
no configure script, doing nothing
@nix { "action": "setPhase", "phase": "buildPhase" }
building
Executing setuptoolsBuildPhase
running bdist_wheel
running build
running build_py
creating build
creating build/lib
copying pyparsing.py -> build/lib
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/wheel
copying build/lib/pyparsing.py -> build/bdist.linux-x86_64/wheel
running install_egg_info
running egg_info
creating pyparsing.egg-info
writing pyparsing.egg-info/PKG-INFO
writing dependency_links to pyparsing.egg-info/dependency_links.txt
writing top-level names to pyparsing.egg-info/top_level.txt
writing manifest file 'pyparsing.egg-info/SOURCES.txt'
reading manifest file 'pyparsing.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'HowToUsePyparsing.rst'
warning: no files found matching 'pyparsingClassDiagram.*'
warning: no files found matching 'README.md'
warning: no files found matching 'modules.rst'
no previously-included directories found matching 'docs/_build/*'
adding license file 'LICENSE'
writing manifest file 'pyparsing.egg-info/SOURCES.txt'
Copying pyparsing.egg-info to build/bdist.linux-x86_64/wheel/pyparsing-2.4.7-py3.8.egg-info
running install_scripts
creating build/bdist.linux-x86_64/wheel/pyparsing-2.4.7.dist-info/WHEEL
creating 'dist/pyparsing-2.4.7-py2.py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
adding 'pyparsing.py'
adding 'pyparsing-2.4.7.dist-info/LICENSE'
adding 'pyparsing-2.4.7.dist-info/METADATA'
adding 'pyparsing-2.4.7.dist-info/WHEEL'
adding 'pyparsing-2.4.7.dist-info/top_level.txt'
adding 'pyparsing-2.4.7.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
Finished executing setuptoolsBuildPhase
@nix { "action": "setPhase", "phase": "installPhase" }
installing
Executing pipInstallPhase
/build/source/dist /build/source
Processing ./pyparsing-2.4.7-py2.py3-none-any.whl
Installing collected packages: pyparsing
Successfully installed pyparsing-2.4.7
/build/source
Finished executing pipInstallPhase
@nix { "action": "setPhase", "phase": "fixupPhase" }
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/92320pl7mv5q06n9681cd4vw7jbfj4da-python3.8-pyparsing-2.4.7
strip is /nix/store/v8imx1nvyz0hgvx9cbcmh6gp4ngw3ffj-binutils-2.35.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/92320pl7mv5q06n9681cd4vw7jbfj4da-python3.8-pyparsing-2.4.7/lib
patching script interpreter paths in /nix/store/92320pl7mv5q06n9681cd4vw7jbfj4da-python3.8-pyparsing-2.4.7
checking for references to /build/ in /nix/store/92320pl7mv5q06n9681cd4vw7jbfj4da-python3.8-pyparsing-2.4.7...
Executing pythonRemoveTestsDir
Finished executing pythonRemoveTestsDir
@nix { "action": "setPhase", "phase": "installCheckPhase" }
running install tests
Simple match - Literal("xyz")
['xyz']
Simple match after skipping whitespace - Literal("xyz")
['xyz']
Simple fail - parse an empty string - Literal("xyz")
^
ParseException: Expected "xyz" (at char 0), (line:1, col:1)
__main__.TestLiteral
pyparsing.Literal - "xyz"
Simple fail - parse a mismatching string - Literal("xyz")
xyu
^
ParseException: Expected "xyz", found 'x' (at char 0), (line:1, col:1)
__main__.TestLiteral
pyparsing.Literal - "xyz"
Simple fail - parse a partially matching string - Literal("xyz")
xy
^
ParseException: Expected "xyz", found 'x' (at char 0), (line:1, col:1)
__main__.TestLiteral
pyparsing.Literal - "xyz"
Fail - parse a partially matching string by matching individual letters - And({"x" "y" "z"})
xy
^
ParseException: Expected "z", found end of text (at char 2), (line:1, col:3)
__main__.TestLiteral
pyparsing._SingleCharLiteral - "z"
.
Match colors, converting to consistent case - ZeroOrMore([{'RED' | 'GREEN' | 'BLUE'}]...)
['RED', 'GREEN', 'BLUE', 'BLUE', 'GREEN', 'GREEN', 'RED']
.
Simple Word match - _WordRegex(W:(xy))
['xxyxxyy']
Simple Word match of two separate Words - And({W:(x) W:(y)})
['xxxxx', 'yy']
Simple Word match of two separate Words - implicitly skips whitespace - And({W:(x) W:(y)})
['xxxxx', 'yy']
.
Parsing real numbers - fail, parsed numbers are in pieces - ZeroOrMore([{W:(0123...) "." W:(0123...)}]...)
['1', '.', '2', '2', '.', '3', '3', '.', '1416', '98', '.', '6']
Parsing real numbers - better, use Combine to combine multiple tokens into one - ZeroOrMore([Combine:({W:(0123...) "." W:(0123...)})]...)
['1.2', '2.3', '3.1416', '98.6']
.
Match several words - ZeroOrMore([{W:(x) | W:(y)}]...)
['xx', 'y', 'xx', 'yy', 'xx', 'y', 'x', 'y', 'xxx', 'y']
Match several words, skipping whitespace - ZeroOrMore([{W:(x) | W:(y)}]...)
['x', 'x', 'y', 'xx', 'y', 'y', 'xx', 'y', 'x', 'y', 'x', 'xx', 'y']
Match several words, skipping whitespace (old style) - OneOrMore({{W:(x) | W:(y)}}...)
['x', 'x', 'y', 'xx', 'y', 'y', 'xx', 'y', 'x', 'y', 'x', 'xx', 'y']
Match words and numbers - show use of results names to collect types of tokens - ZeroOrMore([{W:(ABCD...) | integer}]...)
['sdlfj', 23084, 'ksdfs', 8234, 'kjsdlfkjd', 934]
- alpha: ['sdlfj', 'ksdfs', 'kjsdlfkjd']
- int: [23084, 8234, 934]
Using delimitedList (comma is the default delimiter) - And(W:(ABCD...) [, W:(ABCD...)]...)
['xxyx', 'xy', 'y', 'xxyx', 'yxx', 'xy']
Using delimitedList, with ':' delimiter - Combine(W:(0123...) [: W:(0123...)]...)
['0A:4B:73:21:FE:76']
.
Match with results name - Literal("xyz")
['xyz']
- value: 'xyz'
Match with results name - using naming short-cut - Literal("xyz")
['xyz']
- value: 'xyz'
Define multiple results names - And({W:(ABCD..., ABCD...) "=" integer})
['range', '=', 5280]
- key: 'range'
- value: 5280
.
Define multiple results names in groups - ZeroOrMore([Group:({W:(ABCD...) Suppress:("=") {real number with scientific notation | real number | signed integer}})]...)
[['range', 5280], ['long', -138.52], ['lat', 46.91]]
[0]:
['range', 5280]
- key: 'range'
- value: 5280
[1]:
['long', -138.52]
- key: 'long'
- value: -138.52
[2]:
['lat', 46.91]
- key: 'lat'
- value: 46.91
Define multiple results names in groups - use Dict to define results names using parsed keys - Dict(Dict:([Group:({W:(ABCD...) Suppress:("=") {real number with scientific notation | real number | signed integer}})]...))
[['range', 5280], ['long', -138.52], ['lat', 46.91]]
- lat: 46.91
- long: -138.52
- range: 5280
Define multiple value types - Dict(Dict:([Group:({W:(ABCD...) Suppress:("=") {real number with scientific notation | real number | signed integer | True | False | quoted string, starting with ' ending with '}})]...))
[['long', -122.47], ['lat', 37.82], ['public', 'True'], ['name', 'Golden Gate Bridge']]
- lat: 37.82
- long: -122.47
- name: 'Golden Gate Bridge'
- public: 'True'
.
Parsing real numbers - use parse action to convert to float at parse time - ZeroOrMore([Combine:({W:(0123...) "." W:(0123...)})]...)
[1.2, 2.3, 3.1416, 98.6]
Match with numeric string converted to int - _WordRegex(W:(0123...))
[12345]
Use two parse actions to convert numeric string, then convert to datetime - _WordRegex(W:(0123...))
[datetime.datetime(2018, 9, 20, 3, 53, 48)]
Use tokenMap for parse actions that operate on a single-length token - _WordRegex(W:(0123...))
[datetime.datetime(2018, 9, 20, 3, 53, 48)]
Using a built-in function that takes a sequence of strs as a parse action - ZeroOrMore([W:(0123...)]...)
['0A:4B:73:21:FE:76']
Using a built-in function that takes a sequence of strs as a parse action - ZeroOrMore([W:(0123...)]...)
['0A', '21', '4B', '73', '76', 'FE']
.
A parse action that adds new key-values - ZeroOrMore([integer]...)
[27, 1, 14, 22, 89]
- ave: 30.6
- max: 89
- min: 1
- sum: 153
.
Parsing real numbers - using Regex instead of Combine - ZeroOrMore([Re:('\\d+\\.\\d+')]...)
[1.2, 2.3, 3.1416, 98.6]
.
Define a condition to only match numeric values that are multiples of 7 - ZeroOrMore([W:(0123...)]...)
['14', '35', '77']
Separate conversion to int and condition into separate parse action/conditions - ZeroOrMore([W:(0123...)]...)
[14, 35, 77]
.
Use transformString to convert simple markup to HTML - And({* | _ | / "(" !W:()) ")"})
Show in bold, underscore, or italic type
.
A comma-delimited list of words - And(W:(ABCD...) [, W:(ABCD...)]...)
['this', 'that', 'blah', 'foo', 'bar']
A counted array of words - ZeroOrMore([(len) W:(ab)...]...)
[['aaa', 'bbb'], [], ['abab', 'bbaa', 'abbab']]
[0]:
['aaa', 'bbb']
[1]:
[]
[2]:
['abab', 'bbaa', 'abbab']
skipping comments with ignore - And({identifier "=" fnumber})
['abc_100', '=', 3.1416]
- lhs: 'abc_100'
- rhs: 3.1416
some pre-defined expressions in pyparsing_common, and building a dotted identifier with delimted_list - And({{real number with scientific notation | real number | signed integer} identifier [. identifier]... IPv4 address})
[1001, 'www.google.com', '192.168.10.199']
- id_num: 1001
- ip_address: '192.168.10.199'
- name: 'www.google.com'
using oneOf (shortcut for Literal('a') | Literal('b') | Literal('c')) - ZeroOrMore([a | b | c]...)
['a', 'b', 'a', 'b', 'b', 'a', 'c', 'c', 'a', 'b', 'b']
parsing nested parentheses - Forward(nested () expression)
[['a', 'b', ['c'], 'd', ['e', 'f', 'g', []]]]
[0]:
['a', 'b', ['c'], 'd', ['e', 'f', 'g', []]]
[0]:
a
[1]:
b
[2]:
['c']
[3]:
d
[4]:
['e', 'f', 'g', []]
[0]:
e
[1]:
f
[2]:
g
[3]:
[]
parsing nested braces - And({"if" nested () expression nested {} expression})
['if', [['x', '==', 'y'], '||', '!z'], ['printf(', '"{}"', ');']]
- body: [['printf(', '"{}"', ');']]
[0]:
['printf(', '"{}"', ');']
- condition: [[['x', '==', 'y'], '||', '!z']]
[0]:
[['x', '==', 'y'], '||', '!z']
[0]:
['x', '==', 'y']
[1]:
||
[2]:
!z
.
----------------------------------------------------------------------
Ran 13 tests in 0.050s
OK
Beginning test of pyparsing, version 2.4.7 30 Mar 2020 00:43 UTC
Python version 3.8.11 (default, Jun 28 2021, 10:57:31)
[GCC 10.3.0]
...........................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 219 tests in 14.353s
OK
@nix { "action": "setPhase", "phase": "pythonCatchConflictsPhase" }
pythonCatchConflictsPhase
@nix { "action": "setPhase", "phase": "pythonRemoveBinBytecodePhase" }
pythonRemoveBinBytecodePhase
@nix { "action": "setPhase", "phase": "pythonImportsCheckPhase" }
pythonImportsCheckPhase
Executing pythonImportsCheckPhase