Skip to content

Deprecation warnings from pyparsing v3.3.0a0+ #876

@Andy-Grigg

Description

@Andy-Grigg

🔍 Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

🐞 Description of the bug

We have started seeing DeprecationWarnings using pyparsing 3.3.0:

...
/home/docker/miniconda/envs/env/lib/python3.12/site-packages/ansys/openapi/common/_session.py:276: in with_credentials
    headers = self.__get_authenticate_header(initial_response)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/docker/miniconda/envs/env/lib/python3.12/site-packages/ansys/openapi/common/_session.py:472: in __get_authenticate_header
    return parse_authenticate(response.headers["www-authenticate"])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/docker/miniconda/envs/env/lib/python3.12/site-packages/ansys/openapi/common/_util.py:196: in parse_authenticate
    parser = AuthenticateHeaderParser()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/docker/miniconda/envs/env/lib/python3.12/site-packages/ansys/openapi/common/_util.py:123: in __call__
    cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/docker/miniconda/envs/env/lib/python3.12/site-packages/ansys/openapi/common/_util.py:143: in __init__
    value = pp.quotedString.setParseAction(pp.removeQuotes)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = quoted string using single or double quotes
args = (<function remove_quotes at 0x7f219a08bce0>,), kwargs = {}

    @wraps(fn)
    def _inner(self, *args, **kwargs):
>       warnings.warn(
            f"{compat_name!r} deprecated - use {fn.__name__!r}",
            DeprecationWarning,
            stacklevel=2,
        )
E       DeprecationWarning: 'setParseAction' deprecated - use 'set_parse_action'

/home/docker/miniconda/envs/env/lib/python3.12/site-packages/pyparsing/util.py:431: DeprecationWarning

pyparsing have deprecated their non-PEP8-compliant method names. These have been available since v3, so we can safely switch to the new versions.

📝 Steps to reproduce

Install pyparsing 3.3.0a1 and do some API calls.

💻 Which operating system are you using?

Linux

📀 Which ANSYS version are you using?

N/A

🐍 Which Python version are you using?

3.12

📦 Installed packages

pyparsing 3.3.0a1

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions