1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
|
# this file contains:
# 1 build system configuration
# 2 project configuration
# 3 tool configuration, for:
# - hatch
# - black
# - ruff
# - pytest
# - mypy
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "altair"
authors = [ {name = "Vega-Altair Contributors"} ]
dependencies = [
"importlib_metadata; python_version<\"3.8\"",
"typing_extensions>=4.0.1; python_version<\"3.11\"",
"jinja2",
"jsonschema>=3.0",
"numpy",
"pandas>=0.18",
"toolz"
]
description = "Vega-Altair: A declarative statistical visualization library for Python."
readme = "README.md"
keywords = [
"declarative",
"statistics",
"visualization",
"interactive",
"json",
"vega-lite",
]
requires-python = ">=3.7"
dynamic = ["version"]
license-files = { paths = ["LICENSE"] }
classifiers= [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
[project.urls]
Documentation = "https://altair-viz.github.io"
Source = "https://github.com/altair-viz/altair"
[project.optional-dependencies]
dev = [
"hatch",
"ruff",
"black<24",
"ipython",
"pytest",
"pytest-cov",
"m2r",
"vega_datasets",
# following is rejected by PyPI
"altair_viewer @ git+https://github.com/altair-viz/altair_viewer.git",
"vl-convert-python",
"mypy",
"pandas-stubs",
"types-jsonschema",
"types-setuptools"
]
doc = [
"sphinx",
"docutils",
"sphinxext_altair",
"jinja2",
"numpydoc",
"pillow",
"pydata-sphinx-theme",
"geopandas",
"myst-parser",
"sphinx_copybutton",
"sphinx-design"
]
[tool.hatch.version]
path = "altair/__init__.py"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build]
include = ["/altair"]
[tool.hatch.envs.default]
features = ["dev"]
[tool.hatch.envs.default.scripts]
test = [
"black --diff --color --check .",
"ruff check .",
"mypy altair tests",
"python -m pytest --pyargs --doctest-modules tests"
]
test-coverage = "python -m pytest --pyargs --doctest-modules --cov=altair --cov-report term altair"
test-coverage-html = "python -m pytest --pyargs --doctest-modules --cov=altair --cov-report html altair"
[tool.hatch.envs.doc]
features = ["dev", "doc"]
[tool.hatch.envs.doc.scripts]
clean = "rm -rf doc/_build"
clean-generated = [
"rm -rf doc/user_guide/generated",
"rm -rf doc/gallery"
]
clean-all = [
"clean",
"clean-generated",
"rm -rf doc/_images"
]
clean-win = "if exist doc\\_build rd /s /q doc\\_build"
clean-generated-win = [
"if exist doc\\user_guide\\generated rd /s /q doc\\user_guide\\generated",
"if exist doc\\gallery rd /s /q doc\\gallery",
]
clean-all-win = [
"clean-win",
"clean-generated-win",
"if exist doc\\_images rd /s /q doc\\_images",
]
build-html = [
"mkdir -p doc/_images",
"sphinx-build -b html -d doc/_build/doctrees doc doc/_build/html"
]
build-html-win = [
"if not exist doc\\_images md doc\\_images",
"sphinx-build -b html -d doc\\_build\\doctrees doc doc\\_build\\html"
]
doctest = "sphinx-build -b doctest -d doc/_build/doctrees doc doc/_build/doctest"
coverage = "sphinx-build -b coverage -d doc/_build/doctrees doc doc/_build/coverage"
serve = "(cd doc/_build/html && python -m http.server)"
publish-clean-build = [
"clean-all",
"build-html",
"(cd doc && bash sync_website.sh)"
]
[tool.black]
line-length = 88
target-version = ["py37", "py38", "py39", "py310", "py311"]
include = '\.pyi?$'
exclude = '''
/(
\.eggs
| \.git
| \.mypy_cache
| build
| dist
| doc
| tests/examples_arguments_syntax
| tests/examples_methods_syntax
| altair/vegalite/v\d*/schema
)/
'''
[tool.ruff]
target-version = "py310"
line-length = 88
select = [
# flake8-bugbear
"B",
# flake8-comprehensions
"C4",
# pycodestyle-error
"E",
# pycodestyle-warning
"W",
# pyflakes
"F",
# flake8-tidy-imports
"TID"
]
ignore = [
# E203, E266, W503 not yet supported by ruff,
# see https://github.com/charliermarsh/ruff/issues/2402
# Whitespace before ':'
# "E203",
# Too many leading '#' for block comment
# "E266",
# Line break occurred before a binary operator
# "W503",
# Line too long
"E501",
# Relative imports are banned
"TID252",
# zip() without an explicit strict= parameter set.
# python>=3.10 only
"B905"
]
exclude = [
".git",
"build",
"__pycache__",
"tests/examples_arguments_syntax",
"tests/examples_methods_syntax",
"altair/vegalite/v?/schema",
]
[tool.ruff.mccabe]
max-complexity = 18
[tool.pytest.ini_options]
markers = [
"save_engine: marks some of the tests which are using an external package to save a chart to e.g. a png file. This mark is used to run those tests selectively in the build GitHub Action.",
]
[[tool.mypy.overrides]]
module = [
"vega_datasets.*",
"toolz.*",
"altair_viewer.*",
"altair_saver.*",
"pyarrow.*",
"yaml.*",
"vl_convert.*",
"pandas.lib.*"
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = [
"altair.vegalite.v5.schema.*"
]
ignore_errors = true
|