diff --git a/.github/workflows/python_lint.yml b/.github/workflows/python_lint.yml index 2fd94c77..fdf27b97 100644 --- a/.github/workflows/python_lint.yml +++ b/.github/workflows/python_lint.yml @@ -1,5 +1,8 @@ name: Run Linters +permissions: + contents: read + on: push: branches: @@ -56,8 +59,8 @@ jobs: - name: Check code format run: poetry run ruff format --check . - mypy-check: - name: MyPy Check + ty-check: + name: Ty Check runs-on: ubuntu-latest steps: # Common steps: @@ -76,5 +79,5 @@ jobs: run: poetry install # Job-specifc step(s): - - name: Check MyPy typing - run: poetry run mypy . + - name: Check Ty typing + run: poetry run ty check . diff --git a/poetry.lock b/poetry.lock index 5b26f8b6..60734d3f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -5042,6 +5042,35 @@ notebook = ["ipywidgets (>=6)"] slack = ["slack-sdk"] telegram = ["requests"] +[[package]] +name = "ty" +version = "0.0.1a16" +description = "An extremely fast Python type checker, written in Rust." +optional = false +python-versions = ">=3.8" +groups = ["dev"] +markers = "python_version <= \"3.11\" or python_version >= \"3.12\"" +files = [ + {file = "ty-0.0.1a16-py3-none-linux_armv6l.whl", hash = "sha256:dfb55d28df78ca40f8aff91ec3ae01f4b7bc23aa04c72ace7ec00fbc5e0468c0"}, + {file = "ty-0.0.1a16-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:5a0e9917efadf2ec173ee755db3653243b64fa8b26fa4d740dea68e969a99898"}, + {file = "ty-0.0.1a16-py3-none-macosx_11_0_arm64.whl", hash = "sha256:9253cb8b5c4052337b1600f581ecd8e6929e635a07ec9e8dc5cc2fa4008e6b3b"}, + {file = "ty-0.0.1a16-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:374c059e184f8abc969e07965355ddbbf7205a713721d3867ee42f976249c9ac"}, + {file = "ty-0.0.1a16-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c5364c6d1a1a3d5b8e765a730303f8e07094ab9e63682aa82f73755d92749852"}, + {file = "ty-0.0.1a16-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f201ff0ab3267123b9e42cc8584a193aa76e6e0865003d1b0a41bd025f08229e"}, + {file = "ty-0.0.1a16-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:57f14207d88043ba27f4b84d84dfdaa1bfbcc5170d5f50814d2997cbc3d75366"}, + {file = "ty-0.0.1a16-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:950c45e1d6c58e61ad77ed5d2d04f091e44b0d13e6d5d79143bb81078ab526b1"}, + {file = "ty-0.0.1a16-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ad133d0eac5291d738e40052df98ca9f194e0f0433d6086a4890fd6733217969"}, + {file = "ty-0.0.1a16-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3e59f877ef8b967c06173a7a663271a6e66edb049f0db00f7873be5e41d61d5b"}, + {file = "ty-0.0.1a16-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:4e973b8cb2c382263aaf77a40889ad236bd06ddca671cc973f9e33e8e02f0af1"}, + {file = "ty-0.0.1a16-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:4a82d9c4b76a73aff60cab93b71f2dd83952c2eb68a86578e1db56aee8f7e338"}, + {file = "ty-0.0.1a16-py3-none-musllinux_1_2_i686.whl", hash = "sha256:7993f48def35f1707a2dc675bf7d08906cc5f26204b0b479746664301eda15b9"}, + {file = "ty-0.0.1a16-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:d9887ec65984e7dbf3b5e906ef44e8f47ff5351c7ac04d49e793b324d744050f"}, + {file = "ty-0.0.1a16-py3-none-win32.whl", hash = "sha256:4113a176a8343196d73145668460873d26ccef8766ff4e5287eec2622ce8754d"}, + {file = "ty-0.0.1a16-py3-none-win_amd64.whl", hash = "sha256:508ba4c50bc88f1a7c730d40f28d6c679696ee824bc09630c7c6763911de862a"}, + {file = "ty-0.0.1a16-py3-none-win_arm64.whl", hash = "sha256:36f53e430b5e0231d6b6672160c981eaf7f9390162380bcd1096941b2c746b5d"}, + {file = "ty-0.0.1a16.tar.gz", hash = "sha256:9ade26904870dc9bd988e58bad4382857f75ae05edb682ee0ba2f26fcc2d4c0f"}, +] + [[package]] name = "typer" version = "0.16.0" @@ -5559,4 +5588,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.1" python-versions = ">=3.10,<3.13" -content-hash = "ad72cf79abd247f49f3428e0aaed7e986bac93b1dd5f290bc407ce4fddd2208b" +content-hash = "a20150aa24b2be419c5fbdf614493bcea2c312078bbdc1a73235652d68982e2a" diff --git a/pyproject.toml b/pyproject.toml index 93486cfb..7d629b3a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,7 @@ deptry = "^0.21.1" docker = "^7.1.0" faker = "^21.0.0" freezegun = "^1.4.0" -mypy = "^1.11.2" +ty = "^0.0.1a16" pandas-stubs = "^2.1.4.231218" pdoc = "^14.3.0" poethepoet = ">=0.26.1,<0.32.0" @@ -115,45 +115,10 @@ filterwarnings = [ # syntax: "action:message_regex:category:module:line" # [tool.ruff] # Ruff moved to dedicated config file: `.ruff.toml` -[tool.mypy] -# Platform configuration -python_version = "3.10" -# imports related -ignore_missing_imports = true -follow_imports = "silent" -# None and Optional handling -no_implicit_optional = true -strict_optional = true -# Configuring warnings -warn_unused_configs = true -warn_redundant_casts = true -warn_unused_ignores = true -warn_no_return = true -warn_unreachable = true -warn_return_any = false -# Untyped definitions and calls -check_untyped_defs = true -disallow_untyped_calls = false -disallow_untyped_defs = true -disallow_incomplete_defs = true -disallow_untyped_decorators = false -# Disallow dynamic typing -disallow_subclassing_any = true -disallow_any_unimported = false -disallow_any_expr = false -disallow_any_decorated = false -disallow_any_explicit = false -disallow_any_generics = false -# Miscellaneous strictness flags -allow_untyped_globals = false -allow_redefinition = false -local_partial_types = false -implicit_reexport = true -strict_equality = true -# Configuring error messages -show_error_context = false -show_column_numbers = false -show_error_codes = true +[tool.ty.environment] +python-version = "3.10" + +[tool.ty.src] exclude = [ "tests/integration_tests/fixtures/source-broken", "tests/integration_tests/fixtures/source-test", @@ -161,13 +126,6 @@ exclude = [ "tests", ] -[[tool.mypy.overrides]] -ignore_missing_imports = true # No stubs yet (😢) -module = [ - "airbyte_protocol", - "airbyte_protocol.models", -] - [tool.pyright] pythonVersion = "3.10" venvPath = "./" # Assuming .venv is at the root of your project @@ -187,7 +145,8 @@ coverage-report = { shell = "coverage report" } coverage-html = { shell = "coverage html -d htmlcov && open htmlcov/index.html" } coverage-reset = { shell = "coverage erase" } -check = { shell = "ruff check . && mypy . && pytest --collect-only -qq" } +type-check = { shell = "ty check .", help = "Type check with ty" } +check = { shell = "ruff check . && poe type-check && pytest --collect-only -qq" } docs-generate = {env = {PDOC_ALLOW_EXEC = "1"}, cmd = "python -m docs.generate run"} docs-preview = {shell = "poe docs-generate && open docs/generated/index.html"}