55 Commits

Author SHA1 Message Date
Sergei Lebedev
194884d311 Migrated to mypy 1.14.1 with --allow_redefinition
I initially wanted to upgrade to 1.15, but it seems to have a bug in how
ternary expressions are type checked. For example,

   def f(x: int) -> str: ...
   def g(x: int) -> str: ...

   callback = f if ... else g  # has type object!
2025-02-13 15:38:28 +00:00
Jake VanderPlas
f4f4bf6a19 Fix type annotations for NumPy 2.2 2024-12-11 14:24:58 -08:00
Jake VanderPlas
a36af966fd CI: temporarily pin numpy version for mypy check 2024-12-09 19:01:46 -08:00
Sergei Lebedev
3ad1985e1a Bumped mypy and ruff versions used by pre-commit 2024-10-21 21:58:41 +01:00
Sergei Lebedev
ec745f48c8 Use the current minimum jaxlib version for type checking on the CI 2024-10-10 12:46:15 +01:00
Jake VanderPlas
09fd345de9 pre-commit: update hooks & pin using hashes 2024-08-27 15:23:13 -07:00
Jake VanderPlas
68be5b5085 CI: update ruff to v0.6.1 2024-08-27 14:54:11 -07:00
Sergei Lebedev
fb1dbf15df Bumped mypy to 1.11.0 and jaxlib to 0.4.31 on the CI 2024-08-01 22:30:24 +01:00
Sergei Lebedev
8d33a6c9a6 Bumped jaxlib version mypy uses on the CI
I also enabled unnecessary cast checking, because turns out we have quite
a few of those.
2024-07-26 11:22:39 +01:00
Dan Foreman-Mackey
5d8f4168ca Speed up pre-commit by filtering jupytext to only run on files in docs.
I noticed that the `jupytext` pre-commit was running slowly because it
reads a lot of files that it doesn't need to. I think that the only
synced notebooks are in `docs`, and restricting this pre-commit to only
run in this directory decreases the runtime of `pre-commit run
--all-files` on my machine from 37s to 15s.
2024-07-18 11:27:31 -04:00
Sergei Lebedev
c3bc88d5e4 Bumped mypy to 1.10.0 and ruff to 0.4.4 2024-05-16 23:16:32 +01:00
Sai-Suraj-27
29def4eefa Updated all the pre-commit hooks versions. 2024-04-08 00:59:02 +05:30
Jake VanderPlas
3f24e37d15 CI: update ruff & mypy to latest versions 2024-03-13 09:32:57 -07:00
Jake VanderPlas
6569b320b2 CI: bump mypy to version 1.8.0 2024-01-10 10:20:55 -08:00
Jake VanderPlas
10eae3f93a CI: update jupytext version 2024-01-09 14:34:21 -08:00
Jake VanderPlas
6814db5256 CI: add more pre-commit checks 2023-11-29 16:33:55 -08:00
Peter Hawkins
30a0136813 Increase minimum jaxlib version to 0.4.19.
0.4.19 has xla_extension version 207 and mlir_api_version 54.

PiperOrigin-RevId: 583412447
2023-11-17 09:38:31 -08:00
Neil Girdhar
3c920c0120 Switch from flake8 to Ruff 2023-11-15 22:35:52 -05:00
Jake VanderPlas
389eb97a7c CI: update pre-commit hooks to latest version 2023-10-30 09:12:24 -07:00
Jake VanderPlas
a794bebb33 CI: update mypy to v1.6.0 2023-10-11 12:54:51 -07:00
Jake VanderPlas
775adb69b0 CI: update package versions for mypy pre-commit 2023-09-19 09:52:57 -07:00
Sai-Suraj-27
b042b1e4c6 Updated mirrors-mypy and pre-commit hooks vesrion and checked all the files by running them.
Updated flake8 version in pre-commit configuration file.
2023-08-24 21:24:21 +05:30
Peter Hawkins
3082109a59 Add a type stub for jax.numpy.
This type stub is intended to match what pytype currently infers for jax.numpy, which is not particularly accurate in many cases. Future changes will add more accurate types to this stub.

Fix a number of new type errors this reveals to mypy.

PiperOrigin-RevId: 559179804
2023-08-22 11:50:49 -07:00
Jake VanderPlas
6097d8fe23 CI: bump mypy to version 1.5.0 2023-08-16 14:26:04 -07:00
Jake VanderPlas
7bb8312f82 CI: update jupytext to v0.14.7 2023-07-24 11:51:45 -07:00
Jake VanderPlas
9d1f3b4dd2 pre-commit: update mypy to most recent version 2023-07-12 10:41:51 -07:00
Jake VanderPlas
9962065deb Require ml_dtypes>=0.2 2023-07-07 12:07:44 -07:00
Jake VanderPlas
2fa2f82274 CI: run lint_and_typecheck under newest Python version 2023-05-02 12:09:53 -07:00
Jake VanderPlas
5310562250 mypy: type-check ml_dtypes 2023-04-17 11:35:59 -07:00
Saurav Maheshkar
cfd8762d4a feat: move configurations to pyproject 2023-04-15 02:39:39 +01:00
Jake VanderPlas
b30e6e7d59 CI: add EOF and debug precommit hooks 2023-03-30 13:29:50 -07:00
Jake VanderPlas
61190cbcb0 CI: add numpy & scipy to mypy env 2023-03-27 15:08:44 -07:00
Cristian Garcia
dfc24f2981 add trailing-whitespace pre-commit hook 2023-03-23 21:17:54 +00:00
Peter Hawkins
8bb90b5fbe [XLA:Python] Change JAX and the XLA Python extension to get NumPy bfloat16/float8 types from ml_dtypes.
PiperOrigin-RevId: 518830467
2023-03-23 05:13:39 -07:00
Peter Hawkins
cca3961cde [JAX] Split _src/xla_bridge.py into a separate Bazel target.
Include _src/distributed.py and _src/clusters/*.py in the same target because they are in a strongly-connected component.

[XLA:Python] Set type of ArrayImpl to Any, since the JAX change now allows pytype to see that some values are ArrayImpls but ArrayImpls are not instances of jax.Array to Pytype.

Fix type of buffer_from_pyval.

PiperOrigin-RevId: 515687258
2023-03-10 11:12:02 -08:00
Jake VanderPlas
94af71a24c CI: fix mypy jaxlib version 2023-01-24 06:57:23 -08:00
Jake VanderPlas
20b55a119e CI: update jupytext version 2023-01-23 14:42:03 -08:00
Jake VanderPlas
19b5f0a75a CI: update flake8 to v6.0.0 2023-01-23 09:47:13 -08:00
Jake VanderPlas
3d5eadde26 CI: update flake8 pre-commit URL 2022-11-15 13:32:48 -08:00
Jake VanderPlas
0691be6a2b [typing] update jaxlib & remove unnecessary ignore 2022-11-04 11:02:33 -07:00
Jake VanderPlas
87f1a2bac7 CI: update mypy version in pre-commit config 2022-10-17 11:25:14 -07:00
Jake VanderPlas
0cb233eec9 Add initial jax.Array base class for instance checks & annotation 2022-09-26 07:48:43 -07:00
Jake VanderPlas
b3c31ebe7d Add typing_test.py 2022-09-13 12:43:51 -07:00
Jake VanderPlas
eeb9b5f1f6 pre-commit hook: update flake8, mypy, & jupytext 2022-08-15 15:32:45 -07:00
Jake VanderPlas
1134ff5871 CI: update jupytext to 0.13.8 2022-05-02 11:22:31 -07:00
Jake VanderPlas
7972b98a7b update mypy & related package versions 2022-04-15 08:55:06 -07:00
Jake VanderPlas
b9b79bab31 maint: update pre-commit package versions & fix new mypy errors 2022-01-31 13:39:11 -08:00
Peter Hawkins
58d5ee978d Increment minimum jaxlib version in mypy precommit hook. 2021-11-18 17:55:24 -05:00
Jake VanderPlas
198cc5ee4f chore: update jupytext to v0.1.13 & re-sync notebooks 2021-10-05 14:30:16 -07:00
Jake VanderPlas
cbcd6eeadb CI: bump mypy & flake8 versions to newest 2021-08-20 14:35:37 -07:00