[build-system] # Minimum requirements for the build system to execute. # See https://github.com/scipy/scipy/pull/12940 for the AIX issue. requires = [ "meson-python>=0.19.0,<1", "meson>=1.2.3,<2", "wheel", # "<4", not "<4.0.0a0": a pre-release in the bound makes pip eligible to # install Cython pre-releases (that pulled the 3.3.0a1 alpha into 3.0.4). "Cython>3.1.0,<4", # Note: sync with environment.yml and asv.conf.json # numpy >= 2.0 keeps wheels compatible with numpy 1 and 2. Exclude 2.5.0: # wheels built against it segfault on older numpy (GH#66086; numpy GH#31804, # fixed in 2.5.1). "numpy>=2.0.0,!=2.5.0", "versioneer[toml]" ] build-backend = "mesonpy" [project] name = 'pandas' dynamic = ['version'] description = 'Powerful data structures for data analysis, time series, and statistics' readme = 'README.md' authors = [ { name = 'The Pandas Development Team', email='pandas-dev@python.org' }, ] license = 'BSD-3-Clause' license-files = [ "LICENSE", # BSD-3-Clause "LICENSES/BOTTLENECK_LICENCE", # BSD-2-Clause "LICENSES/DATEUTIL_LICENSE", # Apache-2.0 "LICENSES/HAVEN_LICENSE", # MIT "LICENSES/HAVEN_MIT", # MIT "LICENSES/KLIB_LICENSE", # MIT "LICENSES/MUSL_LICENSE", # MIT "LICENSES/NUMPY_LICENSE", # BSD-3-Clause "LICENSES/PACKAGING_LICENSE", # Apache-2.0 "LICENSES/PSF_LICENSE", # PSF-2.0 "LICENSES/PYPERCLIP_LICENSE", # BSD-3-Clause "LICENSES/PYUPGRADE_LICENSE", # MIT "LICENSES/SAS7BDAT_LICENSE", # MIT "LICENSES/STATSBASE_JL_LICENSE", # MIT "LICENSES/ULTRAJSON_LICENSE", # BSD-3-Clause AND TCL "LICENSES/XSIMD_LICENSE", # BSD-3-Clause "subprojects/fast_float-*/LICENSE-APACHE", # Apache-2.0 "subprojects/fast_float-*/LICENSE-BOOST", # BSL "subprojects/fast_float-*/LICENSE-MIT", # MIT ] requires-python = '>=3.11' dependencies = [ "numpy>=2.0.2; python_version < '3.14'", # Earlier versions of NumPy are fundamentally broken on 3.14 "numpy>=2.3.3; python_version >= '3.14'", "python-dateutil>=2.9.0", "tzdata; sys_platform == 'win32'", # Emscripten is the platform system for Pyodide. "tzdata; sys_platform == 'emscripten'", ] classifiers = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Intended Audience :: Science/Research', 'Operating System :: OS Independent', 'Programming Language :: Cython', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3 :: Only', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: 3.13', 'Programming Language :: Python :: 3.14', 'Programming Language :: Python :: 3.15', 'Topic :: Scientific/Engineering' ] [project.urls] homepage = 'https://pandas.pydata.org' source = 'https://github.com/pandas-dev/pandas' documentation = 'https://pandas.pydata.org/docs/' changelog = 'https://pandas.pydata.org/docs/whatsnew/index.html' issues = 'https://github.com/pandas-dev/pandas/issues' funding = 'https://opencollective.com/pandas' [project.entry-points."pandas_plotting_backends"] matplotlib = "pandas:plotting._matplotlib" [project.optional-dependencies] test = ['pytest>=8.3.4', 'pytest-xdist>=3.6.1'] pyarrow = ['pyarrow>=16.0.0'] performance = ['bottleneck>=1.5.0', 'numba>=0.61.2', 'numexpr>=2.11.0,!=2.14.1'] computation = ['scipy>=1.16.1', 'xarray>=2025.7.1'] fss = ['fsspec>=2025.7.0'] aws = ['s3fs>=2025.7.0'] gcp = ['gcsfs>=2025.7.0'] excel = ['odfpy>=1.4.1', 'openpyxl>=3.1.5', 'python-calamine>=0.4.0', 'pyxlsb>=1.0.10', 'xlrd>=2.0.2', 'xlsxwriter>=3.2.5'] parquet = ['pyarrow>=13.0.0'] feather = ['pyarrow>=13.0.0'] iceberg = ['pyiceberg>=0.9.1'] hdf5 = ['tables>=3.10.2'] spss = ['pyreadstat>=1.3.0'] postgresql = ['SQLAlchemy>=2.0.42', 'psycopg2>=2.9.10', 'adbc-driver-postgresql>=1.7.0'] mysql = ['SQLAlchemy>=2.0.42', 'pymysql>=1.1.1'] sql-other = ['SQLAlchemy>=2.0.42', 'adbc-driver-postgresql>=1.7.0', 'adbc-driver-sqlite>=1.7.0'] html = ['beautifulsoup4>=4.13.4', 'html5lib>=1.1', 'lxml>=6.0.0'] xml = ['lxml>=6.0.0'] plot = ['matplotlib>=3.10.5'] output-formatting = ['jinja2>=3.1.6', 'tabulate>=0.9.0'] clipboard = ['PyQt5>=5.15.11', 'qtpy>=2.4.3'] compression = ['zstandard>=0.23.0'] timezone = ['pytz>=2020.1'] all = ['adbc-driver-postgresql>=1.7.0', 'adbc-driver-sqlite>=1.7.0', 'beautifulsoup4>=4.13.4', 'bottleneck>=1.5.0', 'fastparquet>=2024.11.0', 'fsspec>=2025.7.0', 'gcsfs>=2025.7.0', 'html5lib>=1.1', 'jinja2>=3.1.6', 'lxml>=6.0.0', 'matplotlib>=3.10.5', 'numba>=0.61.2', 'numexpr>=2.11.0,!=2.14.1', 'odfpy>=1.4.1', 'openpyxl>=3.1.5', 'psycopg2>=2.9.10', 'pyarrow>=16.0.0', 'pyiceberg>=0.9.1', 'pymysql>=1.1.1', 'PyQt5>=5.15.11', 'pyreadstat>=1.3.0', 'pytest>=8.3.4', 'pytest-xdist>=3.6.1', 'python-calamine>=0.4.0', 'pytz>=2020.1', 'pyxlsb>=1.0.10', 'qtpy>=2.4.3', 'scipy>=1.16.1', 's3fs>=2025.7.0', 'SQLAlchemy>=2.0.42', 'tables>=3.10.2', 'tabulate>=0.9.0', 'xarray>=2025.7.1', 'xlrd>=2.0.2', 'xlsxwriter>=3.2.5', 'zstandard>=0.23.0'] # See the docstring in versioneer.py for instructions. Note that you must # re-run 'versioneer.py setup' after changing this section, and commit the # resulting files. [tool.versioneer] VCS = "git" style = "pep440" versionfile_source = "pandas/_version.py" versionfile_build = "pandas/_version.py" tag_prefix = "v" parentdir_prefix = "pandas-" [tool.meson-python.args] dist = ['--include-subprojects'] [tool.cibuildwheel] skip = ["*_i686", "*_ppc64le", "*_s390x"] enable = ["pyodide-eol"] build-verbosity = 1 config-settings = { compile-args = ["-v"] } environment = {LDFLAGS="-Wl,--strip-all"} test-extras = "test" test-requires = ["python-dateutil<3"] test-command = """ python -c 'import pandas as pd; \ pd.test(extra_args=["-m not clipboard and not single_cpu and not slow and not network and not db", "--numprocesses=2", "--dist=worksteal", "--no-strict-data-files"]); \ pd.test(extra_args=["-m not clipboard and single_cpu and not slow and not network and not db", "--no-strict-data-files"]);' \ """ [tool.cibuildwheel.windows] config-settings = { setup-args = ["--vsenv"] } environment = {} # powershell needs to swap quotes? test-command = """ python -c "import pandas as pd; \ pd.test(extra_args=['-m not clipboard and not single_cpu and not slow and not network and not db', '--numprocesses=2', '--dist=worksteal', '--no-strict-data-files']); \ pd.test(extra_args=['-m not clipboard and single_cpu and not slow and not network and not db', '--no-strict-data-files']);" \ """ [[tool.cibuildwheel.overrides]] select = "*-musllinux*" before-test = "apk update && apk add musl-locales" [[tool.cibuildwheel.overrides]] select = "*-macosx*" environment = {CFLAGS="-g0"} [[tool.cibuildwheel.overrides]] select = "*pyodide*" # pytest-xdist cannot be used on Pyodide # OSError: [Errno 138] emscripten does not support processes # nocacheprovider is needed to avoid cleaning up pytest cache failing with PermissionError test-command = """ python -c 'import pandas as pd; \ pd.test(extra_args=["-m not clipboard and not single_cpu and not slow and not network and not db", "--no-strict-data-files", "-p no:cacheprovider"]);' \ """ [tool.ruff] line-length = 88 target-version = "py311" fix = true [tool.ruff.lint] unfixable = [] typing-modules = ["pandas._typing"] select = [ # pyflakes "F", # pycodestyle "E", "W", # flake8-2020 "YTT", # flake8-bugbear "B", # flake8-quotes "Q", # flake8-debugger "T10", # flake8-gettext "INT", # pylint "PL", # flake8-pytest-style "PT", # misc lints "PIE", # flake8-pyi "PYI", # tidy imports "TID", # implicit string concatenation "ISC", # flake8-type-checking "TC", # comprehensions "C4", # pygrep-hooks "PGH", # Ruff-specific rules "RUF", # flake8-bandit: exec-builtin "S102", # numpy-legacy-random "NPY002", # Perflint "PERF", # flynt "FLY", # flake8-logging-format "G", # flake8-future-annotations "FA", # unconventional-import-alias "ICN001", # flake8-slots "SLOT", # flake8-raise "RSE", # pyupgrade "UP", ] ignore = [ ### Intentionally disabled # module level import not at top of file "E402", # do not assign a lambda expression, use a def "E731", # controversial "B007", # controversial "B008", # getattr is used to side-step mypy "B010", # tests use comparisons but not their returned value "B015", # Function definition does not bind loop variable "B023", # Too many arguments to function call "PLR0913", # Too many returns "PLR0911", # Too many branches "PLR0912", # Too many statements "PLR0915", # Redefined loop name "PLW2901", # Global statements are discouraged "PLW0603", # Use `typing.NamedTuple` instead of `collections.namedtuple` "PYI024", # Use of possibly insecure function; consider using ast.literal_eval "S307", # while int | float can be shortened to float, the former is more explicit "PYI041", # incorrect-dict-iterator, flags valid Series.items usage "PERF102", # pytest-parametrize-names-wrong-type "PT006", # pytest-parametrize-values-wrong-type "PT007", # pytest-patch-with-lambda "PT008", # pytest-raises-with-multiple-statements "PT012", # pytest-assert-in-except "PT017", # pytest-composite-assertion "PT018", # pytest-fixture-param-without-value "PT019", # The following rules may cause conflicts when used with the formatter: "ISC001", # if-stmt-min-max "PLR1730", # nan-comparison "PLW0177", ### TODO: Enable gradually # Useless statement "B018", # Magic number "PLR2004", # comparison-with-itself "PLR0124", # mutable-class-default "RUF012", # type-comparison "E721", # self-or-cls-assignment "PLW0642", # literal-membership "PLR6201", # 847 errors # Method could be a function, class method, or static method "PLR6301", # 11411 errors # Private name import "PLC2701", # 27 errors # Too many positional arguments (6/5) "PLR0917", # 470 errors # compare-to-empty-string "PLC1901", # `tempfile.NamedTemporaryFile` in text mode without explicit `encoding` argument "PLW1514", # 1 error # Object does not implement `__hash__` method "PLW1641", # 16 errors # Bad or misspelled dunder method name "PLW3201", # 69 errors, seems to be all false positive # Unpacking a dictionary in iteration without calling `.items()` "PLE1141", # autofixable # import-outside-toplevel "PLC0415", # unnecessary-dunder-call "PLC2801", # comparison-with-itself "PLR0124", # too-many-public-methods "PLR0904", # too-many-return-statements "PLR0911", # too-many-branches "PLR0912", # too-many-arguments "PLR0913", # too-many-locals "PLR0914", # too-many-statements "PLR0915", # too-many-boolean-expressions "PLR0916", # too-many-nested-blocks "PLR1702", # redefined-argument-from-local "PLR1704", # unnecessary-lambda "PLW0108", # global-statement "PLW0603", # unused-unpacked-variable "RUF059", # pytest-raises-ambiguous-pattern "RUF043", # implicit-string-concatenation-in-collection-litera "ISC004", ] exclude = [ "doc/sphinxext/*.py", "doc/build/*.py", "doc/temp/*.py", ".eggs/*.py", # vendored files "pandas/util/version/*", "pandas/io/clipboard/__init__.py", # exclude asv benchmark environments from linting "env", ] [tool.ruff.lint.flake8-tidy-imports.banned-api] "urllib.request.urlopen".msg = "Use pandas.io.common.urlopen instead of urllib.request.urlopen" # numpy.random is banned but np.random is not. Is this intentional? # "numpy.random".msg = "Do not use numpy.random" "pytest.warns".msg = "Use tm.assert_produces_warning instead of pytest.warns" "pytest.xfail".msg = "Use pytest.mark.xfail instead of pytest.xfail" "conftest".msg = "No direct imports from conftest" "numpy.testing".msg = "Do not use numpy.testing" # "numpy.array_equal".msg = "Do not use numpy.array_equal" # Used in pandas/core "unittest.mock".msg = "use pytest builtin monkeypatch fixture instead" "os.remove".msg = "Do not use os.remove" # Time-dependent test data broke CI at a DST transition (GH#44341). "datetime.datetime.now".msg = "Use a fixed datetime, not the current time (GH#44341)" "datetime.datetime.today".msg = "Use a fixed datetime, not the current time (GH#44341)" "datetime.datetime.utcnow".msg = "Use a fixed datetime, not the current time (GH#44341)" "pandas.Timestamp.now".msg = "Use a fixed datetime, not the current time (GH#44341)" "pandas.Timestamp.today".msg = "Use a fixed datetime, not the current time (GH#44341)" "pandas.Timestamp.utcnow".msg = "Use a fixed datetime, not the current time (GH#44341)" "pandas.Period.now".msg = "Use a fixed datetime, not the current time (GH#44341)" [tool.ruff.lint.flake8-import-conventions.aliases] "pandas.core.construction.array" = "pd_array" [tool.ruff.lint.per-file-ignores] # relative imports allowed for asv_bench "asv_bench/*" = ["TID", "NPY002"] # to be enabled gradually "pandas/tests/*" = ["B028", "FLY"] # Keep this one enabled "pandas/_typing.py" = ["TC"] [tool.ruff.lint.flake8-pytest-style] fixture-parentheses = false mark-parentheses = false [tool.ruff.format] docstring-code-format = true [tool.pytest.ini_options] # sync minversion with pyproject.toml & install.rst minversion = "8.3.4" addopts = "--strict-markers --strict-config --capture=no --durations=30" empty_parameter_set_mark = "fail_at_collect" xfail_strict = true testpaths = "pandas" doctest_optionflags = [ "NORMALIZE_WHITESPACE", "IGNORE_EXCEPTION_DETAIL", "ELLIPSIS", ] # https://docs.pytest.org/en/stable/how-to/capture-warnings.html#controlling-warnings # > When a warning matches more than one option in the list, the action for the last matching option is performed filterwarnings = [ "error", "error::ResourceWarning", "error::pytest.PytestUnraisableExceptionWarning", "error::pytest.PytestWarning", "ignore::pytest.PytestCacheWarning", # Ignore 3rd party EncodingWarning but raise on pandas' "ignore:.*encoding.* argument not specified:EncodingWarning", "error:.*encoding.* argument not specified:EncodingWarning:pandas", # From pyiceberg w/ Python >=3.13: https://github.com/apache/iceberg-python/issues/2530#issuecomment-3712112040 "ignore:unclosed database in