Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify mypy invocation by specifying files to check #816

Merged
merged 6 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/check_nimg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ jobs:
- name: Lint ni-measurement-plugin-sdk-generator
run: poetry run ni-python-styleguide lint
- name: Mypy static analysis (ni-measurement-plugin-sdk-generator, Linux)
run: poetry run mypy -p ni_measurement_plugin_sdk_generator
run: poetry run mypy
- name: Mypy static analysis (ni-measurement-plugin-sdk-generator, Windows)
run: poetry run mypy -p ni_measurement_plugin_sdk_generator --platform win32
run: poetry run mypy --platform win32
8 changes: 2 additions & 6 deletions .github/workflows/check_nims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,9 @@ jobs:
- name: Lint ni-measurement-plugin-sdk-service
run: poetry run ni-python-styleguide lint
- name: Mypy static analysis (ni-measurement-plugin-sdk-service, Linux)
run: poetry run mypy -p ni_measurement_plugin_sdk_service
run: poetry run mypy
- name: Mypy static analysis (ni-measurement-plugin-sdk-service, Windows)
run: poetry run mypy -p ni_measurement_plugin_sdk_service --platform win32
- name: Mypy static analysis (tests, Linux)
run: poetry run mypy tests
- name: Mypy static analysis (tests, Windows)
run: poetry run mypy tests --platform win32
run: poetry run mypy --platform win32

# ni-measurement-plugin-sdk-service, all extras, docs
- name: Restore cached virtualenv (ni-measurement-plugin-sdk-service, all extras, docs)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Measurement Plugin SDK Code Generator."""
2 changes: 2 additions & 0 deletions packages/generator/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ build-backend = "poetry.core.masonry.api"
line-length = 100

[tool.mypy]
files = "ni_measurement_plugin_sdk_generator/,tests/"
exclude = "^tests/test_assets/"
disallow_untyped_defs = true
namespace_packages = true
warn_redundant_casts = true
Expand Down
6 changes: 3 additions & 3 deletions packages/generator/tests/acceptance/test_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def test___command_line_args___create_measurement___render_without_exception(
test_assets_directory: pathlib.Path, tmp_path_factory: pytest.TempPathFactory
):
) -> None:
temp_directory = tmp_path_factory.mktemp("measurement_files")

with pytest.raises(SystemExit):
Expand Down Expand Up @@ -39,7 +39,7 @@ def test___command_line_args___create_measurement___render_without_exception(

def test___command_line_args___create_measurement_with_annotations___render_without_exception(
test_assets_directory: pathlib.Path, tmp_path_factory: pytest.TempPathFactory
):
) -> None:
temp_directory = tmp_path_factory.mktemp("measurement_files")

with pytest.raises(SystemExit):
Expand Down Expand Up @@ -79,7 +79,7 @@ def test___command_line_args___create_measurement_with_annotations___render_with
)


def _assert_equal(expected_path: pathlib.Path, result_path: pathlib.Path):
def _assert_equal(expected_path: pathlib.Path, result_path: pathlib.Path) -> None:
expected = expected_path.read_text()
result = result_path.read_text()

Expand Down
2 changes: 2 additions & 0 deletions packages/service/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ markers = [
]

[tool.mypy]
files = "ni_measurement_plugin_sdk_service/,tests/"
exclude = "^tests/assets/"
disallow_untyped_defs = true
namespace_packages = true
plugins = "numpy.typing.mypy_plugin"
Expand Down
Loading