#1150834 mdtraj: FTBFS: E pyparsing.exceptions.ParseException: Expected '(', found '=' (at char 6), (line:1, col:7)

Package:
src:mdtraj
Source:
src:mdtraj
Submitter:
Santiago Vila
Date:
2026-10-14 18:35:03 UTC
Severity:
normal
Tags:
#1150834#5
Date:
2026-10-13 17:44:49 UTC
From:
To:
Dear maintainer:

During a rebuild of all packages in unstable, this package failed to build.

Below you will find the last part of the build log (probably the most
relevant part, but not necessarily). If required, the full build log
is available here:

https://people.debian.org/~sanvila/build-logs/202610/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you cannot reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:mdtraj, so that this is still
visible in the BTS web page for this package.

Thanks.
--------------------------------------------------------------------------------
[...]

    def parseImpl(self, instring, loc, do_actions=True) -> ParseImplReturnType:
        if instring[loc] == self.firstMatchChar:
            return loc + 1, self.match
/usr/lib/python3/dist-packages/pyparsing/core.py:2783: ParseException

During handling of the above exception, another exception occurred:

self = <mdtraj.core.selection.parse_selection object at 0x7f5eb091de80>
selection = 'name >= 1'

    def __call__(self, selection):
        if not self.is_initialized:
            self._initialize()

        try:
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

mdtraj/core/selection.py:397:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = {Group:({'all' | 'backbone' | 'chainid' | 'code' | 'element' | 'everything' | 'index' | 'is_backbone' | 'is_nucleic' |...|' | '!' | 'not '}} {W:(.0-9) | quoted string using single or double quotes | W:(A-Za-z, 0-9A-Za-z)}}} infix expression
instring = 'name >= 1', parse_all = True, kwargs = {'parseAll': False}

    def parse_string(
        self, instring: str, parse_all: bool = False, **kwargs
    ) -> ParseResults:
        """
        Parse a string with respect to the parser definition. This function is intended as the primary interface to the
        client code.

        :param instring: The input string to be parsed.
        :param parse_all: If set, the entire input string must match the grammar.
        :param parseAll: retained for pre-PEP8 compatibility, will be removed in a future release.
        :raises ParseException: Raised if ``parse_all`` is set and the input string does not match the whole grammar.
        :returns: the parsed data as a :class:`ParseResults` object, which may be accessed as a `list`, a `dict`, or
          an object with attributes if the given parser includes results names.

        If the input string is required to match the entire grammar, ``parse_all`` flag must be set to ``True``. This
        is also equivalent to ending the grammar with :class:`StringEnd`\\ ().

        To report proper column numbers, ``parse_string`` operates on a copy of the input string where all tabs are
        converted to spaces (8 spaces per tab, as per the default in ``string.expandtabs``). If the input string
        contains tabs and the grammar uses parse actions that use the ``loc`` argument to index into the string
        being parsed, one can ensure a consistent view of the input string by doing one of the following:

        - calling ``parse_with_tabs`` on your grammar before calling ``parse_string`` (see :class:`parse_with_tabs`),
        - define your parse action using the full ``(s,loc,toks)`` signature, and reference the input string using the
          parse action's ``s`` argument, or
        - explicitly expand the tabs in your input string before calling ``parse_string``.

        Examples:

        By default, partial matches are OK.

        .. doctest::

            >>> res = Word('a').parse_string('aaaaabaaa')
            >>> print(res)
            ['aaaaa']

        The parsing behavior varies by the inheriting class of this abstract class. Please refer to the children
        directly to see more examples.

        It raises an exception if parse_all flag is set and instring does not match the whole grammar.

        .. doctest::

            >>> res = Word('a').parse_string('aaaaabaaa', parse_all=True)
            Traceback (most recent call last):
            ParseException: Expected end of text, found 'b' ...
        """
        parseAll: bool = deprecate_argument(kwargs, "parseAll", False)

        parse_all = parse_all or parseAll

        ParserElement.reset_cache()
        if not self.streamlined:
            self.streamline()
        for e in self.ignoreExprs:
            e.streamline()
        if not self.keepTabs:
            instring = instring.expandtabs()
        try:
            loc, tokens = self._parse(instring, 0)
            if parse_all:
                loc = self.preParse(instring, loc)
                se = Empty() + StringEnd().set_debug(False)
                se._parse(instring, loc)
        except _ParseActionIndexError as pa_exc:
            raise pa_exc.exc
        except ParseBaseException as exc:
            if ParserElement.verbose_stacktrace:
                raise

            # catch and re-raise exception from here, clearing out pyparsing internal stack trace
/usr/lib/python3/dist-packages/pyparsing/core.py:1346: ParseException

During handling of the above exception, another exception occurred:

    def test_binary_selection_operator():
        eq(parse_selection("name < 1").astnode, pnode("atom.name < 1"))
        eq(parse_selection("name lt 1").astnode, pnode("atom.name < 1"))
        eq(parse_selection("name > 1").astnode, pnode("atom.name > 1"))
        eq(parse_selection("name gt 1").astnode, pnode("atom.name > 1"))
        eq(parse_selection("name == 1").astnode, pnode("atom.name == 1"))
        eq(parse_selection("name eq 1").astnode, pnode("atom.name == 1"))
        eq(parse_selection("name != 1").astnode, pnode("atom.name != 1"))
        eq(parse_selection("name ne 1").astnode, pnode("atom.name != 1"))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/test_selection.py:174:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <mdtraj.core.selection.parse_selection object at 0x7f5eb091de80>
selection = 'name >= 1'

    def __call__(self, selection):
        if not self.is_initialized:
            self._initialize()

        try:
            parse_result = self.expression.parse_string(selection, parse_all=True)
        except ParseException as e:
            msg = str(e)
            lines = [
                f"{msg}: {selection}",
                " " * (12 + len("%s: " % msg) + e.loc) + "^^^",
            ]

mdtraj/core/selection.py:404: ValueError
=============================== warnings summary ===============================
tests/test_distance.py::Test_Distance::test_6
  <frozen importlib._bootstrap>:491: RuntimeWarning: numpy.ndarray size changed, may indicate binary incompatibility. Expected 16 from C header, got 96 from PyObject

#1150834#10
Date:
2026-10-14 18:33:47 UTC
From:
To:
This is evidently a bug in python3-pyparsing, mdtraj.

The mdtraj pyproject.toml specifies "pyparsing!=3.3.3"

pyparsing needs to be fixed

https://github.com/mdtraj/mdtraj/issues/2190

https://github.com/pyparsing/pyparsing/issues/672
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1150875