|
| 1 | +[build-system] |
| 2 | +requires = [ |
| 3 | + "scikit-build-core>=0.11", |
| 4 | + "Cython >=3.0.12, <3.1.0" |
| 5 | +] |
| 6 | +build-backend = "scikit_build_core.build" |
| 7 | + |
| 8 | +[project] |
| 9 | +name = "RapidFuzz" |
| 10 | +dynamic = ["version"] |
| 11 | +requires-python = ">= 3.9" |
| 12 | +authors = [ |
| 13 | + {name = "Max Bachmann", email = "pypi@maxbachmann.de"}, |
| 14 | +] |
| 15 | +description = "rapid fuzzy string matching" |
| 16 | +readme = "README.md" |
| 17 | +license = "MIT" |
| 18 | +classifiers=[ |
| 19 | + "Programming Language :: Python :: 3", |
| 20 | + "Programming Language :: Python :: 3.9", |
| 21 | + "Programming Language :: Python :: 3.10", |
| 22 | + "Programming Language :: Python :: 3.11", |
| 23 | + "Programming Language :: Python :: 3.12", |
| 24 | + "Programming Language :: Python :: 3.13", |
| 25 | +] |
| 26 | + |
| 27 | +[project.urls] |
| 28 | +Homepage = "https://github.com/rapidfuzz/RapidFuzz" |
| 29 | +Documentation = "https://rapidfuzz.github.io/RapidFuzz/" |
| 30 | +Repository = "https://github.com/rapidfuzz/RapidFuzz.git" |
| 31 | +Issues = "https://github.com/rapidfuzz/RapidFuzz/issues" |
| 32 | +Changelog = "https://github.com/rapidfuzz/RapidFuzz/blob/main/CHANGELOG.rst" |
| 33 | + |
| 34 | +[project.optional-dependencies] |
| 35 | +all = [ |
| 36 | + "numpy" |
| 37 | +] |
| 38 | + |
| 39 | +[project.entry-points.pyinstaller40] |
| 40 | +hook-dirs = "rapidfuzz.__pyinstaller:get_hook_dirs" |
| 41 | +tests = "rapidfuzz.__pyinstaller:get_PyInstaller_tests" |
| 42 | + |
| 43 | +[tool.scikit-build] |
| 44 | +minimum-version = "build-system.requires" |
| 45 | +sdist.include = [ |
| 46 | + "src/rapidfuzz/*.cxx", |
| 47 | + "src/rapidfuzz/distance/*.cxx", |
| 48 | +] |
| 49 | +sdist.exclude = [ |
| 50 | + ".github" |
| 51 | +] |
| 52 | +wheel.exclude = [ |
| 53 | + "**.pyx", |
| 54 | + "**.cxx", |
| 55 | + "**.pxd", |
| 56 | + "**.cpp", |
| 57 | + "**.hpp", |
| 58 | + "**.h", |
| 59 | + "CMakeLists.txt" |
| 60 | +] |
| 61 | +wheel.packages = ["src/rapidfuzz"] |
| 62 | +wheel.cmake = false |
| 63 | +messages.after-success = "{yellow}CMake unavailable, falling back to pure Python Extension" |
| 64 | + |
| 65 | +[[tool.scikit-build.overrides]] |
| 66 | +if.any.system-cmake = ">=3.15" |
| 67 | +if.any.cmake-wheel = true |
| 68 | +wheel.cmake = true |
| 69 | +messages.after-success = "{green}C++ Extension built successfully" |
| 70 | + |
| 71 | +[[tool.scikit-build.overrides]] |
| 72 | +if.failed = true |
| 73 | +if.env.CIBUILDWHEEL = false |
| 74 | +if.env.CONDA_BUILD = false |
| 75 | +if.env.PIWHEELS_BUILD = false |
| 76 | +if.env.RAPIDFUZZ_BUILD_EXTENSION = false |
| 77 | +wheel.cmake = false |
| 78 | +messages.after-success = "{yellow}Failed to build C++ Extension, falling back to pure Python Extension" |
| 79 | + |
| 80 | +[[tool.scikit-build.overrides]] |
| 81 | +if.any.env.CIBUILDWHEEL = true |
| 82 | +if.any.env.CONDA_BUILD = true |
| 83 | +if.any.env.PIWHEELS_BUILD = true |
| 84 | +if.any.env.RAPIDFUZZ_BUILD_EXTENSION = true |
| 85 | +wheel.cmake = true |
| 86 | +messages.after-success = "{green}C++ Extension built successfully" |
| 87 | +messages.after-failure = "{red}Failed to build C++ Extension in a packaged build" |
| 88 | + |
| 89 | +[tool.scikit-build.metadata.version] |
| 90 | +provider = "scikit_build_core.metadata.regex" |
| 91 | +input = "src/rapidfuzz/__init__.py" |
| 92 | + |
| 93 | + |
| 94 | +[tool.black] |
| 95 | +line-length = 120 |
| 96 | + |
| 97 | +[tool.mypy] |
| 98 | +files = ["src"] |
| 99 | +python_version = "3.9" |
| 100 | +warn_unused_configs = true |
| 101 | +show_error_codes = true |
| 102 | +enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"] |
| 103 | +strict = true |
| 104 | +disallow_untyped_defs = false |
| 105 | + |
| 106 | +[tool.pytest.ini_options] |
| 107 | +minversion = "6.0" |
| 108 | +testpaths = ["tests"] |
| 109 | +addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"] |
| 110 | +norecursedirs = ["_skbuild"] |
| 111 | +xfail_strict = true |
| 112 | +log_cli_level = "info" |
| 113 | + |
| 114 | +[tool.pylint] |
| 115 | +py-version = "3.9" |
| 116 | + |
| 117 | +[tool.pylint.reports] |
| 118 | +output-format = "colorized" |
| 119 | + |
| 120 | +[tool.pylint.messages_control] |
| 121 | +disable = [ |
| 122 | + "design", |
| 123 | + "fixme", |
| 124 | + "imports", |
| 125 | + "line-too-long", |
| 126 | + "imports", |
| 127 | + "invalid-name", |
| 128 | + "protected-access", |
| 129 | + "missing-module-docstring", |
| 130 | +] |
| 131 | + |
| 132 | +[tool.ruff] |
| 133 | +target-version = "py39" |
| 134 | +src = ["src"] |
| 135 | +exclude = [] |
| 136 | + |
| 137 | +[tool.ruff.lint] |
| 138 | +select = [ |
| 139 | + "E", "F", "W", # flake8 |
| 140 | + "B", # flake8-bugbear |
| 141 | + "I", # isort |
| 142 | + "ARG", # flake8-unused-arguments |
| 143 | + "C4", # flake8-comprehensions |
| 144 | + "EM", # flake8-errmsg |
| 145 | + "ICN", # flake8-import-conventions |
| 146 | + "ISC", # flake8-implicit-str-concat |
| 147 | + "G", # flake8-logging-format |
| 148 | + "PGH", # pygrep-hooks |
| 149 | + "PIE", # flake8-pie |
| 150 | + "PL", # pylint |
| 151 | + "PT", # flake8-pytest-style |
| 152 | + "PTH", # flake8-use-pathlib |
| 153 | + "RET", # flake8-return |
| 154 | + "RUF", # Ruff-specific |
| 155 | + "SIM", # flake8-simplify |
| 156 | + "T20", # flake8-print |
| 157 | + "UP", # pyupgrade |
| 158 | + "YTT", # flake8-2020 |
| 159 | + "EXE", # flake8-executable |
| 160 | + "NPY", # NumPy specific rules |
| 161 | + "PD", # pandas-vet |
| 162 | +] |
| 163 | +extend-ignore = [ |
| 164 | + "PLR", # Design related pylint codes |
| 165 | + "E501", # Line too long |
| 166 | + "PTH123", # use pathlib instead of builtin open |
| 167 | +] |
| 168 | +unfixable = [ |
| 169 | + "T20", # Removes print statements |
| 170 | + "F841", # Removes unused variables |
| 171 | +] |
| 172 | +flake8-unused-arguments.ignore-variadic-names = true |
| 173 | +isort.required-imports = ["from __future__ import annotations"] |
| 174 | +isort.combine-as-imports = true |
| 175 | + |
| 176 | +[tool.ruff.lint.per-file-ignores] |
| 177 | +"tests/**" = ["T20"] |
| 178 | +"bench/**" = ["T20"] |
| 179 | +"tools/**" = ["T20"] |
| 180 | +"tools/test_process_typing.py" = ["ARG001"] |
| 181 | +"_custom_build/backend.py" = ["T20"] |
| 182 | +"setup.py" = ["T20"] |
0 commit comments