2023-03-29 10:04:34 -07:00
[ build-system ]
requires = [ "setuptools" , "wheel" ]
build-backend = "setuptools.build_meta"
2023-04-15 02:39:39 +01:00
[ tool . mypy ]
show_error_codes = true
2023-07-17 11:18:48 -07:00
disable_error_code = "attr-defined, name-defined, annotation-unchecked"
2023-04-15 02:39:39 +01:00
no_implicit_optional = true
2024-07-26 10:59:56 +01:00
warn_redundant_casts = true
2025-02-12 13:27:29 +00:00
allow_redefinition = true
2023-04-15 02:39:39 +01:00
[ [ tool . mypy . overrides ] ]
module = [
2024-08-01 12:00:42 +01:00
"IPython.*" ,
2023-04-15 02:39:39 +01:00
"absl.*" ,
"colorama.*" ,
2024-08-01 12:00:42 +01:00
"etils.*" ,
2024-05-30 17:59:05 +04:00
"filelock.*" ,
2024-08-01 12:00:42 +01:00
"flatbuffers.*" ,
"flax.*" ,
"google.colab.*" ,
"hypothesis.*" ,
"jax.experimental.jax2tf.tests.back_compat_testdata" ,
"jax.experimental.jax2tf.tests.flax_models" ,
"jax_cuda12_plugin.*" ,
"jaxlib.*" ,
"jaxlib.mlir.*" ,
"jraph.*" ,
"libtpu.*" ,
"matplotlib.*" ,
2024-10-05 16:49:28 +03:00
"nvidia.*" ,
2023-04-15 02:39:39 +01:00
"numpy.*" ,
"opt_einsum.*" ,
"optax.*" ,
2024-08-01 12:00:42 +01:00
"pygments.*" ,
"pytest.*" ,
"rich.*" ,
"scipy.*" ,
"setuptools.*" ,
"tensorboard_plugin_profile.convert.*" ,
2023-04-15 02:39:39 +01:00
"tensorflow.*" ,
"tensorflow.io.*" ,
2024-08-01 12:00:42 +01:00
"tensorflowjs.*" ,
2023-04-15 02:39:39 +01:00
"tensorstore.*" ,
"web_pdb.*" ,
2023-04-17 11:22:08 -07:00
"zstandard.*" ,
2024-07-08 05:08:25 +00:00
"kubernetes.*"
2023-04-15 02:39:39 +01:00
]
ignore_missing_imports = true
[ tool . pytest . ini_options ]
markers = [
"multiaccelerator: indicates that a test can make use of and possibly requires multiple accelerators" ,
"SlurmMultiNodeGpuTest: mark a test for Slurm multinode GPU nightly CI"
]
filterwarnings = [
"error" ,
2024-07-26 10:59:56 +01:00
2023-11-27 13:10:06 -08:00
# TODO(jakevdp): remove when array_api_tests stabilize
2024-05-28 13:13:40 -07:00
"default:.*not machine-readable.*:UserWarning" ,
"default:Special cases found for .* but none were parsed.*:UserWarning" ,
2024-09-24 12:28:32 -07:00
2024-11-14 10:38:53 +00:00
# jax.profiler imports tensorflow.python.profiler.trace internally, which
# will fail with python 3.12 and some versions of protobuf because the
# "error" entry above promotes DeprecationWarnings into errors. See also:
# https://github.com/protocolbuffers/protobuf/issues/12186#issuecomment-1745679358
"ignore:Type google\\._upb\\._message\\.(Scalar|Message)MapContainer uses PyType_Spec with a metaclass that has custom tp_new\\. This is deprecated and will no longer be allowed in Python 3\\.14\\.:DeprecationWarning" ,
2025-03-10 10:37:11 -07:00
# TODO(b/401588349): Remove this once transparent hugepages are enabled.
"ignore:Transparent hugepages" ,
2024-09-24 12:28:32 -07:00
# NOTE: this is probably not where you want to add code to suppress a
# warning. Only pytest tests look at this list, whereas Bazel tests also
# check for warnings and do not check this list. Most likely, you should
# add a @jtu.ignore_warning decorator to your test instead.
2023-04-15 02:39:39 +01:00
]
doctest_optionflags = [
"NUMBER" ,
"NORMALIZE_WHITESPACE"
]
2024-09-03 14:31:15 -04:00
addopts = "--doctest-glob='*.rst' --ignore='examples/ffi'"
2023-04-15 02:39:39 +01:00
2023-11-14 23:34:30 -05:00
[ tool . ruff ]
preview = true
exclude = [
".git" ,
"build" ,
"__pycache__" ,
]
2024-04-08 14:05:22 -07:00
line-length = 88
indent-width = 2
2024-06-26 14:58:39 -07:00
target-version = "py310"
2024-04-08 14:05:22 -07:00
[ tool . ruff . lint ]
2023-11-14 23:34:30 -05:00
ignore = [
# Unnecessary collection call
"C408" ,
# Unnecessary map usage
"C417" ,
2024-09-03 15:15:19 -07:00
# Unnecessary dict comprehension for iterable
2024-08-27 14:54:11 -07:00
"C420" ,
2023-11-14 23:34:30 -05:00
# Object names too complex
"C901" ,
# Local variable is assigned to but never used
"F841" ,
# Raise with from clause inside except block
"B904" ,
2024-06-26 14:58:39 -07:00
# Zip without explicit strict parameter
"B905" ,
2023-11-14 23:34:30 -05:00
]
select = [
"B9" ,
"C" ,
"F" ,
"W" ,
"YTT" ,
"ASYNC" ,
2024-10-16 11:09:59 -07:00
"E101" ,
"E112" ,
"E113" ,
"E115" ,
"E117" ,
2023-11-14 23:34:30 -05:00
"E225" ,
"E227" ,
"E228" ,
]
2024-04-08 14:05:22 -07:00
[ tool . ruff . lint . mccabe ]
2023-11-14 23:34:30 -05:00
max-complexity = 18
2024-04-08 14:05:22 -07:00
[ tool . ruff . lint . per-file-ignores ]
2023-11-14 23:34:30 -05:00
# F811: Redefinition of unused name.
2024-08-27 14:54:11 -07:00
# F821: Undefined name.
2023-11-14 23:34:30 -05:00
"docs/autodidax.py" = [ "F811" ]
2024-08-27 14:54:11 -07:00
"docs/pallas/tpu/matmul.ipynb" = [ "F811" ]
"docs/pallas/tpu/distributed.ipynb" = [ "F811" ]
"docs/pallas/quickstart.ipynb" = [ "F811" ]
"docs/notebooks/autodiff_cookbook.ipynb" = [ "F811" , "F821" ]
"docs/notebooks/autodiff_remat.ipynb" = [ "F811" , "F821" ]
"docs/notebooks/Custom_derivative_rules_for_Python_code.ipynb" = [ "F811" ]
"docs/jep/9407-type-promotion.ipynb" = [ "F811" ]
"docs/autodidax.ipynb" = [ "F811" ]