Skip to content

Commit 1ccd0f0

Browse files
committed
[#1354] update swig to latest version
Removes some system wide swig warning suppressions
1 parent 55a3dd0 commit 1ccd0f0

7 files changed

Lines changed: 5 additions & 24 deletions

File tree

.github/workflows/requirements_dev.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ conan
44
packaging
55
setuptools
66
setuptools-scm
7-
# TODO: The SWIG 4.4.X is incompatible with Basilisk. Pin to SWIG 4.3.1 until
8-
# Basilisk is updated to support SWIG 4.4.X
9-
swig<=4.3.1,>=4.2.1
7+
swig
108
libclang
119

1210
pytest

pyproject.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ requires = [
1313
# Requirements for building Basilisk through conanfile
1414
"conan>=2.0.5,<=2.23.0",
1515
"cmake>=3.26,<4.0",
16-
"swig>=4.2.1,<=4.3.1", # Known to work with https://github.com/nightlark/swig-pypi/pull/120
16+
"swig>=4.2.1,<5", # Support Basilisk's established SWIG baseline while allowing the latest 4.4.x releases.
1717
"libclang>=15.0.6.1,<=18.1.1" # Required by generatePayloadMetaJson.py (message code generation)
1818
]
1919

@@ -105,8 +105,3 @@ markers = [
105105
"scenarioTest: mark a test as a tutorial scenario test.",
106106
"ciSkip: mark a test that should be skipped on the CI test runs",
107107
]
108-
filterwarnings = [
109-
"ignore:builtin type SwigPyPacked has no __module__ attribute:DeprecationWarning",
110-
"ignore:builtin type SwigPyObject has no __module__ attribute:DeprecationWarning",
111-
"ignore:builtin type swigvarlink has no __module__ attribute:DeprecationWarning",
112-
]

requirements_dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ conan>=2.0.5,<=2.23.0
44
packaging>=24,<26
55
setuptools>=70.1.0,<=80.9.0
66
setuptools-scm>=8.0,<=9.2.2
7-
swig<=4.3.1,>=4.2.1
7+
swig>=4.2.1,<5
88
libclang>=15.0.6.1,<=18.1.1
99

1010
pytest>=8.3.5,<=9.0.1

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def finalize_options(self) -> None:
8888

8989
# Set limited ABI compatibility by default, targeting the minimum required Python version.
9090
# See https://docs.python.org/3/c-api/stable.html
91-
# NOTE: Swig 4.2.1 or higher is required, see https://github.com/swig/swig/pull/2727
91+
# NOTE: Swig 4.2.1 or higher is required. Newer 4.4.x releases avoid deprecated wrapper warnings on newer Python.
9292
min_version = next(self.distribution.python_requires.filter([f"3.{i}" for i in range(2, 100)])).replace(".", "")
9393
wheel_py_limited = f"cp{min_version}"
9494
bdist_wheel = self.reinitialize_command("bdist_wheel", py_limited_api=wheel_py_limited)

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ if(PY_LIMITED_API AND NOT PY_LIMITED_API STREQUAL "")
7171
# compatibility (basically, we can build a single Python wheel to
7272
# support all future Python versions).
7373
# See https://docs.python.org/3/c-api/stable.html
74-
# NOTE: Swig 4.2.0 is required, see https://github.com/swig/swig/pull/2727
74+
# NOTE: Swig 4.2.0 is required. Swig 4.4.x avoids the deprecated wrapper warnings on newer Python releases.
7575
add_definitions("-DPy_LIMITED_API=${PY_LIMITED_API}") # Support for current Python version
7676

7777
# Force libraries to link to the Stable ABI module instead.

src/conftest.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,12 @@
2121
import shutil
2222
import subprocess
2323
import sys
24-
import warnings
2524
from datetime import date
2625

2726
import matplotlib as mpl
2827
import matplotlib.pyplot as plt
2928
import pytest
3029

31-
warnings.filterwarnings(
32-
"ignore",
33-
message="builtin type swigvarlink has no __module__ attribute",
34-
category=DeprecationWarning,
35-
)
36-
3730
SHOW_PLOTS_REMOVAL_DATE = date(2027, 2, 12)
3831
SHOW_PLOTS_DEPRECATION_MESSAGE = (
3932
"The pytest option '--show_plots' is deprecated and will be removed after February 12, 2027."

src/pytest.ini

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,3 @@ markers =
44
slowtest: mark a test as a slow unit test.
55
scenarioTest: mark a test as a tutorial scenario test.
66
ciSkip: mark a test that should be skipped on the CI test runs
7-
8-
filterwarnings =
9-
ignore:builtin type SwigPyPacked has no __module__ attribute:DeprecationWarning
10-
ignore:builtin type SwigPyObject has no __module__ attribute:DeprecationWarning
11-
ignore:builtin type swigvarlink has no __module__ attribute:DeprecationWarning

0 commit comments

Comments
 (0)