Skip to content

Conversation

@jepler
Copy link
Collaborator

@jepler jepler commented May 13, 2022

based on https://jaredkhan.com/blog/mypy-pre-commit this adds mypy (non-strict) during pre-commit. It might be useful in considering how we can apply this to CircuitPython libraries.

  • the library name has to be called out in the mypy commandline within pre-commit-config.yaml
  • any requirements must also be called out

This means that the pre-commit file would always be different between projects, which is 👎

Using a separate script as suggested at https://jaredkhan.com/blog/mypy-pre-commit might make still allow the pre-commit-confg file to remain identical across libs; it could pip install -r requirements_dev.txt and figure out the package name somehow (we must have that somewhere already)

@CedarGroveStudios
Copy link
Contributor

I suspect that there may be potential practical uses for this in scientific applications that are sensitive to floating point math limitations. I plan to test it with a multivariable polynomial curve fitting algorithm where the conversion formula requires significantly more precision than the sensor input data.

@jepler jepler merged commit 6007a78 into main May 24, 2022
adafruit-adabot added a commit to adafruit/CircuitPython_Community_Bundle that referenced this pull request Jun 9, 2022
Updating https://github.com/jepler/Jepler_CircuitPython_udecimal to 1.0.6 from 1.0.5:
  > Merge pull request circuitpython/Jepler_CircuitPython_udecimal#16 from jepler/pre-commit-ci-update-config
  > Merge pull request circuitpython/Jepler_CircuitPython_udecimal#14 from jepler/pre-commit-ci-update-config
  > Merge pull request circuitpython/Jepler_CircuitPython_udecimal#13 from jepler/pre-commit-mypy
  > Merge pull request circuitpython/Jepler_CircuitPython_udecimal#12 from jepler/pre-commit.ci
  > Merge pull request circuitpython/Jepler_CircuitPython_udecimal#11 from jepler/update-black-ci-etc
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