You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While updating copier, I tried to enable type checking, but ran into some issues. I've disabled it for now, but the issues should be addressed so we can have type-checking going forward.
1 - Multiple conftest files
Initial module discovery is unhappy that we have multiple files named conftest.py
$ mypy ./src ./tests --ignore-missing-imports
tests/hipscat/io/conftest.py: error: Duplicate module named "conftest" (also at "tests/hipscat/catalog/conftest.py")
tests/hipscat/io/conftest.py: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#mapping-file-paths-to-modules for more info
tests/hipscat/io/conftest.py: note: Common resolutions include: a) using `--exclude` to avoid checking one of them, b) adding `__init__.py` somewhere, c) using `--explicit-package-bases` or adjusting MYPYPATH
Found 1 error in 1 file (errors prevented further checking)
Can address by
write fixtures in separate files for code organization, and import into a single conftest.py
combining all fixtures into single conftest.py
only checking the ./src directory
2 - Warnings:
$ mypy ./src --ignore-missing-imports
src/hipscat/io/paths.py:50: error: Argument 1 to "int" has incompatible type "Optional[int]"; expected "Union[str, bytes, bytearray, memoryview, array[Any], mmap, _CData, PickleBuffer, SupportsInt, SupportsIndex, SupportsTrunc]" [arg-type]
src/hipscat/io/file_io/file_io.py:93: error: Incompatible default for argument "metadata_collector" (default has type "None", argument has type "List[Any]") [assignment]
src/hipscat/io/file_io/file_io.py:93: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
src/hipscat/io/file_io/file_io.py:93: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
src/hipscat/catalog/pixel_node.py:55: error: Cannot determine type of "hp_order" [has-type]
src/hipscat/catalog/pixel_node.py:62: error: Need type annotation for "children" (hint: "children: List[<type>] = ...") [var-annotated]
src/hipscat/catalog/pixel_node.py:108: error: Need type annotation for "leaf_descendants" (hint: "leaf_descendants: List[<type>] = ...") [var-annotated]
src/hipscat/pixel_math/pixel_margins.py:21: error: Need type annotation for "_suffixes" (hint: "_suffixes: Dict[<type>, <type>] = ...") [var-annotated]
src/hipscat/io/write_metadata.py:136: error: Need type annotation for "hips_structure" (hint: "hips_structure: Dict[<type>, <type>] = ...") [var-annotated]
src/hipscat/catalog/catalog_parameters.py:14: error: Incompatible default for argument "input_paths" (default has type "None", argument has type "List[str]") [assignment]
src/hipscat/catalog/catalog_parameters.py:14: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
src/hipscat/catalog/catalog_parameters.py:14: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
src/hipscat/catalog/catalog.py:11: error: Incompatible default for argument "catalog_path" (default has type "None", argument has type "str") [assignment]
src/hipscat/catalog/catalog.py:11: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
src/hipscat/catalog/catalog.py:11: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
Found 9 errors in 7 files (checked 19 source files)
The text was updated successfully, but these errors were encountered:
While updating copier, I tried to enable type checking, but ran into some issues. I've disabled it for now, but the issues should be addressed so we can have type-checking going forward.
1 - Multiple conftest files
Initial module discovery is unhappy that we have multiple files named
conftest.py
Can address by
conftest.py
conftest.py
2 - Warnings:
The text was updated successfully, but these errors were encountered: