diff --git a/pyproject.toml b/pyproject.toml index 7fa8ee2..9d8b549 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,11 +73,26 @@ repository = "https://github.com/vnmabus/rdata" requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" -[tool.setuptools.packages.find] -include = ["rdata*"] +[tool.mypy] +strict = true +strict_equality = true +implicit_reexport = true -[tool.setuptools.dynamic] -version = {attr = "rdata.__version__"} +[[tool.mypy.overrides]] +module = [ + "igraph.*", + "ipywidgets.*", +] +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module = "examples.*" +disallow_untyped_defs = false + +[tool.pytest.ini_options] +addopts = "--doctest-modules --doctest-glob='*.rst'" +doctest_optionflags = "NORMALIZE_WHITESPACE ELLIPSIS" +norecursedirs = ".* build dist *.egg venv .svn _build docs/auto_examples examples" [tool.ruff.lint] select = [ @@ -116,18 +131,8 @@ convention = "google" [tool.ruff.lint.pylint] max-args = 7 -[tool.mypy] -strict = true -strict_equality = true -implicit_reexport = true - -[[tool.mypy.overrides]] -module = [ - "igraph.*", - "ipywidgets.*", -] -ignore_missing_imports = true +[tool.setuptools.packages.find] +include = ["rdata*"] -[[tool.mypy.overrides]] -module = "examples.*" -disallow_untyped_defs = false +[tool.setuptools.dynamic] +version = {attr = "rdata.__version__"} \ No newline at end of file diff --git a/rdata/tests/test_rdata.py b/rdata/tests/test_rdata.py index 47dddfe..6c5a32f 100644 --- a/rdata/tests/test_rdata.py +++ b/rdata/tests/test_rdata.py @@ -8,6 +8,7 @@ import numpy as np import pandas as pd +import pytest import xarray import rdata @@ -234,6 +235,7 @@ def test_list(self) -> None: ], }) + @pytest.mark.filterwarnings("ignore:Missing constructor") def test_file(self) -> None: """Test that external pointers can be parsed.""" parsed = rdata.parser.parse_file(TESTDATA_PATH / "test_file.rda") @@ -288,6 +290,7 @@ def test_minimal_function_uncompiled(self) -> None: "test_minimal_function_uncompiled <- function() NULL\n", ) + @pytest.mark.filterwarnings("ignore:Missing constructor") def test_minimal_function(self) -> None: """Test that a minimal function (compiled) can be parsed.""" parsed = rdata.parser.parse_file( @@ -342,6 +345,7 @@ def test_empty_function_uncompiled(self) -> None: "test_empty_function_uncompiled <- function() {}\n", ) + @pytest.mark.filterwarnings("ignore:Missing constructor") def test_empty_function(self) -> None: """Test that a simple function (compiled) can be parsed.""" parsed = rdata.parser.parse_file( @@ -374,6 +378,7 @@ def test_empty_function(self) -> None: "test_empty_function <- function() {}\n", ) + @pytest.mark.filterwarnings("ignore:Missing constructor") def test_function(self) -> None: """Test that functions can be parsed.""" parsed = rdata.parser.parse_file( @@ -409,6 +414,7 @@ def test_function(self) -> None: "test_function <- function() {print(\"Hello\")}\n", ) + @pytest.mark.filterwarnings("ignore:Missing constructor") def test_function_arg(self) -> None: """Test that functions can be parsed.""" parsed = rdata.parser.parse_file( @@ -566,7 +572,9 @@ def test_ts(self) -> None: def test_s4(self) -> None: """Test parsing of S4 classes.""" parsed = rdata.parser.parse_file(TESTDATA_PATH / "test_s4.rda") - converted = rdata.conversion.convert(parsed) + + with pytest.warns(UserWarning, match="Missing constructor"): + converted = rdata.conversion.convert(parsed) np.testing.assert_equal(converted, { "test_s4": SimpleNamespace( diff --git a/setup.cfg b/setup.cfg index d2a6a1d..dfcb41a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,11 +1,3 @@ -[aliases] -test=pytest - -[tool:pytest] -addopts = --doctest-modules --doctest-glob="*.rst" -doctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS -norecursedirs = .* build dist *.egg venv .svn _build docs/auto_examples examples - [isort] multi_line_output = 3 include_trailing_comma = true