[build-system]
requires = ["hatchling >= 1.26"]
build-backend = "hatchling.build"

[project.urls]
"Homepage" = "https://plotly.com/python/"
"Documentation" = "https://plotly.com/python/"
"GitHub" = "https://github.com/plotly/plotly.py"
"Changelog" = "https://github.com/plotly/plotly.py/blob/main/CHANGELOG.md"

[project]
name = "plotly"
authors = [
    { name = "Chris P", email = "chris@plot.ly" }
]
maintainers = [
    { name="Martha Cryan", email="martha.cryan@plot.ly" },
    { name="Emily Kellison-Linn", email="emily@plot.ly" }
]
description = "An open-source interactive data visualization library for Python"
readme = "README.md"
classifiers = [
    "Development Status :: 5 - Production/Stable",
    "Programming Language :: Python :: 3.8",
    "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",
    "Topic :: Scientific/Engineering :: Visualization",
    "License :: OSI Approved :: MIT License"
]
requires-python = ">=3.8"
license = "MIT"
license-files = ["LICENSE.txt"]
version = "7.0.0"
dependencies = [
    "narwhals>=1.15.1",
    "packaging"
]

[project.optional-dependencies]
express = ["numpy>=1.22"]
kaleido = ["kaleido>=1.3.0"]
dev_core = [
    "pytest",
    "requests",
    # pin precise version of ruff to prevent accidental reformatting in case its defaults are updated
    "ruff==0.11.12"
]
dev_build = [
    "plotly[dev_core]",
    "build",
    "jupyter-builder"
]
dev_codegen = [             # Dependencies for running Python codegen
    "plotly[dev_core]",
    "inflect"
]
dev_optional = [
    "plotly[dev_build]",
    "plotly[dev_codegen]",
    "plotly[express]",
    "plotly[kaleido]",
    "anywidget",
    "colorcet",
    # fiona>1.9.6 is not compatible with geopandas<1; geopandas>=1 is not compatible with python 3.8
    "fiona<=1.9.6;python_version<='3.8'",
    "geopandas",
    "jupyterlab",
    "orjson",
    "pandas",
    "pdfrw",
    "pillow",
    "polars[timezone]",
    "pyarrow",
    "pytz",
    "scikit-image",
    "scipy",
    "statsmodels",
    "vaex;python_version<='3.9'",
    "xarray"
]
dev = [
    "plotly[dev_optional]"
]

# The following extras are intended for use in CI only
dev_pandas1 = [
    "pandas>=1,<2",
    "numpy>=1,<2",
    "setuptools<82"
]
dev_pandas2 = [
    "pandas>=2,<3",
]
dev_pandas3 = [
    "pandas>=3;python_version>='3.11'",
]

[tool.uv]
exclude-newer = "72 hours"
exclude-newer-package = { plotly = false }
conflicts = [
    [{ extra = "dev_pandas1" }, { extra = "dev_pandas2" }],
    [{ extra = "dev_pandas1" }, { extra = "dev_pandas3" }],
    [{ extra = "dev_pandas2" }, { extra = "dev_pandas3" }],
]

[project.scripts]
plotly_get_chrome = "plotly.io._kaleido:plotly_get_chrome"

[tool.pytest.ini_options]
markers = [
    "nodev: mark a test as nodev",
    "matplotlib: mark a test as matplotlib"
]

[tool.hatch.build]
include = [
    "/plotly*",
    "/_plotly*",
    "js/install.json",  # used by Jupyter extension
]

[tool.hatch.build.targets.wheel]
# Prevent js/ directory from being installed as top-level package
exclude = ["js"]

[tool.hatch.build.targets.wheel.shared-data]
# Specify files from this package which will be copied to the user's system on install
# This is how the jupyterlab extension gets installed
# Left path is the path within this package
# Right path is the path on the user's system
"plotly/labextension" = "share/jupyter/labextensions/jupyterlab-plotly"
"js/install.json" = "share/jupyter/labextensions/jupyterlab-plotly/install.json"
