content: [build-system]
  requires = ["hatchling"]
  build-backend = "hatchling.build"
  
  [project]
  name = "miditok"
  version = "3.0.6.post1"
  description = "MIDI / symbolic music tokenizers for Deep Learning models."
  readme = {file = "README.md", content-type = "text/markdown"}
  license = {file = "LICENSE"}
  requires-python = ">=3.9"
  authors = [
      { name = "Nathan Fradet" },
  ]
  keywords = [
      "artificial intelligence",
      "deep learning",
      "transformer",
      "midi",
      "tokenization",
      "music",
      "mir",
  ]
  classifiers = [
      "Intended Audience :: Developers",
      "Intended Audience :: Science/Research",
      "Topic :: Scientific/Engineering :: Artificial Intelligence",
      "Topic :: Multimedia :: Sound/Audio :: MIDI",
      "License :: OSI Approved :: MIT License",
      "Programming Language :: Python",
      "Programming Language :: Python :: 3 :: Only",
      "Programming Language :: Python :: 3.9",
      "Programming Language :: Python :: 3.10",
      "Programming Language :: Python :: 3.11",
      "Programming Language :: Python :: 3.12",
      "Programming Language :: Python :: 3.13",
      "Operating System :: OS Independent",
  ]
  dependencies = [
      "numpy>=1.19",
      "symusic>=0.5.0",
      "tqdm",
      "tokenizers>=0.13.0",
      "huggingface_hub>=0.16.4",
  ]
  
  [project.optional-dependencies]
  tests = [
      "pytest-cov",
      "pytest-xdist[psutil]",
      "torch",
      "miditoolkit",
  ]
  docs = [
      "furo",  # theme
      "sphinx-copybutton",
      "torch",  # for pytorch_data module
      # "sphinxcontrib-tikz",
  ]
  
  [project.urls]
  Homepage = "https://github.com/Natooz/MidiTok"
  Repository = "https://github.com/Natooz/MidiTok.git"
  Documentation = "https://miditok.readthedocs.io"
  Issues = "https://github.com/Natooz/MidiTok/issues"
  
  [tool.hatch.build.targets.wheel]
  packages = ["src/miditok"]
  only-packages = true
  
  [tool.hatch.version]
  path = "src/miditok/__init__.py"
  
  [mypy]
  warn_return_any = "True"
  warn_unused_configs = "True"
  plugins = "numpy.typing.mypy_plugin"
  exclude = [
      "venv",
      ".venv",
  ]
  
  [tool.pytest.ini_options]
  pythonpath = "src"
  addopts = [
      "--import-mode=importlib",
  ]
  
  [tool.coverage.report]
  exclude_also = [
      "def __repr__",
  ]
  omit = [
      # files to omit to check
      "benchmarks/*"
  ]
  
  [tool.ruff]
  target-version = "py313"
  exclude = ["colab-notebooks"]
  
  [tool.ruff.lint]
  extend-select = [
      "ARG",
      "A",
      "ANN",
      "B",
      "BLE",
      "C4",
      "COM",
      "D",
      "E",
      "EM",
      "EXE",
      "F",
      "FA",
      "FBT",
      "G",
      "I",
      "ICN",
      "INP",
      "INT",
      "ISC",
      "N",
      "NPY",
      "PERF",
      "PGH",
      "PTH",
      "PIE",
      # "PL",
      "PT",
      "Q",
      "RET",
      "RSE",
      "RUF",
      "S",
      # "SLF",
      "SIM",
      "T",
      "TCH",
      "TID",
      "UP",
      "W",
  ]
  
  # Each rule exclusion should be explained here.
  # By default, we think it is better to select groups of rules (above), and exclude
  # specific problematic rules, instead of selecting specific rules. By doing so, in case
  # the ruff rules groups change, this requires us to check and handle the new rules or
  # changes, making sure we stay up to date and keep the best practices.
  
  # ANN003:
  # Would mostly apply to args/kwargs that are passed to methods from dependencies, for
  # which the signature can change depending on the version. This would either be too
  # difficult to comply and/or would add a lot of noqa exceptions. ANN002 is used as it
  # adds very few "noqa" exceptions, but ANN003 would add too much complexity.
  
  # ANN101 and ANN102:
  # Yields errors for `self` in methods from classes, which is unecessary.
  # The existence of these rules is currently questioned, they are likely to be removed.
  # https://github.com/astral-sh/ruff/issues/4396
  
  # B905
  # The `strict` keyword argument for the `zip` built-in method appeared with Python
  # 3.10. As we support previous versions, we cannot comply (yet) with this rule. The
  # exclusion should be removed when MidiTok drop support for Python 3.9.
  
  # D107
  # We document classes at the class level (D101). This documentation should cover the
  # way classes are initialized. So we do not document `__init__` methods.
  
  # D203
  # "one-blank-line-before-class", incompatible with D211 (blank-line-before-class).
  # We follow PEP 257 and other conventions by preferring D211 over D203.
  
  # D212
  # "multi-line-summary-first-line", incompatible with D213
  # (multi-line-summary-second-line).
  # We follow PEP 257, which recommend to set put the summary line on the second line
  # after the blank line of the opening quotes.
  
  # FBT001 and FBT002
  # Refactoring all the methods to make boolean arguments keyword only would add
  # complexity and could break code of users. It's ok to have booleans as positional
  # arguments with default values. For code redability though, we enable FB003.
  
  # COM812:
  # Yields errors for one-line portions without comma. Trailing commas are automatically
  # set with ruff format anyway. This exclusion could be removed when this behavior is
  # fixed in ruff.
  
  # UP038
  # Recommends to | type union with `isinstance`, which is only supported since Python
  # 3.10. The exclusion should be removed when MidiTok drop support for Python 3.9.
  
  # (ISC001)
  # May cause conflicts when used with the ruff formatter. They recommend to disable it.
  # We leave it enabled but keep this in mind.
  
  ignore = [
      "ANN003",
      "ANN101",
      "ANN102",
      "B905",
      "COM812",
      "D107",
      "D203",
      "D212",
      "FBT001",
      "FBT002",
      "UP038",
  ]
  
  [tool.ruff.lint.per-file-ignores]
  # S105:
  # we don't use passwords in MidiTok, only HF token for the interactions with the hub.
  # However we have a lot of variables with "token"(s) in their name, which would yield a
  # lot of lint errors or require a lot of noqa exceptions.
  "src/miditok/**" = [
      "S105",
  ]
  "tests/**" = [
      "ANN201",  # allow no return type hint for pytest methods
      "D103",  # no need to document pytest methods
      "S101",  # allow assertions in tests
      "T201",  # print allowed
  ]
  "docs/conf.py" = ["INP001"]  # not a package
  