question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enable type checking and adding typing_copilot to dev/CI environment

See original GitHub issue

This is to help track and discuss adding typing_copilot as a dev dependency, and as part of the CI for arviz.

TL;DR

We add type checking to pull request checks, and another tool to enforce that our type checking is only getting stronger.

Slightly longer

This is a discussion over whether we want to do two things:

  1. Add a type check step to CI
  2. Help migrate to this using typing_copilot

I’ve sketched some possible wins and losses as I see them, and I’m tagging @obi1kenobi (author of typing_copilot) who might be able to help us think through whether this makes sense. Note that he has already submitted #1397, #1398, #1491, #1492, #1493, and #1494. @OriolAbril and @obi1kenobi have some great conversations in there about what is going on, and what the benefits are.

The general idea of typing_copilot is that it checks your mypy configuration against the amount of checking you’ve already done, and will tighten the config file, if possible. To me, it seems like a no-brainer that if we decide type checking is a good idea, to use this.

Possible wins:

  • Strong typing helps downstream users and maintainers
  • Find existing bugs
  • Extra layer of testing and compatibility (especially for arviz, which may have contributors for a specific library, unaware of conventions/return types elsewhere in the codebase)

Possible losses:

  • Higher threshold for contributing / maintainers may need to get more familiar with typing to help contributors
  • More noise during merges

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
canyon289commented, Jan 19, 2021

Do it 😄

1reaction
ColCarrollcommented, Jan 11, 2021

My initial thought, for what it is worth, is that we aim to get this in after the next release, and give it a test run. If nothing else, I bet the experience of a maturing code base adding typing will be an interesting experiment, and we’ll all learn something. It also seems easy to get rid of.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to enable Python type checking in VSCode
In this article, we will see how to enable type IntelliSense and type checking analysis in Visual Studio Code editor.
Read more >
Python Type Checking (Guide) - Real Python
In this guide, you'll look at Python type checking. ... Type annotations and type hints; Adding static types to code, both your code...
Read more >
Python Type Checking - TestDriven.io
Type hints enable static type checking tools. Code editors and IDEs use them as well, warning you when usage of a particular function...
Read more >
This VS Code update can type hint your Python code - YouTube
A look at the newest update to VS Code for Python type hints. Check out everything new for Python in VS Code: ...
Read more >
Do type annotations in Python enforce static type checking?
Type annotations in python DO NOT enforce static type checking. Python's still a dynamic language, where the interpreter checks whether it ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found