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
|
2024-05-17 09:46:36 +01:00
|
|
|
warn_unused_ignores = 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.*",
|
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.*",
|
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-05-28 13:13:40 -07:00
|
|
|
"default:Error (reading|writing) persistent compilation cache entry for 'jit_equal'",
|
|
|
|
"default:Error (reading|writing) persistent compilation cache entry for 'jit__lambda_'",
|
|
|
|
"default:jax.extend.mlir.dialects.mhlo is deprecated.*:DeprecationWarning",
|
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-08-08 12:33:30 -07:00
|
|
|
"default:.*is not JSON-serializable. Using the repr instead.*:UserWarning",
|
|
|
|
"default:The .* method is good for exploring strategies.*",
|
2024-07-23 05:07:49 -07:00
|
|
|
|
|
|
|
# These are transitive warnings coming from TensorFlow dependencies.
|
2024-07-05 10:57:05 +01:00
|
|
|
# TODO(slebedev): Remove once we bump the minimum TensorFlow version.
|
|
|
|
"default:The key path API is deprecated .*",
|
2024-07-23 05:07:49 -07:00
|
|
|
"default:jax.xla_computation is deprecated.*:DeprecationWarning",
|
2023-04-15 02:39:39 +01:00
|
|
|
]
|
|
|
|
doctest_optionflags = [
|
|
|
|
"NUMBER",
|
|
|
|
"NORMALIZE_WHITESPACE"
|
|
|
|
]
|
|
|
|
addopts = "--doctest-glob='*.rst'"
|
|
|
|
|
|
|
|
[tool.pylint.master]
|
|
|
|
extension-pkg-whitelist = "numpy"
|
|
|
|
|
|
|
|
[tool.pylint."messages control"]
|
|
|
|
disable = [
|
|
|
|
"missing-docstring",
|
|
|
|
"too-many-locals",
|
|
|
|
"invalid-name",
|
|
|
|
"redefined-outer-name",
|
|
|
|
"redefined-builtin",
|
|
|
|
"protected-name",
|
|
|
|
"no-else-return",
|
|
|
|
"fixme",
|
|
|
|
"protected-access",
|
|
|
|
"too-many-arguments",
|
|
|
|
"blacklisted-name",
|
|
|
|
"too-few-public-methods",
|
|
|
|
"unnecessary-lambda"
|
|
|
|
]
|
|
|
|
enable = "c-extension-no-member"
|
|
|
|
|
|
|
|
[tool.pylint.format]
|
|
|
|
indent-string=" "
|
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-08-27 14:54:11 -07:00
|
|
|
# Unnecessary dict comprehension for iterable
|
|
|
|
"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",
|
|
|
|
"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"]
|
2023-11-14 23:34:30 -05:00
|
|
|
# Note: we don't use jax/*.py because this matches contents of jax/_src
|
|
|
|
"__init__.py" = ["F401"]
|
|
|
|
"jax/abstract_arrays.py" = ["F401"]
|
|
|
|
"jax/ad_checkpoint.py" = ["F401"]
|
|
|
|
"jax/api_util.py" = ["F401"]
|
|
|
|
"jax/cloud_tpu_init.py" = ["F401"]
|
|
|
|
"jax/core.py" = ["F401"]
|
|
|
|
"jax/custom_batching.py" = ["F401"]
|
|
|
|
"jax/custom_derivatives.py" = ["F401"]
|
|
|
|
"jax/custom_transpose.py" = ["F401"]
|
|
|
|
"jax/debug.py" = ["F401"]
|
|
|
|
"jax/distributed.py" = ["F401"]
|
|
|
|
"jax/dlpack.py" = ["F401"]
|
|
|
|
"jax/dtypes.py" = ["F401"]
|
|
|
|
"jax/errors.py" = ["F401"]
|
|
|
|
"jax/experimental/*.py" = ["F401"]
|
|
|
|
"jax/extend/*.py" = ["F401"]
|
|
|
|
"jax/flatten_util.py" = ["F401"]
|
|
|
|
"jax/interpreters/ad.py" = ["F401"]
|
|
|
|
"jax/interpreters/batching.py" = ["F401"]
|
|
|
|
"jax/interpreters/mlir.py" = ["F401"]
|
|
|
|
"jax/interpreters/partial_eval.py" = ["F401"]
|
|
|
|
"jax/interpreters/pxla.py" = ["F401"]
|
|
|
|
"jax/interpreters/xla.py" = ["F401"]
|
|
|
|
"jax/lax/*.py" = ["F401"]
|
|
|
|
"jax/linear_util.py" = ["F401"]
|
|
|
|
"jax/monitoring.py" = ["F401"]
|
|
|
|
"jax/nn/*.py" = ["F401"]
|
|
|
|
"jax/numpy/*.py" = ["F401"]
|
|
|
|
"jax/prng.py" = ["F401"]
|
|
|
|
"jax/profiler.py" = ["F401"]
|
|
|
|
"jax/random.py" = ["F401"]
|
|
|
|
"jax/scipy/*.py" = ["F401"]
|
|
|
|
"jax/sharding.py" = ["F401"]
|
|
|
|
"jax/stages.py" = ["F401"]
|
|
|
|
"jax/test_util.py" = ["F401"]
|
|
|
|
"jax/tree_util.py" = ["F401"]
|
|
|
|
"jax/typing.py" = ["F401"]
|
|
|
|
"jax/util.py" = ["F401"]
|
|
|
|
# F821: Undefined name.
|
|
|
|
"jax/numpy/__init__.pyi" = ["F821"]
|