matplotlib
/
pyproject.toml
332 строки · 9.9 Кб
1[project]
2name = "matplotlib"
3authors = [
4{email = "matplotlib-users@python.org"},
5{name = "John D. Hunter, Michael Droettboom"}
6]
7description = "Python plotting package"
8readme = "README.md"
9license = { file = "LICENSE/LICENSE" }
10dynamic = ["version"]
11classifiers=[
12"Development Status :: 5 - Production/Stable",
13"Framework :: Matplotlib",
14"Intended Audience :: Science/Research",
15"Intended Audience :: Education",
16"License :: OSI Approved :: Python Software Foundation License",
17"Programming Language :: Python",
18"Programming Language :: Python :: 3",
19"Programming Language :: Python :: 3.10",
20"Programming Language :: Python :: 3.11",
21"Programming Language :: Python :: 3.12",
22"Topic :: Scientific/Engineering :: Visualization",
23]
24
25# When updating the list of dependencies, add an api_changes/development
26# entry and also update the following places:
27# - lib/matplotlib/__init__.py (matplotlib._check_versions())
28# - requirements/testing/minver.txt
29# - doc/devel/dependencies.rst
30# - .github/workflows/tests.yml
31# - environment.yml
32dependencies = [
33"contourpy >= 1.0.1",
34"cycler >= 0.10",
35"fonttools >= 4.22.0",
36"kiwisolver >= 1.3.1",
37"numpy >= 1.23",
38"packaging >= 20.0",
39"pillow >= 8",
40"pyparsing >= 2.3.1",
41"python-dateutil >= 2.7",
42]
43requires-python = ">=3.10"
44
45[project.optional-dependencies]
46# Should be a copy of the build dependencies below.
47dev = [
48"meson-python>=0.13.1",
49"numpy>=1.25",
50"pybind11>=2.6,!=2.13.3",
51"setuptools_scm>=7",
52# Not required by us but setuptools_scm without a version, cso _if_
53# installed, then setuptools_scm 8 requires at least this version.
54# Unfortunately, we can't do a sort of minimum-if-instaled dependency, so
55# we need to keep this for now until setuptools_scm _fully_ drops
56# setuptools.
57"setuptools>=64",
58]
59
60[project.urls]
61"Homepage" = "https://matplotlib.org"
62"Download" = "https://matplotlib.org/stable/install/index.html"
63"Documentation" = "https://matplotlib.org"
64"Source Code" = "https://github.com/matplotlib/matplotlib"
65"Bug Tracker" = "https://github.com/matplotlib/matplotlib/issues"
66"Forum" = "https://discourse.matplotlib.org/"
67"Donate" = "https://numfocus.org/donate-to-matplotlib"
68
69[build-system]
70build-backend = "mesonpy"
71# Also keep in sync with optional dependencies above.
72requires = [
73"meson-python>=0.13.1",
74"pybind11>=2.6,!=2.13.3",
75"setuptools_scm>=7",
76
77# Comments on numpy build requirement range:
78#
79# 1. >=2.0.x is the numpy requirement for wheel builds for distribution
80# on PyPI - building against 2.x yields wheels that are also
81# ABI-compatible with numpy 1.x at runtime.
82# 2. Note that building against numpy 1.x works fine too - users and
83# redistributors can do this by installing the numpy version they like
84# and disabling build isolation.
85# 3. The <2.3 upper bound is for matching the numpy deprecation policy,
86# it should not be loosened.
87"numpy>=2.0.0rc1,<2.3",
88]
89
90[tool.meson-python.args]
91install = ['--tags=data,python-runtime,runtime']
92
93[tool.setuptools_scm]
94version_scheme = "release-branch-semver"
95local_scheme = "node-and-date"
96parentdir_prefix_version = "matplotlib-"
97fallback_version = "0.0+UNKNOWN"
98
99[tool.isort]
100known_pydata = "numpy, matplotlib.pyplot"
101known_firstparty = "matplotlib,mpl_toolkits"
102sections = "FUTURE,STDLIB,THIRDPARTY,PYDATA,FIRSTPARTY,LOCALFOLDER"
103force_sort_within_sections = true
104
105[tool.ruff]
106exclude = [
107".git",
108"build",
109"doc/gallery",
110"doc/tutorials",
111"tools/gh_api.py",
112".tox",
113".eggs",
114]
115line-length = 88
116target-version = "py310"
117
118[tool.ruff.lint]
119ignore = [
120"D100",
121"D101",
122"D102",
123"D103",
124"D104",
125"D105",
126"D106",
127"D200",
128"D202",
129"D204",
130"D205",
131"D301",
132"D400",
133"D401",
134"D403",
135"D404",
136"E741",
137"F841",
138]
139preview = true
140explicit-preview-rules = true
141select = [
142"D",
143"E",
144"F",
145"W",
146# The following error codes require the preview mode to be enabled.
147"E201",
148"E202",
149"E203",
150"E221",
151"E251",
152"E261",
153"E272",
154"E703",
155]
156
157# The following error codes are not supported by ruff v0.2.0
158# They are planned and should be selected once implemented
159# even if they are deselected by default.
160# These are primarily whitespace/corrected by autoformatters (which we don't use).
161# See https://github.com/charliermarsh/ruff/issues/2402 for status on implementation
162external = [
163"E122",
164"E302",
165]
166
167[tool.ruff.lint.pydocstyle]
168convention = "numpy"
169
170[tool.ruff.lint.per-file-ignores]
171"doc/conf.py" = ["E402"]
172"galleries/examples/animation/frame_grabbing_sgskip.py" = ["E402"]
173"galleries/examples/images_contours_and_fields/tricontour_demo.py" = ["E201"]
174"galleries/examples/images_contours_and_fields/tripcolor_demo.py" = ["E201"]
175"galleries/examples/images_contours_and_fields/triplot_demo.py" = ["E201"]
176"galleries/examples/lines_bars_and_markers/marker_reference.py" = ["E402"]
177"galleries/examples/misc/print_stdout_sgskip.py" = ["E402"]
178"galleries/examples/misc/table_demo.py" = ["E201"]
179"galleries/examples/style_sheets/bmh.py" = ["E501"]
180"galleries/examples/subplots_axes_and_figures/demo_constrained_layout.py" = ["E402"]
181"galleries/examples/text_labels_and_annotations/custom_legends.py" = ["E402"]
182"galleries/examples/ticks/date_concise_formatter.py" = ["E402"]
183"galleries/examples/ticks/date_formatters_locators.py" = ["F401"]
184"galleries/examples/user_interfaces/embedding_in_gtk3_panzoom_sgskip.py" = ["E402"]
185"galleries/examples/user_interfaces/embedding_in_gtk3_sgskip.py" = ["E402"]
186"galleries/examples/user_interfaces/embedding_in_gtk4_panzoom_sgskip.py" = ["E402"]
187"galleries/examples/user_interfaces/embedding_in_gtk4_sgskip.py" = ["E402"]
188"galleries/examples/user_interfaces/gtk3_spreadsheet_sgskip.py" = ["E402"]
189"galleries/examples/user_interfaces/gtk4_spreadsheet_sgskip.py" = ["E402"]
190"galleries/examples/user_interfaces/mpl_with_glade3_sgskip.py" = ["E402"]
191"galleries/examples/user_interfaces/pylab_with_gtk3_sgskip.py" = ["E402"]
192"galleries/examples/user_interfaces/pylab_with_gtk4_sgskip.py" = ["E402"]
193"galleries/examples/userdemo/pgf_preamble_sgskip.py" = ["E402"]
194
195"lib/matplotlib/_cm.py" = ["E202", "E203"]
196"lib/matplotlib/_mathtext.py" = ["E221"]
197"lib/matplotlib/_mathtext_data.py" = ["E203"]
198"lib/matplotlib/backends/backend_template.py" = ["F401"]
199"lib/matplotlib/pylab.py" = ["F401", "F403"]
200"lib/matplotlib/pyplot.py" = ["F811"]
201"lib/matplotlib/tests/test_mathtext.py" = ["E501"]
202"lib/matplotlib/transforms.py" = ["E201"]
203"lib/matplotlib/tri/_triinterpolate.py" = ["E201", "E221"]
204"lib/mpl_toolkits/axes_grid1/axes_size.py" = ["E272"]
205"lib/mpl_toolkits/axisartist/angle_helper.py" = ["E221"]
206"lib/mpl_toolkits/mplot3d/proj3d.py" = ["E201"]
207
208"galleries/users_explain/artists/paths.py" = ["E402"]
209"galleries/users_explain/artists/patheffects_guide.py" = ["E402"]
210"galleries/users_explain/artists/transforms_tutorial.py" = ["E402", "E501"]
211"galleries/users_explain/colors/colormaps.py" = ["E501"]
212"galleries/users_explain/colors/colors.py" = ["E402"]
213"galleries/tutorials/artists.py" = ["E402"]
214"galleries/users_explain/axes/constrainedlayout_guide.py" = ["E402"]
215"galleries/users_explain/axes/legend_guide.py" = ["E402"]
216"galleries/users_explain/axes/tight_layout_guide.py" = ["E402"]
217"galleries/users_explain/animations/animations.py" = ["E501"]
218"galleries/tutorials/images.py" = ["E501"]
219"galleries/tutorials/pyplot.py" = ["E402", "E501"]
220"galleries/users_explain/text/annotations.py" = ["E402", "E501"]
221"galleries/users_explain/text/mathtext.py" = ["E501"]
222"galleries/users_explain/text/text_intro.py" = ["E402"]
223"galleries/users_explain/text/text_props.py" = ["E501"]
224
225[tool.mypy]
226ignore_missing_imports = true
227enable_error_code = [
228"ignore-without-code",
229"redundant-expr",
230"truthy-bool",
231]
232enable_incomplete_feature = [
233"Unpack",
234]
235exclude = [
236#stubtest
237".*/matplotlib/(sphinxext|backends|testing/jpl_units)",
238#mypy precommit
239"galleries/",
240"doc/",
241"lib/matplotlib/backends/",
242"lib/matplotlib/sphinxext",
243"lib/matplotlib/testing/jpl_units",
244"lib/mpl_toolkits/",
245#removing tests causes errors in backends
246"lib/matplotlib/tests/",
247# tinypages is used for testing the sphinx ext,
248# stubtest will import and run, opening a figure if not excluded
249".*/tinypages"
250]
251files = [
252"lib/matplotlib",
253]
254follow_imports = "silent"
255warn_unreachable = true
256
257[tool.rstcheck]
258ignore_directives = [
259# matplotlib.sphinxext.mathmpl
260"mathmpl",
261# matplotlib.sphinxext.plot_directive
262"plot",
263# sphinxext.math_symbol_table
264"math_symbol_table",
265# sphinxext.redirect_from
266"redirect-from",
267# sphinx-design
268"card",
269"dropdown",
270"grid",
271"tab-set",
272# sphinx-gallery
273"minigallery",
274"image-sg",
275# sphinx.ext.autodoc
276"automodule",
277"autoclass",
278"autofunction",
279"autodata",
280"automethod",
281"autoattribute",
282"autoproperty",
283# sphinx.ext.autosummary
284"autosummary",
285# sphinx.ext.ifconfig
286"ifconfig",
287# sphinx.ext.inheritance_diagram
288"inheritance-diagram",
289# sphinx-tags
290"tags",
291# include directive is causing attribute errors
292"include"
293]
294ignore_roles = [
295# matplotlib.sphinxext.mathmpl
296"mathmpl",
297"math-stix",
298# matplotlib.sphinxext.roles
299"rc",
300# sphinxext.github
301"ghissue",
302"ghpull",
303"ghuser",
304# sphinx-design
305"octicon",
306]
307ignore_substitutions = [
308"Artist",
309"Axes",
310"Axis",
311"Figure",
312"release"
313]
314
315ignore_messages = [
316"Hyperlink target \".*\" is not referenced.",
317"Duplicate implicit target name: \".*\".",
318"Duplicate explicit target name: \".*\".",
319# sphinx.ext.intersphinx directives
320"No role entry for \"external+.*\".",
321"Unknown interpreted text role \"external+.*\"."
322]
323
324[tool.pytest.ini_options]
325# Because tests can be run from an installed copy, most of our Pytest
326# configuration is in the `pytest_configure` function in
327# `lib/matplotlib/testing/conftest.py`.
328minversion = "7.0"
329testpaths = ["lib"]
330addopts = [
331"--import-mode=importlib",
332]
333