Skip to content

Remove flake8-mypy in favor of direct mypy usage#2248

Merged
ddelnano merged 1 commit intopixie-io:mainfrom
ddelnano:ddelnano/fix-mypy-linting
Jul 25, 2025
Merged

Remove flake8-mypy in favor of direct mypy usage#2248
ddelnano merged 1 commit intopixie-io:mainfrom
ddelnano:ddelnano/fix-mypy-linting

Conversation

@ddelnano
Copy link
Member

Summary: Remove flake8-mypy in favor of direct mypy usage

Our mypy type checking is broken as seen on #2247. The flake8-mypy plugin has been deprecated for a long time, so this replaces it with running mypy directly.

Relevant Issues: N/A

Type of change: /kind dependencies

Test Plan: Verified re-built container works with mypy type checking

$ PX_DOCKER_RUN_AS_ROOT=True ./scripts/run_docker.sh

# Succesful run passes
root@px-dev-docker-dev-vm:/px/src/px.dev/pixie# arc lint src/pxl_scripts/px/collect_heap_dumps.pxl
 OKAY  No lint messages.

# Introduce typing issue and see that `arc lint` notices it
root@px-dev-docker-dev-vm:/px/src/px.dev/pixie# arc lint src/pxl_scripts/px/collect_heap_dumps.pxl
 Exception
Some linters failed:
    - CommandException: Command failed with error #1!
      COMMAND
      mypy --config-file=mypy.ini src/pxl_scripts/px/collect_heap_dumps.pxl

      STDOUT
      src/pxl_scripts/px/collect_heap_dumps.pxl:27:5: error: Unsupported operand types for + ("int" and "str")  [operator]
      Found 1 error in 1 file (checked 1 source file)


      STDERR
      mypy.ini: [mypy]: python_version: Python 3.8 is not supported (must be 3.9 or higher)

(Run with `--trace` for a full exception trace.)

@ddelnano ddelnano requested review from a team as code owners July 24, 2025 23:15
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
@ddelnano ddelnano force-pushed the ddelnano/fix-mypy-linting branch from c4d2d8d to b0ff292 Compare July 24, 2025 23:16
@ddelnano ddelnano merged commit 7f19235 into pixie-io:main Jul 25, 2025
25 checks passed
@ddelnano ddelnano deleted the ddelnano/fix-mypy-linting branch July 25, 2025 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments