Skip to content

✨ Add typing support to pyexasol #162

Open
@Nicoretti

Description

@Nicoretti

Summary

Add typing support to pyexasol by incorporating type hints and re-enabling type checking for all files and paths in the pyproject.toml in the [[tool.mypy.overrides]] section.

Details

This feature aims to enhance the static typing support of the pyexasol library. Type hints should be added to all relevant functions and methods within the codebase. Additionally, type checking should be re-enabled for all files and paths specified in the [[tool.mypy.overrides]] section of the pyproject.toml file.

Background & Context

Implementing type hints in the pyexasol codebase will lead to better developer experience and reduced runtime errors as types are checked statically. This improves code quality and maintainability. Moreover, enabling MyPy for all files and paths ensures that the typing system is comprehensively utilized, aligning with modern Python development best practices.

Examples

Here are some examples showing how type hints can be used:

Before:

def connect(dsn, user, password):
    # connection logic
    pass

After:

def connect(dsn: str, user: str, password: str) -> Connection:
    # connection logic
    pass

References

Task(s)

  • Add type hints to all relevant functions and methods in the codebase
  • Verify type hint correctness with MyPy
  • Update the pyproject.toml file to re-enable type checking for all files and paths in the [[tool.mypy.overrides]] section
  • Run MyPy to ensure all type checks pass
  • Update documentation to reflect the addition of type hints
  • Add py.typed file

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureProduct feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions