pyproject.toml 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835
  1. [build-system]
  2. # Minimum requirements for the build system to execute.
  3. # See https://github.com/scipy/scipy/pull/12940 for the AIX issue.
  4. requires = [
  5. "meson-python>=0.17.1,<1",
  6. "meson>=1.2.1,<2",
  7. "wheel",
  8. "Cython<4.0.0a0", # Note: sync with setup.py, environment.yml and asv.conf.json
  9. # Force numpy higher than 2.0, so that built wheels are compatible
  10. # with both numpy 1 and 2
  11. "numpy>=2.0.0",
  12. "versioneer[toml]"
  13. ]
  14. build-backend = "mesonpy"
  15. [project]
  16. name = 'pandas'
  17. dynamic = [
  18. 'version'
  19. ]
  20. description = 'Powerful data structures for data analysis, time series, and statistics'
  21. readme = 'README.md'
  22. authors = [
  23. { name = 'The Pandas Development Team', email='pandas-dev@python.org' },
  24. ]
  25. license = {file = 'LICENSE'}
  26. requires-python = '>=3.11'
  27. dependencies = [
  28. "numpy>=1.26.0; python_version < '3.14'",
  29. # Earlier versions of NumPy are fundamentally broken on 3.14
  30. "numpy>=2.3.3; python_version >= '3.14'",
  31. "python-dateutil>=2.8.2",
  32. "tzdata; sys_platform == 'win32'",
  33. # Emscripten is the platform system for Pyodide.
  34. "tzdata; sys_platform == 'emscripten'",
  35. ]
  36. classifiers = [
  37. 'Development Status :: 5 - Production/Stable',
  38. 'Environment :: Console',
  39. 'Intended Audience :: Science/Research',
  40. 'License :: OSI Approved :: BSD License',
  41. 'Operating System :: OS Independent',
  42. 'Programming Language :: Cython',
  43. 'Programming Language :: Python',
  44. 'Programming Language :: Python :: 3',
  45. 'Programming Language :: Python :: 3 :: Only',
  46. 'Programming Language :: Python :: 3.11',
  47. 'Programming Language :: Python :: 3.12',
  48. 'Programming Language :: Python :: 3.13',
  49. 'Programming Language :: Python :: 3.14',
  50. 'Topic :: Scientific/Engineering'
  51. ]
  52. [project.urls]
  53. homepage = 'https://pandas.pydata.org'
  54. documentation = 'https://pandas.pydata.org/docs/'
  55. repository = 'https://github.com/pandas-dev/pandas'
  56. [project.entry-points."pandas_plotting_backends"]
  57. matplotlib = "pandas:plotting._matplotlib"
  58. [project.optional-dependencies]
  59. test = ['hypothesis>=6.116.0', 'pytest>=8.3.4', 'pytest-xdist>=3.6.1']
  60. pyarrow = ['pyarrow>=13.0.0']
  61. performance = ['bottleneck>=1.4.2', 'numba>=0.60.0', 'numexpr>=2.10.2']
  62. computation = ['scipy>=1.14.1', 'xarray>=2024.10.0']
  63. fss = ['fsspec>=2024.10.0']
  64. aws = ['s3fs>=2024.10.0']
  65. gcp = ['gcsfs>=2024.10.0']
  66. excel = ['odfpy>=1.4.1', 'openpyxl>=3.1.5', 'python-calamine>=0.3.0', 'pyxlsb>=1.0.10', 'xlrd>=2.0.1', 'xlsxwriter>=3.2.0']
  67. parquet = ['pyarrow>=13.0.0']
  68. feather = ['pyarrow>=13.0.0']
  69. iceberg = ['pyiceberg>=0.8.1']
  70. hdf5 = ['tables>=3.10.1']
  71. spss = ['pyreadstat>=1.2.8']
  72. postgresql = ['SQLAlchemy>=2.0.36', 'psycopg2>=2.9.10', 'adbc-driver-postgresql>=1.2.0']
  73. mysql = ['SQLAlchemy>=2.0.36', 'pymysql>=1.1.1']
  74. sql-other = ['SQLAlchemy>=2.0.36', 'adbc-driver-postgresql>=1.2.0', 'adbc-driver-sqlite>=1.2.0']
  75. html = ['beautifulsoup4>=4.12.3', 'html5lib>=1.1', 'lxml>=5.3.0']
  76. xml = ['lxml>=5.3.0']
  77. plot = ['matplotlib>=3.9.3']
  78. output-formatting = ['jinja2>=3.1.5', 'tabulate>=0.9.0']
  79. clipboard = ['PyQt5>=5.15.9', 'qtpy>=2.4.2']
  80. compression = ['zstandard>=0.23.0']
  81. timezone = ['pytz>=2024.2']
  82. all = ['adbc-driver-postgresql>=1.2.0',
  83. 'adbc-driver-sqlite>=1.2.0',
  84. 'beautifulsoup4>=4.12.3',
  85. 'bottleneck>=1.4.2',
  86. 'fastparquet>=2024.11.0',
  87. 'fsspec>=2024.10.0',
  88. 'gcsfs>=2024.10.0',
  89. 'html5lib>=1.1',
  90. 'hypothesis>=6.116.0',
  91. 'jinja2>=3.1.5',
  92. 'lxml>=5.3.0',
  93. 'matplotlib>=3.9.3',
  94. 'numba>=0.60.0',
  95. 'numexpr>=2.10.2',
  96. 'odfpy>=1.4.1',
  97. 'openpyxl>=3.1.5',
  98. 'psycopg2>=2.9.10',
  99. 'pyarrow>=13.0.0',
  100. 'pyiceberg>=0.8.1',
  101. 'pymysql>=1.1.1',
  102. 'PyQt5>=5.15.9',
  103. 'pyreadstat>=1.2.8',
  104. 'pytest>=8.3.4',
  105. 'pytest-xdist>=3.6.1',
  106. 'python-calamine>=0.3.0',
  107. 'pytz>=2024.2',
  108. 'pyxlsb>=1.0.10',
  109. 'qtpy>=2.4.2',
  110. 'scipy>=1.14.1',
  111. 's3fs>=2024.10.0',
  112. 'SQLAlchemy>=2.0.36',
  113. 'tables>=3.10.1',
  114. 'tabulate>=0.9.0',
  115. 'xarray>=2024.10.0',
  116. 'xlrd>=2.0.1',
  117. 'xlsxwriter>=3.2.0',
  118. 'zstandard>=0.23.0']
  119. # TODO: Remove after setuptools support is dropped.
  120. [tool.setuptools]
  121. include-package-data = true
  122. [tool.setuptools.packages.find]
  123. include = ["pandas", "pandas.*"]
  124. namespaces = false
  125. [tool.setuptools.exclude-package-data]
  126. "*" = ["*.c", "*.h"]
  127. # See the docstring in versioneer.py for instructions. Note that you must
  128. # re-run 'versioneer.py setup' after changing this section, and commit the
  129. # resulting files.
  130. [tool.versioneer]
  131. VCS = "git"
  132. style = "pep440"
  133. versionfile_source = "pandas/_version.py"
  134. versionfile_build = "pandas/_version.py"
  135. tag_prefix = "v"
  136. parentdir_prefix = "pandas-"
  137. [tool.meson-python.args]
  138. setup = ['--vsenv'] # For Windows
  139. [tool.cibuildwheel]
  140. skip = ["*_i686", "*_ppc64le", "*_s390x"]
  141. build-verbosity = 3
  142. environment = {LDFLAGS="-Wl,--strip-all"}
  143. test-extras = "test"
  144. test-command = """
  145. PANDAS_CI='1' python -c 'import pandas as pd; \
  146. pd.test(extra_args=["-m not clipboard and not single_cpu and not slow and not network and not db", "-n 2", "--no-strict-data-files"]); \
  147. pd.test(extra_args=["-m not clipboard and single_cpu and not slow and not network and not db", "--no-strict-data-files"]);' \
  148. """
  149. enable = ["cpython-freethreading"]
  150. before-build = "PACKAGE_DIR={package} bash {package}/scripts/cibw_before_build.sh"
  151. [tool.cibuildwheel.windows]
  152. environment = {}
  153. before-build = "pip install delvewheel"
  154. test-command = """
  155. set PANDAS_CI='1' && \
  156. python -c "import pandas as pd; \
  157. pd.test(extra_args=['--no-strict-data-files', '-m not clipboard and not single_cpu and not slow and not network and not db']);" \
  158. """
  159. repair-wheel-command = "delvewheel repair -w {dest_dir} {wheel}"
  160. [[tool.cibuildwheel.overrides]]
  161. select = "*-manylinux_aarch64*"
  162. test-command = """
  163. PANDAS_CI='1' python -c 'import pandas as pd; \
  164. pd.test(extra_args=["-m not clipboard and not single_cpu and not slow and not network and not db and not fails_arm_wheels", "-n 2", "--no-strict-data-files"]); \
  165. pd.test(extra_args=["-m not clipboard and single_cpu and not slow and not network and not db", "--no-strict-data-files"]);' \
  166. """
  167. [[tool.cibuildwheel.overrides]]
  168. select = "*-musllinux*"
  169. before-test = "apk update && apk add musl-locales"
  170. [[tool.cibuildwheel.overrides]]
  171. # Don't strip wheels on macOS.
  172. # macOS doesn't support stripping wheels with linker
  173. # https://github.com/MacPython/numpy-wheels/pull/87#issuecomment-624878264
  174. select = "*-macosx*"
  175. environment = {CFLAGS="-g0"}
  176. [[tool.cibuildwheel.overrides]]
  177. select = "*pyodide*"
  178. test-requires = "pytest>=8.3.4 hypothesis>=6.116.0"
  179. # Pyodide repairs wheels on its own, using auditwheel-emscripten
  180. repair-wheel-command = ""
  181. # https://github.com/pyodide/pyodide/issues/5805
  182. build-verbosity = 1
  183. test-command = """
  184. PANDAS_CI='1' python -c 'import pandas as pd; \
  185. pd.test(extra_args=["-m not clipboard and not single_cpu and not slow and not network and not db", "--no-strict-data-files"]);' \
  186. """
  187. [tool.ruff]
  188. line-length = 88
  189. target-version = "py311"
  190. fix = true
  191. [tool.ruff.lint]
  192. unfixable = []
  193. typing-modules = ["pandas._typing"]
  194. select = [
  195. # pyflakes
  196. "F",
  197. # pycodestyle
  198. "E", "W",
  199. # flake8-2020
  200. "YTT",
  201. # flake8-bugbear
  202. "B",
  203. # flake8-quotes
  204. "Q",
  205. # flake8-debugger
  206. "T10",
  207. # flake8-gettext
  208. "INT",
  209. # pylint
  210. "PL",
  211. # flake8-pytest-style
  212. "PT",
  213. # misc lints
  214. "PIE",
  215. # flake8-pyi
  216. "PYI",
  217. # tidy imports
  218. "TID",
  219. # implicit string concatenation
  220. "ISC",
  221. # flake8-type-checking
  222. "TC",
  223. # comprehensions
  224. "C4",
  225. # pygrep-hooks
  226. "PGH",
  227. # Ruff-specific rules
  228. "RUF",
  229. # flake8-bandit: exec-builtin
  230. "S102",
  231. # numpy-legacy-random
  232. "NPY002",
  233. # Perflint
  234. "PERF",
  235. # flynt
  236. "FLY",
  237. # flake8-logging-format
  238. "G",
  239. # flake8-future-annotations
  240. "FA",
  241. # unconventional-import-alias
  242. "ICN001",
  243. # flake8-slots
  244. "SLOT",
  245. # flake8-raise
  246. "RSE"
  247. ]
  248. ignore = [
  249. ### Intentionally disabled
  250. # module level import not at top of file
  251. "E402",
  252. # do not assign a lambda expression, use a def
  253. "E731",
  254. # controversial
  255. "B007",
  256. # controversial
  257. "B008",
  258. # getattr is used to side-step mypy
  259. "B010",
  260. # tests use comparisons but not their returned value
  261. "B015",
  262. # Function definition does not bind loop variable
  263. "B023",
  264. # Too many arguments to function call
  265. "PLR0913",
  266. # Too many returns
  267. "PLR0911",
  268. # Too many branches
  269. "PLR0912",
  270. # Too many statements
  271. "PLR0915",
  272. # Redefined loop name
  273. "PLW2901",
  274. # Global statements are discouraged
  275. "PLW0603",
  276. # Use `typing.NamedTuple` instead of `collections.namedtuple`
  277. "PYI024",
  278. # Use of possibly insecure function; consider using ast.literal_eval
  279. "S307",
  280. # while int | float can be shortened to float, the former is more explicit
  281. "PYI041",
  282. # incorrect-dict-iterator, flags valid Series.items usage
  283. "PERF102",
  284. # pytest-parametrize-names-wrong-type
  285. "PT006",
  286. # pytest-parametrize-values-wrong-type
  287. "PT007",
  288. # pytest-patch-with-lambda
  289. "PT008",
  290. # pytest-raises-with-multiple-statements
  291. "PT012",
  292. # pytest-assert-in-except
  293. "PT017",
  294. # pytest-composite-assertion
  295. "PT018",
  296. # pytest-fixture-param-without-value
  297. "PT019",
  298. # The following rules may cause conflicts when used with the formatter:
  299. "ISC001",
  300. # if-stmt-min-max
  301. "PLR1730",
  302. # nan-comparison
  303. "PLW0177",
  304. ### TODO: Enable gradually
  305. # Useless statement
  306. "B018",
  307. # Magic number
  308. "PLR2004",
  309. # comparison-with-itself
  310. "PLR0124",
  311. # pairwise-over-zipped
  312. "RUF007",
  313. # mutable-class-default
  314. "RUF012",
  315. # type-comparison
  316. "E721",
  317. # self-or-cls-assignment
  318. "PLW0642",
  319. # literal-membership
  320. "PLR6201", # 847 errors
  321. # Method could be a function, class method, or static method
  322. "PLR6301", # 11411 errors
  323. # Private name import
  324. "PLC2701", # 27 errors
  325. # Too many positional arguments (6/5)
  326. "PLR0917", # 470 errors
  327. # compare-to-empty-string
  328. "PLC1901",
  329. # `tempfile.NamedTemporaryFile` in text mode without explicit `encoding` argument
  330. "PLW1514", # 1 error
  331. # Object does not implement `__hash__` method
  332. "PLW1641", # 16 errors
  333. # Bad or misspelled dunder method name
  334. "PLW3201", # 69 errors, seems to be all false positive
  335. # Unpacking a dictionary in iteration without calling `.items()`
  336. "PLE1141", # autofixable
  337. # import-outside-toplevel
  338. "PLC0415",
  339. # unnecessary-dunder-call
  340. "PLC2801",
  341. # comparison-with-itself
  342. "PLR0124",
  343. # too-many-public-methods
  344. "PLR0904",
  345. # too-many-return-statements
  346. "PLR0911",
  347. # too-many-branches
  348. "PLR0912",
  349. # too-many-arguments
  350. "PLR0913",
  351. # too-many-locals
  352. "PLR0914",
  353. # too-many-statements
  354. "PLR0915",
  355. # too-many-boolean-expressions
  356. "PLR0916",
  357. # too-many-nested-blocks
  358. "PLR1702",
  359. # redefined-argument-from-local
  360. "PLR1704",
  361. # unnecessary-lambda
  362. "PLW0108",
  363. # global-statement
  364. "PLW0603",
  365. # runtime-cast-value
  366. "TC006",
  367. # unused-unpacked-variable
  368. "RUF059",
  369. # pytest-raises-ambiguous-pattern
  370. "RUF043",
  371. ]
  372. exclude = [
  373. "doc/sphinxext/*.py",
  374. "doc/build/*.py",
  375. "doc/temp/*.py",
  376. ".eggs/*.py",
  377. # vendored files
  378. "pandas/util/version/*",
  379. "pandas/io/clipboard/__init__.py",
  380. # exclude asv benchmark environments from linting
  381. "env",
  382. ]
  383. [tool.ruff.lint.flake8-tidy-imports.banned-api]
  384. "urllib.request.urlopen".msg = "Use pandas.io.common.urlopen instead of urllib.request.urlopen"
  385. # numpy.random is banned but np.random is not. Is this intentional?
  386. # "numpy.random".msg = "Do not use numpy.random"
  387. "pytest.warns".msg = "Use tm.assert_produces_warning instead of pytest.warns"
  388. "pytest.xfail".msg = "Use pytest.mark.xfail instead of pytest.xfail"
  389. "conftest".msg = "No direct imports from conftest"
  390. "numpy.testing".msg = "Do not use numpy.testing"
  391. # "numpy.array_equal".msg = "Do not use numpy.array_equal" # Used in pandas/core
  392. "unittest.mock".msg = "use pytest builtin monkeypatch fixture instead"
  393. "os.remove".msg = "Do not use os.remove"
  394. [tool.ruff.lint.flake8-import-conventions.aliases]
  395. "pandas.core.construction.array" = "pd_array"
  396. [tool.ruff.lint.per-file-ignores]
  397. # relative imports allowed for asv_bench
  398. "asv_bench/*" = ["TID", "NPY002"]
  399. # to be enabled gradually
  400. "pandas/tests/*" = ["B028", "FLY"]
  401. # Keep this one enabled
  402. "pandas/_typing.py" = ["TC"]
  403. # TODO: Fix B905 (zip-without-explicit-strict) - Remove files below as they're fixed
  404. # For contributors working on this issue:
  405. # After adding strict={True,False} to zip() calls in a file,
  406. # remove its line from this section
  407. "pandas/tests/frame/conftest.py" = ["B905"]
  408. "pandas/tests/frame/constructors/test_from_dict.py" = ["B905"]
  409. "pandas/tests/frame/indexing/test_delitem.py" = ["B905"]
  410. "pandas/tests/frame/indexing/test_getitem.py" = ["B905"]
  411. "pandas/tests/frame/indexing/test_indexing.py" = ["B905"]
  412. "pandas/tests/frame/indexing/test_setitem.py" = ["B905"]
  413. "pandas/tests/frame/indexing/test_xs.py" = ["B905"]
  414. "pandas/tests/frame/methods/test_drop.py" = ["B905"]
  415. "pandas/tests/frame/methods/test_isin.py" = ["B905"]
  416. "pandas/tests/frame/methods/test_pop.py" = ["B905"]
  417. "pandas/tests/frame/methods/test_replace.py" = ["B905"]
  418. "pandas/tests/frame/methods/test_reset_index.py" = ["B905"]
  419. "pandas/tests/frame/methods/test_to_dict.py" = ["B905"]
  420. "pandas/tests/frame/test_api.py" = ["B905"]
  421. "pandas/tests/frame/test_constructors.py" = ["B905"]
  422. "pandas/tests/frame/test_iteration.py" = ["B905"]
  423. "pandas/tests/frame/test_query_eval.py" = ["B905"]
  424. "pandas/tests/frame/test_stack_unstack.py" = ["B905"]
  425. "pandas/tests/frame/test_subclass.py" = ["B905"]
  426. "pandas/tests/frame/test_ufunc.py" = ["B905"]
  427. "pandas/tests/groupby/test_groupby_dropna.py" = ["B905"]
  428. "pandas/tests/groupby/test_groupby.py" = ["B905"]
  429. "pandas/tests/groupby/test_grouping.py" = ["B905"]
  430. "pandas/tests/groupby/test_raises.py" = ["B905"]
  431. "pandas/tests/groupby/test_timegrouper.py" = ["B905"]
  432. "pandas/tests/groupby/transform/test_transform.py" = ["B905"]
  433. "pandas/tests/indexes/categorical/test_map.py" = ["B905"]
  434. "pandas/tests/indexes/datetimes/methods/test_astype.py" = ["B905"]
  435. "pandas/tests/indexes/datetimes/test_formats.py" = ["B905"]
  436. "pandas/tests/indexes/datetimes/test_partial_slicing.py" = ["B905"]
  437. "pandas/tests/indexes/datetimes/test_scalar_compat.py" = ["B905"]
  438. "pandas/tests/indexes/datetimes/test_timezones.py" = ["B905"]
  439. "pandas/tests/indexes/interval/test_constructors.py" = ["B905"]
  440. "pandas/tests/indexes/interval/test_formats.py" = ["B905"]
  441. "pandas/tests/indexes/interval/test_interval.py" = ["B905"]
  442. "pandas/tests/indexes/period/methods/test_asfreq.py" = ["B905"]
  443. "pandas/tests/indexes/period/test_constructors.py" = ["B905"]
  444. "pandas/tests/indexes/period/test_formats.py" = ["B905"]
  445. "pandas/tests/indexes/period/test_period.py" = ["B905"]
  446. "pandas/tests/indexes/test_base.py" = ["B905"]
  447. "pandas/tests/indexes/test_datetimelike.py" = ["B905"]
  448. "pandas/tests/indexes/test_old_base.py" = ["B905"]
  449. "pandas/tests/indexes/test_setops.py" = ["B905"]
  450. "pandas/tests/indexes/timedeltas/test_formats.py" = ["B905"]
  451. "pandas/tests/indexing/interval/test_interval.py" = ["B905"]
  452. "pandas/tests/indexing/multiindex/test_getitem.py" = ["B905"]
  453. "pandas/tests/indexing/multiindex/test_iloc.py" = ["B905"]
  454. "pandas/tests/indexing/multiindex/test_indexing_slow.py" = ["B905"]
  455. "pandas/tests/indexing/multiindex/test_loc.py" = ["B905"]
  456. "pandas/tests/indexing/multiindex/test_setitem.py" = ["B905"]
  457. "pandas/tests/indexing/multiindex/test_sorted.py" = ["B905"]
  458. "pandas/tests/indexing/test_coercion.py" = ["B905"]
  459. "pandas/tests/indexing/test_loc.py" = ["B905"]
  460. "pandas/tests/internals/test_internals.py" = ["B905"]
  461. "pandas/tests/io/excel/test_writers.py" = ["B905"]
  462. "pandas/tests/io/formats/style/test_style.py" = ["B905"]
  463. "pandas/tests/io/formats/test_format.py" = ["B905"]
  464. "pandas/tests/io/formats/test_ipython_compat.py" = ["B905"]
  465. "pandas/tests/io/formats/test_to_string.py" = ["B905"]
  466. "pandas/tests/io/generate_legacy_storage_files.py" = ["B905"]
  467. "pandas/tests/io/parser/conftest.py" = ["B905"]
  468. "pandas/tests/io/parser/dtypes/test_categorical.py" = ["B905"]
  469. "pandas/tests/io/parser/test_header.py" = ["B905"]
  470. "pandas/tests/io/parser/test_python_parser_only.py" = ["B905"]
  471. "pandas/tests/io/pytables/test_complex.py" = ["B905"]
  472. "pandas/tests/io/pytables/test_select.py" = ["B905"]
  473. "pandas/tests/io/sas/test_sas7bdat.py" = ["B905"]
  474. "pandas/tests/io/test_gcs.py" = ["B905"]
  475. "pandas/tests/io/test_html.py" = ["B905"]
  476. "pandas/tests/io/test_sql.py" = ["B905"]
  477. "pandas/tests/io/test_stata.py" = ["B905"]
  478. "pandas/tests/plotting/common.py" = ["B905"]
  479. "pandas/tests/plotting/frame/test_frame_color.py" = ["B905"]
  480. "pandas/tests/resample/test_base.py" = ["B905"]
  481. "pandas/tests/reshape/concat/test_concat.py" = ["B905"]
  482. "pandas/tests/reshape/concat/test_index.py" = ["B905"]
  483. "pandas/tests/reshape/test_melt.py" = ["B905"]
  484. "pandas/tests/reshape/test_qcut.py" = ["B905"]
  485. "pandas/tests/scalar/period/test_asfreq.py" = ["B905"]
  486. "pandas/tests/series/accessors/test_dt_accessor.py" = ["B905"]
  487. "pandas/tests/series/indexing/test_get.py" = ["B905"]
  488. "pandas/tests/series/test_api.py" = ["B905"]
  489. "pandas/tests/series/test_constructors.py" = ["B905"]
  490. "pandas/tests/strings/conftest.py" = ["B905"]
  491. [tool.ruff.lint.flake8-pytest-style]
  492. fixture-parentheses = false
  493. mark-parentheses = false
  494. [tool.ruff.format]
  495. docstring-code-format = true
  496. [tool.pytest.ini_options]
  497. # sync minversion with pyproject.toml & install.rst
  498. minversion = "8.3.4"
  499. addopts = "--strict-markers --strict-config --capture=no --durations=30 --junitxml=test-data.xml"
  500. empty_parameter_set_mark = "fail_at_collect"
  501. xfail_strict = true
  502. testpaths = "pandas"
  503. doctest_optionflags = [
  504. "NORMALIZE_WHITESPACE",
  505. "IGNORE_EXCEPTION_DETAIL",
  506. "ELLIPSIS",
  507. ]
  508. filterwarnings = [
  509. "error:::pandas",
  510. "error::ResourceWarning",
  511. "error::pytest.PytestUnraisableExceptionWarning",
  512. "error::pytest.PytestWarning",
  513. # e.g. Module already imported so cannot be rewritten; _hypothesis_globals
  514. "ignore::pytest.PytestAssertRewriteWarning",
  515. "ignore::pytest.PytestCacheWarning",
  516. # TODO(PY311-minimum): Specify EncodingWarning
  517. # Ignore 3rd party EncodingWarning but raise on pandas'
  518. "ignore:.*encoding.* argument not specified",
  519. "error:.*encoding.* argument not specified::pandas",
  520. "ignore:.*ssl.SSLSocket:pytest.PytestUnraisableExceptionWarning",
  521. "ignore:.*ssl.SSLSocket:ResourceWarning",
  522. # GH 44844: Can remove once minimum matplotlib version >= 3.7
  523. "ignore:.*FileIO:pytest.PytestUnraisableExceptionWarning",
  524. "ignore:.*BufferedRandom:ResourceWarning",
  525. "ignore::ResourceWarning:asyncio",
  526. # From plotting doctests
  527. "ignore:More than 20 figures have been opened:RuntimeWarning",
  528. "ignore:.*urllib3:DeprecationWarning:botocore",
  529. "ignore:Setuptools is replacing distutils.:UserWarning:_distutils_hack",
  530. # https://github.com/PyTables/PyTables/issues/822
  531. "ignore:a closed node found in the registry:UserWarning:tables",
  532. ]
  533. junit_family = "xunit2"
  534. markers = [
  535. "single_cpu: tests that should run on a single cpu only",
  536. "slow: mark a test as slow",
  537. "network: mark a test as network",
  538. "db: tests requiring a database (mysql or postgres)",
  539. "clipboard: mark a pd.read_clipboard test",
  540. "arm_slow: mark a test as slow for arm64 architecture",
  541. # TODO: someone should investigate this ...
  542. # these tests only fail in the wheel builder and don't fail in regular
  543. # ARM CI
  544. "fails_arm_wheels: Tests that fail in the ARM wheel build only",
  545. ]
  546. [tool.mypy]
  547. # Import discovery
  548. mypy_path = "typings"
  549. files = ["pandas", "typings"]
  550. namespace_packages = false
  551. explicit_package_bases = false
  552. ignore_missing_imports = true
  553. follow_imports = "normal"
  554. follow_imports_for_stubs = false
  555. no_site_packages = false
  556. no_silence_site_packages = false
  557. # Platform configuration
  558. python_version = "3.11"
  559. platform = "linux-64"
  560. # Disallow dynamic typing
  561. disallow_any_unimported = false # TODO
  562. disallow_any_expr = false # TODO
  563. disallow_any_decorated = false # TODO
  564. disallow_any_explicit = false # TODO
  565. disallow_any_generics = false # TODO
  566. disallow_subclassing_any = false # TODO
  567. # Untyped definitions and calls
  568. disallow_untyped_calls = true
  569. disallow_untyped_defs = true
  570. disallow_incomplete_defs = true
  571. check_untyped_defs = true
  572. disallow_untyped_decorators = true
  573. # None and Optional handling
  574. no_implicit_optional = true
  575. strict_optional = true
  576. # Configuring warnings
  577. warn_redundant_casts = true
  578. warn_unused_ignores = true
  579. warn_no_return = true
  580. warn_return_any = false # TODO
  581. warn_unreachable = false # GH#27396
  582. # Suppressing errors
  583. ignore_errors = false
  584. enable_error_code = "ignore-without-code"
  585. # Miscellaneous strictness flags
  586. allow_untyped_globals = false
  587. allow_redefinition = false
  588. local_partial_types = true
  589. implicit_reexport = true
  590. strict_equality = true
  591. # Configuring error messages
  592. show_error_context = false
  593. show_column_numbers = false
  594. show_error_codes = true
  595. [[tool.mypy.overrides]]
  596. module = [
  597. "pandas._config.config", # TODO
  598. "pandas._libs.*",
  599. "pandas._testing.*", # TODO
  600. "pandas.compat.numpy.function", # TODO
  601. "pandas.core._numba.executor", # TODO
  602. "pandas.core.array_algos.masked_reductions", # TODO
  603. "pandas.core.array_algos.putmask", # TODO
  604. "pandas.core.array_algos.quantile", # TODO
  605. "pandas.core.array_algos.replace", # TODO
  606. "pandas.core.array_algos.take", # TODO
  607. "pandas.core.arrays.*", # TODO
  608. "pandas.core.computation.*", # TODO
  609. "pandas.core.dtypes.astype", # TODO
  610. "pandas.core.dtypes.cast", # TODO
  611. "pandas.core.dtypes.common", # TODO
  612. "pandas.core.dtypes.concat", # TODO
  613. "pandas.core.dtypes.dtypes", # TODO
  614. "pandas.core.dtypes.generic", # TODO
  615. "pandas.core.dtypes.missing", # TODO
  616. "pandas.core.groupby.generic", # TODO
  617. "pandas.core.groupby.grouper", # TODO
  618. "pandas.core.groupby.groupby", # TODO
  619. "pandas.core.groupby.ops", # TODO
  620. "pandas.core.indexers.*", # TODO
  621. "pandas.core.indexes.*", # TODO
  622. "pandas.core.interchange.column", # TODO
  623. "pandas.core.interchange.dataframe_protocol", # TODO
  624. "pandas.core.interchange.from_dataframe", # TODO
  625. "pandas.core.internals.*", # TODO
  626. "pandas.core.ops.array_ops", # TODO
  627. "pandas.core.ops.common", # TODO
  628. "pandas.core.ops.missing", # TODO
  629. "pandas.core.reshape.*", # TODO
  630. "pandas.core.strings.*", # TODO
  631. "pandas.core.tools.*", # TODO
  632. "pandas.core.window.common", # TODO
  633. "pandas.core.window.ewm", # TODO
  634. "pandas.core.window.expanding", # TODO
  635. "pandas.core.window.numba_", # TODO
  636. "pandas.core.window.online", # TODO
  637. "pandas.core.window.rolling", # TODO
  638. "pandas.core.accessor", # TODO
  639. "pandas.core.algorithms", # TODO
  640. "pandas.core.apply", # TODO
  641. "pandas.core.arraylike", # TODO
  642. "pandas.core.base", # TODO
  643. "pandas.core.common", # TODO
  644. "pandas.core.construction", # TODO
  645. "pandas.core.flags", # TODO
  646. "pandas.core.frame", # TODO
  647. "pandas.core.generic", # TODO
  648. "pandas.core.indexing", # TODO
  649. "pandas.core.missing", # TODO
  650. "pandas.core.nanops", # TODO
  651. "pandas.core.resample", # TODO
  652. "pandas.core.roperator", # TODO
  653. "pandas.core.sample", # TODO
  654. "pandas.core.series", # TODO
  655. "pandas.core.sorting", # TODO
  656. "pandas.errors", # TODO
  657. "pandas.io.clipboard", # TODO
  658. "pandas.io.excel._base", # TODO
  659. "pandas.io.excel._odfreader", # TODO
  660. "pandas.io.excel._openpyxl", # TODO
  661. "pandas.io.excel._pyxlsb", # TODO
  662. "pandas.io.excel._xlrd", # TODO
  663. "pandas.io.excel._xlsxwriter", # TODO
  664. "pandas.io.formats.excel", # TODO
  665. "pandas.io.formats.format", # TODO
  666. "pandas.io.formats.style", # TODO
  667. "pandas.io.formats.style_render", # TODO
  668. "pandas.io.formats.xml", # TODO
  669. "pandas.io.json.*", # TODO
  670. "pandas.io.parsers.*", # TODO
  671. "pandas.io.sas.sas_xport", # TODO
  672. "pandas.io.sas.sas7bdat", # TODO
  673. "pandas.io.clipboards", # TODO
  674. "pandas.io.html", # TODO
  675. "pandas.io.parquet", # TODO
  676. "pandas.io.pytables", # TODO
  677. "pandas.io.sql", # TODO
  678. "pandas.io.xml", # TODO
  679. "pandas.plotting.*", # TODO
  680. "pandas.tests.*",
  681. "pandas.tseries.frequencies", # TODO
  682. "pandas.tseries.holiday", # TODO
  683. "pandas.util._decorators", # TODO
  684. "pandas.util._doctools", # TODO
  685. "pandas.util._test_decorators", # TODO
  686. "pandas.util._validators", # TODO
  687. "pandas.util", # TODO
  688. "pandas._version",
  689. "pandas.conftest",
  690. "pandas"
  691. ]
  692. disallow_untyped_calls = false
  693. disallow_untyped_defs = false
  694. disallow_incomplete_defs = false
  695. [[tool.mypy.overrides]]
  696. module = [
  697. "pandas.tests.*",
  698. "pandas._version",
  699. "pandas.io.clipboard",
  700. ]
  701. check_untyped_defs = false
  702. [[tool.mypy.overrides]]
  703. module = [
  704. "pandas.tests.apply.test_series_apply",
  705. "pandas.tests.arithmetic.conftest",
  706. "pandas.tests.arrays.sparse.test_combine_concat",
  707. "pandas.tests.dtypes.test_common",
  708. "pandas.tests.frame.methods.test_to_records",
  709. "pandas.tests.groupby.test_rank",
  710. "pandas.tests.groupby.transform.test_transform",
  711. "pandas.tests.indexes.interval.test_interval",
  712. "pandas.tests.indexing.test_categorical",
  713. "pandas.tests.io.excel.test_writers",
  714. "pandas.tests.reductions.test_reductions",
  715. "pandas.tests.test_expressions",
  716. ]
  717. ignore_errors = true
  718. # To be kept consistent with "Import Formatting" section in contributing.rst
  719. [tool.isort]
  720. known_pre_libs = "pandas._config"
  721. known_pre_core = ["pandas._libs", "pandas._typing", "pandas.util._*", "pandas.compat", "pandas.errors"]
  722. known_dtypes = "pandas.core.dtypes"
  723. known_post_core = ["pandas.tseries", "pandas.io", "pandas.plotting"]
  724. sections = ["FUTURE", "STDLIB", "THIRDPARTY" ,"PRE_LIBS" , "PRE_CORE", "DTYPES", "FIRSTPARTY", "POST_CORE", "LOCALFOLDER"]
  725. profile = "black"
  726. combine_as_imports = true
  727. force_grid_wrap = 2
  728. force_sort_within_sections = true
  729. skip_glob = "env"
  730. skip = "pandas/__init__.py"
  731. [tool.pyright]
  732. pythonVersion = "3.11"
  733. typeCheckingMode = "basic"
  734. useLibraryCodeForTypes = false
  735. include = ["pandas", "typings"]
  736. exclude = ["pandas/tests", "pandas/io/clipboard", "pandas/util/version", "pandas/core/_numba/extensions.py"]
  737. # enable subset of "strict"
  738. reportDuplicateImport = true
  739. reportInconsistentConstructor = true
  740. reportInvalidStubStatement = true
  741. reportOverlappingOverload = true
  742. reportPropertyTypeMismatch = true
  743. reportUntypedClassDecorator = true
  744. reportUntypedFunctionDecorator = true
  745. reportUntypedNamedTuple = true
  746. reportUnusedImport = true
  747. disableBytesTypePromotions = true
  748. # disable subset of "basic"
  749. reportArgumentType = false
  750. reportAssignmentType = false
  751. reportAttributeAccessIssue = false
  752. reportCallIssue = false
  753. reportGeneralTypeIssues = false
  754. reportIndexIssue = false
  755. reportMissingModuleSource = false
  756. reportOperatorIssue = false
  757. reportOptionalCall = false
  758. reportOptionalIterable = false
  759. reportOptionalMemberAccess = false
  760. reportOptionalOperand = false
  761. reportOptionalSubscript = false
  762. reportPrivateImportUsage = false
  763. reportRedeclaration = false
  764. reportReturnType = false
  765. reportUnboundVariable = false
  766. [tool.coverage.run]
  767. branch = true
  768. omit = ["pandas/_typing.py", "pandas/_version.py"]
  769. plugins = ["Cython.Coverage"]
  770. source = ["pandas"]
  771. [tool.coverage.report]
  772. ignore_errors = false
  773. show_missing = true
  774. omit = ["pandas/_version.py"]
  775. exclude_lines = [
  776. # Have to re-enable the standard pragma
  777. "pragma: no cover",
  778. # Don't complain about missing debug-only code:s
  779. "def __repr__",
  780. "if self.debug",
  781. # Don't complain if tests don't hit defensive assertion code:
  782. "raise AssertionError",
  783. "raise NotImplementedError",
  784. "AbstractMethodError",
  785. # Don't complain if non-runnable code isn't run:
  786. "if 0:",
  787. "if __name__ == .__main__.:",
  788. "if TYPE_CHECKING:",
  789. ]
  790. [tool.coverage.html]
  791. directory = "coverage_html_report"
  792. [tool.codespell]
  793. ignore-words-list = "blocs, coo, hist, nd, sav, ser, recuse, nin, timere, expec, expecs, indext, SME, NotIn, tructures, tru, indx, abd, ABD"
  794. ignore-regex = 'https://([\w/\.])+'