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

CI setup with Justfiles #29

Merged
merged 7 commits into from
Jul 16, 2024
Merged

CI setup with Justfiles #29

merged 7 commits into from
Jul 16, 2024

Conversation

saleha-muzammil
Copy link
Contributor

@saleha-muzammil saleha-muzammil commented Jul 12, 2024

  • Formatted Nix code using Alejandra.
  • Formatted Python code with Black, with integration added to flake.nix.
  • Checked Python code with Ruff, with integration added to flake.nix.
  • Conducted type checks on Python code using Mypy.
  • Ran tests on the current machine.
  • Created two targets, one for CI and one for developers

P.S: I did not push the code formatting done by just since there would have been a lot of file changes

@charmoniumQ
Copy link
Owner

Yes, we should avoid reformatting the Python code until the currently in-flight Python pull requests are merged in.

Do all of the checks pass currently (especially Mypy)?

@saleha-muzammil
Copy link
Contributor Author

saleha-muzammil commented Jul 12, 2024

These two checks did not pass:

  • check-ruff: some unused imports, undefined struct variables.
  • check-mypy: Errors included unused type: ignore comments, attribute errors (inner_c_type), missing type annotations, incorrect return types (Any instead of int | Exception), and invalid type usage (inner_py_type).

Mypy in detail:

(cd probe_src && mypy --package probe_py --strict)
probe_py/struct_parser.py:37: error: Unused "type: ignore" comment  [unused-ignore]
probe_py/struct_parser.py:78: error: Unused "type: ignore" comment  [unused-ignore]
probe_py/struct_parser.py:119: error: "type[PointerStruct]" has no attribute "inner_c_type"  [attr-defined]
probe_py/struct_parser.py:139: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
probe_py/struct_parser.py:157: error: Returning Any from function declared to return "int | Exception"  [no-any-return]
probe_py/struct_parser.py:193: error: Unused "type: ignore" comment  [unused-ignore]
probe_py/struct_parser.py:212: error: Unused "type: ignore" comment  [unused-ignore]
probe_py/struct_parser.py:216: error: Variable "inner_py_type" is not valid as a type  [valid-type]
probe_py/struct_parser.py:216: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
probe_py/struct_parser.py:288: error: Unused "type: ignore" comment  [unused-ignore]
probe_py/struct_parser.py:384: error: Unused "type: ignore" comment  [unused-ignore]
probe_py/struct_parser.py:399: error: Unused "type: ignore" comment  [unused-ignore]
probe_py/struct_parser.py:487: error: Unused "type: ignore" comment  [unused-ignore]
arena/parse_arena.py:75: error: Name "__getitem__" already defined on line 72  [no-redef]
arena/parse_arena.py:78: error: Name "__getitem__" already defined on line 72  [no-redef]
error: Recipe `check-mypy` failed on line 11 with exit code 139

@Ex-32
Copy link
Collaborator

Ex-32 commented Jul 13, 2024

One thing that I didn't see in the CI file was flake checks, can we get a CI step that runs nix flake check --all-systems (currently broken, see PR #31)?

@charmoniumQ
Copy link
Owner

Yes, please add the check that @Ex-32 mentioned.

@charmoniumQ
Copy link
Owner

Can you try to fix as many of the type errors that you can? Some of them are just asking to remove a type-ignore comment. The other one about overload confuses me, and perhaps you could look in to how to tell My about method overloads.

@saleha-muzammil
Copy link
Contributor Author

Yes, please add the check that @Ex-32 mentioned.

Implemented this, the test did not pass though.

@saleha-muzammil
Copy link
Contributor Author

Can you try to fix as many of the type errors that you can? Some of them are just asking to remove a type-ignore comment. The other one about overload confuses me, and perhaps you could look in to how to tell My about method overloads.

Will do this, though it would be easier for me to open a separate PR for this.

@charmoniumQ charmoniumQ merged commit dc0f8a3 into charmoniumQ:main Jul 16, 2024
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.

3 participants