swmm-python icon indicating copy to clipboard operation
swmm-python copied to clipboard

DeprecationWarnings related to SWIG types when running tests on Python 3.12

Open michaeltryby opened this issue 3 months ago • 2 comments

Issue Type: Bug

Description: When running unit tests for this repository on Python 3.12 (all operating systems), a series of DeprecationWarnings are displayed:

<frozen importlib._bootstrap>:488
<frozen importlib._bootstrap>:488
  <frozen importlib._bootstrap>:488: DeprecationWarning: builtin type SwigPyPacked has no __module__ attribute
<frozen importlib._bootstrap>:488
<frozen importlib._bootstrap>:488
  <frozen importlib._bootstrap>:488: DeprecationWarning: builtin type SwigPyObject has no __module__ attribute
<frozen importlib._bootstrap>:488
  <frozen importlib._bootstrap>:488: DeprecationWarning: builtin type swigvarlink has no __module__ attribute

See: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

Steps to Reproduce:

  • Run the unit tests with Python 3.12 on any operating system.

Additional Notes:

  • Not sure about other Python versions.
  • These warnings may be related to underlying SWIG bindings.

michaeltryby avatar Sep 06 '25 20:09 michaeltryby

I think should be fixed in the next release of swig. See https://github.com/swig/swig/issues/2881#issuecomment-2877988848

karosc avatar Sep 06 '25 22:09 karosc

more info here. I think 4.4.0 will be released ahead of python 3.14....hopefully.

karosc avatar Sep 08 '25 14:09 karosc