aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/matplotlib/py2
diff options
context:
space:
mode:
authorAlexSm <alex@ydb.tech>2024-01-04 15:09:05 +0100
committerGitHub <noreply@github.com>2024-01-04 15:09:05 +0100
commitdab291146f6cd7d35684e3a1150e5bb1c412982c (patch)
tree36ef35f6cacb6432845a4a33f940c95871036b32 /contrib/python/matplotlib/py2
parent63660ad5e7512029fd0218e7a636580695a24e1f (diff)
downloadydb-dab291146f6cd7d35684e3a1150e5bb1c412982c.tar.gz
Library import 5, delete go dependencies (#832)
* Library import 5, delete go dependencies * Fix yt client
Diffstat (limited to 'contrib/python/matplotlib/py2')
-rw-r--r--contrib/python/matplotlib/py2/matplotlib/__init__.py5
-rw-r--r--contrib/python/matplotlib/py2/matplotlib/_version.py467
-rw-r--r--contrib/python/matplotlib/py2/matplotlib/backends/backend_qt5.py3
-rw-r--r--contrib/python/matplotlib/py2/matplotlib/backends/backend_qt5agg.py2
-rw-r--r--contrib/python/matplotlib/py2/matplotlib/backends/qt_editor/figureoptions.py2
-rw-r--r--contrib/python/matplotlib/py2/matplotlib/cbook/__init__.py44
-rw-r--r--contrib/python/matplotlib/py2/matplotlib/colors.py7
-rw-r--r--contrib/python/matplotlib/py2/matplotlib/contour.py24
-rw-r--r--contrib/python/matplotlib/py2/matplotlib/font_manager.py6
-rw-r--r--contrib/python/matplotlib/py2/matplotlib/lines.py4
-rw-r--r--contrib/python/matplotlib/py2/matplotlib/markers.py6
-rw-r--r--contrib/python/matplotlib/py2/matplotlib/pyplot.py2
-rw-r--r--contrib/python/matplotlib/py2/matplotlib/rcsetup.py6
-rw-r--r--contrib/python/matplotlib/py2/matplotlib/sphinxext/plot_directive.py25
-rw-r--r--contrib/python/matplotlib/py2/mpl_toolkits/axes_grid1/axes_grid.py2
-rw-r--r--contrib/python/matplotlib/py2/src/_png.cpp8
-rw-r--r--contrib/python/matplotlib/py2/src/_tkagg.cpp2
-rw-r--r--contrib/python/matplotlib/py2/src/_ttconv.cpp2
-rw-r--r--contrib/python/matplotlib/py2/src/file_compat.h2
-rw-r--r--contrib/python/matplotlib/py2/src/ft2font.h4
-rw-r--r--contrib/python/matplotlib/py2/src/ft2font_wrapper.cpp117
-rw-r--r--contrib/python/matplotlib/py2/src/mplutils.h1
-rw-r--r--contrib/python/matplotlib/py2/src/numpy_cpp.h2
-rw-r--r--contrib/python/matplotlib/py2/src/py_adaptors.h2
-rw-r--r--contrib/python/matplotlib/py2/src/py_converters.cpp2
-rw-r--r--contrib/python/matplotlib/py2/src/qhull_wrap.c1
-rw-r--r--contrib/python/matplotlib/py2/ya.make2
27 files changed, 171 insertions, 579 deletions
diff --git a/contrib/python/matplotlib/py2/matplotlib/__init__.py b/contrib/python/matplotlib/py2/matplotlib/__init__.py
index f561dfd012c..506f634d4d6 100644
--- a/contrib/python/matplotlib/py2/matplotlib/__init__.py
+++ b/contrib/python/matplotlib/py2/matplotlib/__init__.py
@@ -104,7 +104,10 @@ from __future__ import absolute_import, division, print_function
import six
import atexit
-from collections import MutableMapping
+try:
+ from collections.abc import MutableMapping
+except ImportError:
+ from collections import MutableMapping
import contextlib
import distutils.version
import functools
diff --git a/contrib/python/matplotlib/py2/matplotlib/_version.py b/contrib/python/matplotlib/py2/matplotlib/_version.py
index 73a3f6fbf38..ea4bce57c9d 100644
--- a/contrib/python/matplotlib/py2/matplotlib/_version.py
+++ b/contrib/python/matplotlib/py2/matplotlib/_version.py
@@ -1,460 +1,21 @@
-# This file helps to compute a version number in source trees obtained from
-# git-archive tarball (such as those provided by githubs download-from-tag
-# feature). Distribution tarballs (built by setup.py sdist) and build
-# directories (produced by setup.py build) will contain a much shorter file
-# that just contains the computed version number.
+# This file was generated by 'versioneer.py' (0.15) from
+# revision-control system data, or from the parent directory name of an
+# unpacked source archive. Distribution tarballs contain a pre-generated copy
+# of this file.
-# This file is released into the public domain. Generated by
-# versioneer-0.15 (https://github.com/warner/python-versioneer)
-
-import errno
-import os
-import re
-import subprocess
+import json
import sys
-
-def get_keywords():
- # these strings will be replaced by git during git-archive.
- # setup.py/versioneer.py will grep for the variable names, so they must
- # each be defined on a line of their own. _version.py will just call
- # get_keywords().
- git_refnames = " (tag: v2.2.4)"
- git_full = "bff1e4b201baf34df3f3a6fbb408f0e2c1068dd9"
- keywords = {"refnames": git_refnames, "full": git_full}
- return keywords
-
-
-class VersioneerConfig:
- pass
-
-
-def get_config():
- # these strings are filled in when 'setup.py versioneer' creates
- # _version.py
- cfg = VersioneerConfig()
- cfg.VCS = "git"
- cfg.style = "pep440-post"
- cfg.tag_prefix = "v"
- cfg.parentdir_prefix = "matplotlib-"
- cfg.versionfile_source = "lib/matplotlib/_version.py"
- cfg.verbose = False
- return cfg
-
-
-class NotThisMethod(Exception):
- pass
-
-
-LONG_VERSION_PY = {}
-HANDLERS = {}
-
-
-def register_vcs_handler(vcs, method): # decorator
- def decorate(f):
- if vcs not in HANDLERS:
- HANDLERS[vcs] = {}
- HANDLERS[vcs][method] = f
- return f
- return decorate
-
-
-def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False):
- assert isinstance(commands, list)
- p = None
- for c in commands:
- try:
- dispcmd = str([c] + args)
- # remember shell=False, so use git.cmd on windows, not just git
- p = subprocess.Popen([c] + args, cwd=cwd, stdout=subprocess.PIPE,
- stderr=(subprocess.PIPE if hide_stderr
- else None))
- break
- except EnvironmentError:
- e = sys.exc_info()[1]
- if e.errno == errno.ENOENT:
- continue
- if verbose:
- print("unable to run %s" % dispcmd)
- print(e)
- return None
- else:
- if verbose:
- print("unable to find command, tried %s" % (commands,))
- return None
- stdout = p.communicate()[0].strip()
- if sys.version_info[0] >= 3:
- stdout = stdout.decode()
- if p.returncode != 0:
- if verbose:
- print("unable to run %s (error)" % dispcmd)
- return None
- return stdout
-
-
-def versions_from_parentdir(parentdir_prefix, root, verbose):
- # Source tarballs conventionally unpack into a directory that includes
- # both the project name and a version string.
- dirname = os.path.basename(root)
- if not dirname.startswith(parentdir_prefix):
- if verbose:
- print("guessing rootdir is '%s', but '%s' doesn't start with "
- "prefix '%s'" % (root, dirname, parentdir_prefix))
- raise NotThisMethod("rootdir doesn't start with parentdir_prefix")
- return {"version": dirname[len(parentdir_prefix):],
- "full-revisionid": None,
- "dirty": False, "error": None}
-
-
-@register_vcs_handler("git", "get_keywords")
-def git_get_keywords(versionfile_abs):
- # the code embedded in _version.py can just fetch the value of these
- # keywords. When used from setup.py, we don't want to import _version.py,
- # so we do it with a regexp instead. This function is not used from
- # _version.py.
- keywords = {}
- try:
- f = open(versionfile_abs, "r")
- for line in f.readlines():
- if line.strip().startswith("git_refnames ="):
- mo = re.search(r'=\s*"(.*)"', line)
- if mo:
- keywords["refnames"] = mo.group(1)
- if line.strip().startswith("git_full ="):
- mo = re.search(r'=\s*"(.*)"', line)
- if mo:
- keywords["full"] = mo.group(1)
- f.close()
- except EnvironmentError:
- pass
- return keywords
-
-
-@register_vcs_handler("git", "keywords")
-def git_versions_from_keywords(keywords, tag_prefix, verbose):
- if not keywords:
- raise NotThisMethod("no keywords at all, weird")
- refnames = keywords["refnames"].strip()
- if refnames.startswith("$Format"):
- if verbose:
- print("keywords are unexpanded, not using")
- raise NotThisMethod("unexpanded keywords, not a git-archive tarball")
- refs = set([r.strip() for r in refnames.strip("()").split(",")])
- # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of
- # just "foo-1.0". If we see a "tag: " prefix, prefer those.
- TAG = "tag: "
- tags = set([r[len(TAG):] for r in refs if r.startswith(TAG)])
- if not tags:
- # Either we're using git < 1.8.3, or there really are no tags. We use
- # a heuristic: assume all version tags have a digit. The old git %d
- # expansion behaves like git log --decorate=short and strips out the
- # refs/heads/ and refs/tags/ prefixes that would let us distinguish
- # between branches and tags. By ignoring refnames without digits, we
- # filter out many common branch names like "release" and
- # "stabilization", as well as "HEAD" and "master".
- tags = set([r for r in refs if re.search(r'\d', r)])
- if verbose:
- print("discarding '%s', no digits" % ",".join(refs-tags))
- if verbose:
- print("likely tags: %s" % ",".join(sorted(tags)))
- for ref in sorted(tags):
- # sorting will prefer e.g. "2.0" over "2.0rc1"
- if ref.startswith(tag_prefix):
- r = ref[len(tag_prefix):]
- if verbose:
- print("picking %s" % r)
- return {"version": r,
- "full-revisionid": keywords["full"].strip(),
- "dirty": False, "error": None
- }
- # no suitable tags, so version is "0+unknown", but full hex is still there
- if verbose:
- print("no suitable tags, using unknown + full revision id")
- return {"version": "0+unknown",
- "full-revisionid": keywords["full"].strip(),
- "dirty": False, "error": "no suitable tags"}
-
-
-@register_vcs_handler("git", "pieces_from_vcs")
-def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
- # this runs 'git' from the root of the source tree. This only gets called
- # if the git-archive 'subst' keywords were *not* expanded, and
- # _version.py hasn't already been rewritten with a short version string,
- # meaning we're inside a checked out source tree.
-
- if not os.path.exists(os.path.join(root, ".git")):
- if verbose:
- print("no .git in %s" % root)
- raise NotThisMethod("no .git directory")
-
- GITS = ["git"]
- if sys.platform == "win32":
- GITS = ["git.cmd", "git.exe"]
- # if there is a tag, this yields TAG-NUM-gHEX[-dirty]
- # if there are no tags, this yields HEX[-dirty] (no NUM)
- describe_out = run_command(GITS, ["describe", "--tags", "--dirty",
- "--always", "--long"],
- cwd=root)
- # --long was added in git-1.5.5
- if describe_out is None:
- raise NotThisMethod("'git describe' failed")
- describe_out = describe_out.strip()
- full_out = run_command(GITS, ["rev-parse", "HEAD"], cwd=root)
- if full_out is None:
- raise NotThisMethod("'git rev-parse' failed")
- full_out = full_out.strip()
-
- pieces = {}
- pieces["long"] = full_out
- pieces["short"] = full_out[:7] # maybe improved later
- pieces["error"] = None
-
- # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty]
- # TAG might have hyphens.
- git_describe = describe_out
-
- # look for -dirty suffix
- dirty = git_describe.endswith("-dirty")
- pieces["dirty"] = dirty
- if dirty:
- git_describe = git_describe[:git_describe.rindex("-dirty")]
-
- # now we have TAG-NUM-gHEX or HEX
-
- if "-" in git_describe:
- # TAG-NUM-gHEX
- mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe)
- if not mo:
- # unparseable. Maybe git-describe is misbehaving?
- pieces["error"] = ("unable to parse git-describe output: '%s'"
- % describe_out)
- return pieces
-
- # tag
- full_tag = mo.group(1)
- if not full_tag.startswith(tag_prefix):
- if verbose:
- fmt = "tag '%s' doesn't start with prefix '%s'"
- print(fmt % (full_tag, tag_prefix))
- pieces["error"] = ("tag '%s' doesn't start with prefix '%s'"
- % (full_tag, tag_prefix))
- return pieces
- pieces["closest-tag"] = full_tag[len(tag_prefix):]
-
- # distance: number of commits since tag
- pieces["distance"] = int(mo.group(2))
-
- # commit: short hex revision ID
- pieces["short"] = mo.group(3)
-
- else:
- # HEX: no tags
- pieces["closest-tag"] = None
- count_out = run_command(GITS, ["rev-list", "HEAD", "--count"],
- cwd=root)
- pieces["distance"] = int(count_out) # total number of commits
-
- return pieces
-
-
-def plus_or_dot(pieces):
- if "+" in pieces.get("closest-tag", ""):
- return "."
- return "+"
-
-
-def render_pep440(pieces):
- # now build up version string, with post-release "local version
- # identifier". Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you
- # get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty
-
- # exceptions:
- # 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty]
-
- if pieces["closest-tag"]:
- rendered = pieces["closest-tag"]
- if pieces["distance"] or pieces["dirty"]:
- rendered += plus_or_dot(pieces)
- rendered += "%d.g%s" % (pieces["distance"], pieces["short"])
- if pieces["dirty"]:
- rendered += ".dirty"
- else:
- # exception #1
- rendered = "0+untagged.%d.g%s" % (pieces["distance"],
- pieces["short"])
- if pieces["dirty"]:
- rendered += ".dirty"
- return rendered
-
-
-def render_pep440_pre(pieces):
- # TAG[.post.devDISTANCE] . No -dirty
-
- # exceptions:
- # 1: no tags. 0.post.devDISTANCE
-
- if pieces["closest-tag"]:
- rendered = pieces["closest-tag"]
- if pieces["distance"]:
- rendered += ".post.dev%d" % pieces["distance"]
- else:
- # exception #1
- rendered = "0.post.dev%d" % pieces["distance"]
- return rendered
-
-
-def render_pep440_post(pieces):
- # TAG[.postDISTANCE[.dev0]+gHEX] . The ".dev0" means dirty. Note that
- # .dev0 sorts backwards (a dirty tree will appear "older" than the
- # corresponding clean one), but you shouldn't be releasing software with
- # -dirty anyways.
-
- # exceptions:
- # 1: no tags. 0.postDISTANCE[.dev0]
-
- if pieces["closest-tag"]:
- rendered = pieces["closest-tag"]
- if pieces["distance"] or pieces["dirty"]:
- rendered += ".post%d" % pieces["distance"]
- if pieces["dirty"]:
- rendered += ".dev0"
- rendered += plus_or_dot(pieces)
- rendered += "g%s" % pieces["short"]
- else:
- # exception #1
- rendered = "0.post%d" % pieces["distance"]
- if pieces["dirty"]:
- rendered += ".dev0"
- rendered += "+g%s" % pieces["short"]
- return rendered
-
-
-def render_pep440_old(pieces):
- # TAG[.postDISTANCE[.dev0]] . The ".dev0" means dirty.
-
- # exceptions:
- # 1: no tags. 0.postDISTANCE[.dev0]
-
- if pieces["closest-tag"]:
- rendered = pieces["closest-tag"]
- if pieces["distance"] or pieces["dirty"]:
- rendered += ".post%d" % pieces["distance"]
- if pieces["dirty"]:
- rendered += ".dev0"
- else:
- # exception #1
- rendered = "0.post%d" % pieces["distance"]
- if pieces["dirty"]:
- rendered += ".dev0"
- return rendered
-
-
-def render_git_describe(pieces):
- # TAG[-DISTANCE-gHEX][-dirty], like 'git describe --tags --dirty
- # --always'
-
- # exceptions:
- # 1: no tags. HEX[-dirty] (note: no 'g' prefix)
-
- if pieces["closest-tag"]:
- rendered = pieces["closest-tag"]
- if pieces["distance"]:
- rendered += "-%d-g%s" % (pieces["distance"], pieces["short"])
- else:
- # exception #1
- rendered = pieces["short"]
- if pieces["dirty"]:
- rendered += "-dirty"
- return rendered
-
-
-def render_git_describe_long(pieces):
- # TAG-DISTANCE-gHEX[-dirty], like 'git describe --tags --dirty
- # --always -long'. The distance/hash is unconditional.
-
- # exceptions:
- # 1: no tags. HEX[-dirty] (note: no 'g' prefix)
-
- if pieces["closest-tag"]:
- rendered = pieces["closest-tag"]
- rendered += "-%d-g%s" % (pieces["distance"], pieces["short"])
- else:
- # exception #1
- rendered = pieces["short"]
- if pieces["dirty"]:
- rendered += "-dirty"
- return rendered
-
-
-def render(pieces, style):
- if pieces["error"]:
- return {"version": "unknown",
- "full-revisionid": pieces.get("long"),
- "dirty": None,
- "error": pieces["error"]}
-
- if not style or style == "default":
- style = "pep440" # the default
-
- if style == "pep440":
- rendered = render_pep440(pieces)
- elif style == "pep440-pre":
- rendered = render_pep440_pre(pieces)
- elif style == "pep440-post":
- rendered = render_pep440_post(pieces)
- elif style == "pep440-old":
- rendered = render_pep440_old(pieces)
- elif style == "git-describe":
- rendered = render_git_describe(pieces)
- elif style == "git-describe-long":
- rendered = render_git_describe_long(pieces)
- else:
- raise ValueError("unknown style '%s'" % style)
-
- return {"version": rendered, "full-revisionid": pieces["long"],
- "dirty": pieces["dirty"], "error": None}
+version_json = '''
+{
+ "dirty": false,
+ "error": null,
+ "full-revisionid": "61e004913460345d108b60506a4deb9f8380eeab",
+ "version": "2.2.5"
+}
+''' # END VERSION_JSON
def get_versions():
- # I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have
- # __file__, we can work backwards from there to the root. Some
- # py2exe/bbfreeze/non-CPython implementations don't do __file__, in which
- # case we can only use expanded keywords.
-
- cfg = get_config()
- verbose = cfg.verbose
-
- try:
- return git_versions_from_keywords(get_keywords(), cfg.tag_prefix,
- verbose)
- except NotThisMethod:
- pass
-
- try:
- root = os.path.realpath(__file__)
- # versionfile_source is the relative path from the top of the source
- # tree (where the .git directory might live) to this file. Invert
- # this to find the root from __file__.
- for i in cfg.versionfile_source.split('/'):
- root = os.path.dirname(root)
- except NameError:
- return {"version": "0+unknown", "full-revisionid": None,
- "dirty": None,
- "error": "unable to find root of source tree"}
-
- try:
- pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose)
- return render(pieces, cfg.style)
- except NotThisMethod:
- pass
-
- try:
- if cfg.parentdir_prefix:
- return versions_from_parentdir(cfg.parentdir_prefix, root, verbose)
- except NotThisMethod:
- pass
-
- return {"version": "0+unknown", "full-revisionid": None,
- "dirty": None,
- "error": "unable to compute version"}
+ return json.loads(version_json)
diff --git a/contrib/python/matplotlib/py2/matplotlib/backends/backend_qt5.py b/contrib/python/matplotlib/py2/matplotlib/backends/backend_qt5.py
index f70bf6f1dc5..20b0b5bc1bd 100644
--- a/contrib/python/matplotlib/py2/matplotlib/backends/backend_qt5.py
+++ b/contrib/python/matplotlib/py2/matplotlib/backends/backend_qt5.py
@@ -506,7 +506,8 @@ class FigureCanvasQT(QtWidgets.QWidget, FigureCanvasBase):
# current event loop in order to ensure thread affinity and to
# accumulate multiple draw requests from event handling.
# TODO: queued signal connection might be safer than singleShot
- if not (self._draw_pending or self._is_drawing):
+ if not (getattr(self, '_draw_pending', False) or
+ getattr(self, '_is_drawing', False)):
self._draw_pending = True
QtCore.QTimer.singleShot(0, self._draw_idle)
diff --git a/contrib/python/matplotlib/py2/matplotlib/backends/backend_qt5agg.py b/contrib/python/matplotlib/py2/matplotlib/backends/backend_qt5agg.py
index 826156e6784..d2166d58c88 100644
--- a/contrib/python/matplotlib/py2/matplotlib/backends/backend_qt5agg.py
+++ b/contrib/python/matplotlib/py2/matplotlib/backends/backend_qt5agg.py
@@ -68,7 +68,7 @@ class FigureCanvasQTAgg(FigureCanvasAgg, FigureCanvasQT):
if hasattr(qimage, 'setDevicePixelRatio'):
# Not available on Qt4 or some older Qt5.
qimage.setDevicePixelRatio(self._dpi_ratio)
- origin = QtCore.QPoint(l, self.renderer.height - t)
+ origin = QtCore.QPoint(int(l), int(self.renderer.height - t))
painter.drawImage(origin / self._dpi_ratio, qimage)
self._draw_rect_callback(painter)
diff --git a/contrib/python/matplotlib/py2/matplotlib/backends/qt_editor/figureoptions.py b/contrib/python/matplotlib/py2/matplotlib/backends/qt_editor/figureoptions.py
index 40572c8bd82..f0050d36750 100644
--- a/contrib/python/matplotlib/py2/matplotlib/backends/qt_editor/figureoptions.py
+++ b/contrib/python/matplotlib/py2/matplotlib/backends/qt_editor/figureoptions.py
@@ -222,7 +222,7 @@ def figure_edit(axes, parent=None):
rgba = mcolors.to_rgba(color)
line.set_alpha(None)
line.set_color(rgba)
- if marker is not 'none':
+ if marker != 'none':
line.set_marker(marker)
line.set_markersize(markersize)
line.set_markerfacecolor(markerfacecolor)
diff --git a/contrib/python/matplotlib/py2/matplotlib/cbook/__init__.py b/contrib/python/matplotlib/py2/matplotlib/cbook/__init__.py
index dcb2d0549de..7de81661c54 100644
--- a/contrib/python/matplotlib/py2/matplotlib/cbook/__init__.py
+++ b/contrib/python/matplotlib/py2/matplotlib/cbook/__init__.py
@@ -11,6 +11,11 @@ from __future__ import absolute_import, division, print_function
import six
from six.moves import xrange, zip
import collections
+try:
+ import collections.abc as cabc
+except ImportError:
+ import collections as cabc
+
import contextlib
import datetime
import errno
@@ -2061,7 +2066,36 @@ def _check_1d(x):
return np.atleast_1d(x)
else:
try:
- x[:, None]
+ # work around
+ # https://github.com/pandas-dev/pandas/issues/27775 which
+ # means the shape of multi-dimensional slicing is not as
+ # expected. That this ever worked was an unintentional
+ # quirk of pandas and will raise an exception in the
+ # future. This slicing warns in pandas >= 1.0rc0 via
+ # https://github.com/pandas-dev/pandas/pull/30588
+ #
+ # < 1.0rc0 : x[:, None].ndim == 1, no warning, custom type
+ # >= 1.0rc1 : x[:, None].ndim == 2, warns, numpy array
+ # future : x[:, None] -> raises
+ #
+ # This code should correctly identify and coerce to a
+ # numpy array all pandas versions.
+ with warnings.catch_warnings(record=True) as w:
+ warnings.filterwarnings(
+ "always",
+ category=DeprecationWarning,
+ message='Support for multi-dimensional indexing')
+
+ ndim = x[:, None].ndim
+ # we have definitely hit a pandas index or series object
+ # cast to a numpy array.
+ if len(w) > 0:
+ return np.asanyarray(x)
+ # We have likely hit a pandas object, or at least
+ # something where 2D slicing does not result in a 2D
+ # object.
+ if ndim < 2:
+ return np.atleast_1d(x)
return x
except (IndexError, TypeError):
return np.atleast_1d(x)
@@ -2287,7 +2321,8 @@ def pts_to_midstep(x, *args):
The x location of the steps. May be empty.
y1, ..., yp : array
- y arrays to be turned into steps; all must be the same length as ``x``.
+ y arrays to be turned into steps; all must be the same length as
+ ``x``.
Returns
-------
@@ -2346,7 +2381,7 @@ def index_of(y):
def safe_first_element(obj):
- if isinstance(obj, collections.Iterator):
+ if isinstance(obj, cabc.Iterator):
# needed to accept `array.flat` as input.
# np.flatiter reports as an instance of collections.Iterator
# but can still be indexed via [].
@@ -2363,7 +2398,8 @@ def safe_first_element(obj):
def sanitize_sequence(data):
"""Converts dictview object to list"""
- return list(data) if isinstance(data, collections.MappingView) else data
+ return (list(data) if isinstance(data, cabc.MappingView)
+ else data)
def normalize_kwargs(kw, alias_mapping=None, required=(), forbidden=(),
diff --git a/contrib/python/matplotlib/py2/matplotlib/colors.py b/contrib/python/matplotlib/py2/matplotlib/colors.py
index 32e282f6f56..d6cd04fdbc1 100644
--- a/contrib/python/matplotlib/py2/matplotlib/colors.py
+++ b/contrib/python/matplotlib/py2/matplotlib/colors.py
@@ -50,7 +50,10 @@ from __future__ import (absolute_import, division, print_function,
import six
from six.moves import zip
-from collections import Sized
+try:
+ from collections.abc import Sized
+except ImportError:
+ from collections import Sized
import itertools
import re
import warnings
@@ -1682,7 +1685,7 @@ class LightSource(object):
# visually appears better than a "hard" clip.
intensity -= imin
intensity /= (imax - imin)
- intensity = np.clip(intensity, 0, 1, intensity)
+ intensity = np.clip(intensity, 0, 1)
return intensity
diff --git a/contrib/python/matplotlib/py2/matplotlib/contour.py b/contrib/python/matplotlib/py2/matplotlib/contour.py
index f6fdfd61c26..e03bdaeae65 100644
--- a/contrib/python/matplotlib/py2/matplotlib/contour.py
+++ b/contrib/python/matplotlib/py2/matplotlib/contour.py
@@ -7,7 +7,9 @@ from __future__ import (absolute_import, division, print_function,
import six
from six.moves import xrange
+from numbers import Integral
import warnings
+
import matplotlib as mpl
import numpy as np
from numpy import ma
@@ -868,7 +870,7 @@ class ContourSet(cm.ScalarMappable, ContourLabeler):
self.logscale = True
if norm is None:
norm = colors.LogNorm()
- if self.extend is not 'neither':
+ if self.extend != 'neither':
raise ValueError('extend kwarg does not work yet with log '
' scale')
else:
@@ -1206,21 +1208,15 @@ class ContourSet(cm.ScalarMappable, ContourLabeler):
self._auto = False
if self.levels is None:
if len(args) == 0:
- lev = self._autolev(7)
+ levels_arg = 7 # Default, hard-wired.
else:
- level_arg = args[0]
- try:
- if type(level_arg) == int:
- lev = self._autolev(level_arg)
- else:
- lev = np.asarray(level_arg).astype(np.float64)
- except:
- raise TypeError(
- "Last {0} arg must give levels; see help({0})"
- .format(fn))
- self.levels = lev
+ levels_arg = args[0]
+ else:
+ levels_arg = self.levels
+ if isinstance(levels_arg, Integral):
+ self.levels = self._autolev(levels_arg)
else:
- self.levels = np.asarray(self.levels).astype(np.float64)
+ self.levels = np.asarray(levels_arg).astype(np.float64)
if not self.filled:
inside = (self.levels > self.zmin) & (self.levels < self.zmax)
diff --git a/contrib/python/matplotlib/py2/matplotlib/font_manager.py b/contrib/python/matplotlib/py2/matplotlib/font_manager.py
index 5900fc9b184..2ba1a50638e 100644
--- a/contrib/python/matplotlib/py2/matplotlib/font_manager.py
+++ b/contrib/python/matplotlib/py2/matplotlib/font_manager.py
@@ -43,8 +43,10 @@ License : matplotlib license (PSF compatible)
The font directory code is from ttfquery,
see license/LICENSE_TTFQUERY.
"""
-
-from collections import Iterable
+try:
+ from collections.abc import Iterable
+except ImportError:
+ from collections import Iterable
import json
import os
import sys
diff --git a/contrib/python/matplotlib/py2/matplotlib/lines.py b/contrib/python/matplotlib/py2/matplotlib/lines.py
index dac18d49855..91edd5f89de 100644
--- a/contrib/python/matplotlib/py2/matplotlib/lines.py
+++ b/contrib/python/matplotlib/py2/matplotlib/lines.py
@@ -811,10 +811,10 @@ class Line2D(Artist):
self.recache()
self._transform_path(subslice)
tpath, affine = (self._get_transformed_path()
- .get_transformed_path_and_affine())
+ .get_transformed_points_and_affine())
else:
tpath, affine = (self._get_transformed_path()
- .get_transformed_path_and_affine())
+ .get_transformed_points_and_affine())
if len(tpath.vertices):
# subsample the markers if markevery is not None
diff --git a/contrib/python/matplotlib/py2/matplotlib/markers.py b/contrib/python/matplotlib/py2/matplotlib/markers.py
index ff27c4b253b..3669922026f 100644
--- a/contrib/python/matplotlib/py2/matplotlib/markers.py
+++ b/contrib/python/matplotlib/py2/matplotlib/markers.py
@@ -88,8 +88,10 @@ from __future__ import (absolute_import, division, print_function,
import six
from six.moves import xrange
-
-from collections import Sized
+try:
+ from collections.abc import Sized
+except ImportError:
+ from collections import Sized
import numpy as np
diff --git a/contrib/python/matplotlib/py2/matplotlib/pyplot.py b/contrib/python/matplotlib/py2/matplotlib/pyplot.py
index fb5928dc65f..22411701c98 100644
--- a/contrib/python/matplotlib/py2/matplotlib/pyplot.py
+++ b/contrib/python/matplotlib/py2/matplotlib/pyplot.py
@@ -2419,7 +2419,7 @@ def matshow(A, fignum=None, **kwargs):
"""
A = np.asanyarray(A)
- if fignum is False or fignum is 0:
+ if fignum is False or fignum == 0:
ax = gca()
else:
# Extract actual aspect ratio of array and make appropriately sized figure
diff --git a/contrib/python/matplotlib/py2/matplotlib/rcsetup.py b/contrib/python/matplotlib/py2/matplotlib/rcsetup.py
index f8d5ad5036d..902db1c43ff 100644
--- a/contrib/python/matplotlib/py2/matplotlib/rcsetup.py
+++ b/contrib/python/matplotlib/py2/matplotlib/rcsetup.py
@@ -16,8 +16,10 @@ parameter set listed here should also be visited to the
from __future__ import absolute_import, division, print_function
import six
-
-from collections import Iterable, Mapping
+try:
+ from collections.abc import Iterable, Mapping
+except ImportError:
+ from collections import Iterable, Mapping
from functools import reduce
import operator
import os
diff --git a/contrib/python/matplotlib/py2/matplotlib/sphinxext/plot_directive.py b/contrib/python/matplotlib/py2/matplotlib/sphinxext/plot_directive.py
index 434bc50aee2..2e50d5aaa69 100644
--- a/contrib/python/matplotlib/py2/matplotlib/sphinxext/plot_directive.py
+++ b/contrib/python/matplotlib/py2/matplotlib/sphinxext/plot_directive.py
@@ -357,7 +357,7 @@ def remove_coding(text):
TEMPLATE = """
{{ source_code }}
-{{ only_html }}
+.. only:: html
{% if source_link or (html_show_formats and not multi_image) %}
(
@@ -393,27 +393,15 @@ TEMPLATE = """
{{ caption }}
{% endfor %}
-{{ only_latex }}
+.. only:: not html
{% for img in images %}
- {% if 'pdf' in img.formats -%}
- .. figure:: {{ build_dir }}/{{ img.basename }}.pdf
+ .. figure:: {{ build_dir }}/{{ img.basename }}.*
{% for option in options -%}
{{ option }}
{% endfor %}
{{ caption }}
- {% endif -%}
- {% endfor %}
-
-{{ only_texinfo }}
-
- {% for img in images %}
- .. image:: {{ build_dir }}/{{ img.basename }}.png
- {% for option in options -%}
- {{ option }}
- {% endfor %}
-
{% endfor %}
"""
@@ -813,10 +801,6 @@ def run(arguments, content, options, state_machine, state, lineno):
':%s: %s' % (key, val) for key, val in six.iteritems(options)
if key in ('alt', 'height', 'width', 'scale', 'align', 'class')]
- only_html = ".. only:: html"
- only_latex = ".. only:: latex"
- only_texinfo = ".. only:: texinfo"
-
# Not-None src_link signals the need for a source link in the generated
# html
if j == 0 and config.plot_html_show_source_link:
@@ -830,9 +814,6 @@ def run(arguments, content, options, state_machine, state, lineno):
build_dir=build_dir_link,
source_link=src_link,
multi_image=len(images) > 1,
- only_html=only_html,
- only_latex=only_latex,
- only_texinfo=only_texinfo,
options=opts,
images=images,
source_code=source_code,
diff --git a/contrib/python/matplotlib/py2/mpl_toolkits/axes_grid1/axes_grid.py b/contrib/python/matplotlib/py2/mpl_toolkits/axes_grid1/axes_grid.py
index dde0e8dd7cc..d7e4fa8768c 100644
--- a/contrib/python/matplotlib/py2/mpl_toolkits/axes_grid1/axes_grid.py
+++ b/contrib/python/matplotlib/py2/mpl_toolkits/axes_grid1/axes_grid.py
@@ -484,7 +484,7 @@ class ImageGrid(Grid):
if ngrids is None:
ngrids = self._nrows * self._ncols
else:
- if not 0 <= ngrids < self._nrows * self._ncols:
+ if not 0 < ngrids <= self._nrows * self._ncols:
raise Exception
self.ngrids = ngrids
diff --git a/contrib/python/matplotlib/py2/src/_png.cpp b/contrib/python/matplotlib/py2/src/_png.cpp
index 1dcbf713f2d..ea7bf32efee 100644
--- a/contrib/python/matplotlib/py2/src/_png.cpp
+++ b/contrib/python/matplotlib/py2/src/_png.cpp
@@ -1,14 +1,11 @@
/* -*- mode: c++; c-basic-offset: 4 -*- */
-// this code is heavily adapted from the paint license, which is in
-// the file paint.license (BSD compatible) included in this
-// distribution. TODO, add license file to MANIFEST.in and CVS
-
/* For linux, png.h must be imported before Python.h because
png.h needs to be the one to define setjmp.
Undefining _POSIX_C_SOURCE and _XOPEN_SOURCE stops a couple
of harmless warnings.
*/
+#define PY_SSIZE_T_CLEAN
extern "C" {
# include <png.h>
@@ -139,6 +136,9 @@ const char *Py_write_png__doc__ =
" Byte string containing the PNG content if None was passed in for\n"
" file, otherwise None is returned.\n";
+// this code is heavily adapted from
+// https://www.object-craft.com.au/projects/paint/ which licensed under the
+// (BSD compatible) LICENSE_PAINT which is included in this distribution.
static PyObject *Py_write_png(PyObject *self, PyObject *args, PyObject *kwds)
{
numpy::array_view<unsigned char, 3> buffer;
diff --git a/contrib/python/matplotlib/py2/src/_tkagg.cpp b/contrib/python/matplotlib/py2/src/_tkagg.cpp
index ad5289b3d6e..106f1398b30 100644
--- a/contrib/python/matplotlib/py2/src/_tkagg.cpp
+++ b/contrib/python/matplotlib/py2/src/_tkagg.cpp
@@ -7,7 +7,7 @@
* See LICENSE/LICENSE.PIL for details.
*
*/
-
+#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <cstdlib>
#include <cstdio>
diff --git a/contrib/python/matplotlib/py2/src/_ttconv.cpp b/contrib/python/matplotlib/py2/src/_ttconv.cpp
index e0aa4611d28..e18c8a53cab 100644
--- a/contrib/python/matplotlib/py2/src/_ttconv.cpp
+++ b/contrib/python/matplotlib/py2/src/_ttconv.cpp
@@ -5,7 +5,7 @@
Python wrapper for TrueType conversion library in ../ttconv.
*/
-
+#define PY_SSIZE_T_CLEAN
#include "mplutils.h"
#include <Python.h>
diff --git a/contrib/python/matplotlib/py2/src/file_compat.h b/contrib/python/matplotlib/py2/src/file_compat.h
index 691133dcbb7..114279fb1a1 100644
--- a/contrib/python/matplotlib/py2/src/file_compat.h
+++ b/contrib/python/matplotlib/py2/src/file_compat.h
@@ -1,6 +1,6 @@
#ifndef __FILE_COMPAT_H__
#define __FILE_COMPAT_H__
-
+#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <stdio.h>
#include "numpy/npy_common.h"
diff --git a/contrib/python/matplotlib/py2/src/ft2font.h b/contrib/python/matplotlib/py2/src/ft2font.h
index c60d5432cff..072428ceedb 100644
--- a/contrib/python/matplotlib/py2/src/ft2font.h
+++ b/contrib/python/matplotlib/py2/src/ft2font.h
@@ -18,8 +18,8 @@ extern "C" {
/*
By definition, FT_FIXED as 2 16bit values stored in a single long.
*/
-#define FIXED_MAJOR(val) (long)((val & 0xffff000) >> 16)
-#define FIXED_MINOR(val) (long)(val & 0xffff)
+#define FIXED_MAJOR(val) (signed short)((val & 0xffff0000) >> 16)
+#define FIXED_MINOR(val) (unsigned short)(val & 0xffff)
// the FreeType string rendered into a width, height buffer
class FT2Image
diff --git a/contrib/python/matplotlib/py2/src/ft2font_wrapper.cpp b/contrib/python/matplotlib/py2/src/ft2font_wrapper.cpp
index 49c33b79435..d0e516ad025 100644
--- a/contrib/python/matplotlib/py2/src/ft2font_wrapper.cpp
+++ b/contrib/python/matplotlib/py2/src/ft2font_wrapper.cpp
@@ -276,7 +276,7 @@ static void PyGlyph_dealloc(PyGlyph *self)
static PyObject *PyGlyph_get_bbox(PyGlyph *self, void *closure)
{
return Py_BuildValue(
- "iiii", self->bbox.xMin, self->bbox.yMin, self->bbox.xMax, self->bbox.yMax);
+ "llll", self->bbox.xMin, self->bbox.yMin, self->bbox.xMax, self->bbox.yMax);
}
static PyTypeObject *PyGlyph_init_type(PyObject *m, PyTypeObject *type)
@@ -1026,7 +1026,7 @@ static PyObject *PyFT2Font_get_sfnt(PyFT2Font *self, PyObject *args, PyObject *k
}
PyObject *key = Py_BuildValue(
- "iiii", sfnt.platform_id, sfnt.encoding_id, sfnt.language_id, sfnt.name_id);
+ "HHHH", sfnt.platform_id, sfnt.encoding_id, sfnt.language_id, sfnt.name_id);
if (key == NULL) {
Py_DECREF(names);
return NULL;
@@ -1090,7 +1090,7 @@ static PyObject *PyFT2Font_get_ps_font_info(PyFT2Font *self, PyObject *args, PyO
return NULL;
}
- return Py_BuildValue("sssssliii",
+ return Py_BuildValue("ssssslbhH",
fontinfo.version ? fontinfo.version : "",
fontinfo.notice ? fontinfo.notice : "",
fontinfo.full_name ? fontinfo.full_name : "",
@@ -1135,8 +1135,8 @@ static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObj
switch (tag) {
case 0: {
char head_dict[] =
- "{s:(h,h), s:(h,h), s:l, s:l, s:i, s:i,"
- "s:(l,l), s:(l,l), s:h, s:h, s:h, s:h, s:i, s:i, s:h, s:h, s:h}";
+ "{s:(h,H), s:(h,H), s:l, s:l, s:H, s:H,"
+ "s:(l,l), s:(l,l), s:h, s:h, s:h, s:h, s:H, s:H, s:h, s:h, s:h}";
TT_Header *t = (TT_Header *)table;
return Py_BuildValue(head_dict,
"version",
@@ -1150,9 +1150,9 @@ static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObj
"magicNumber",
t->Magic_Number,
"flags",
- (unsigned)t->Flags,
+ t->Flags,
"unitsPerEm",
- (unsigned)t->Units_Per_EM,
+ t->Units_Per_EM,
"created",
t->Created[0],
t->Created[1],
@@ -1168,9 +1168,9 @@ static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObj
"yMax",
t->yMax,
"macStyle",
- (unsigned)t->Mac_Style,
+ t->Mac_Style,
"lowestRecPPEM",
- (unsigned)t->Lowest_Rec_PPEM,
+ t->Lowest_Rec_PPEM,
"fontDirectionHint",
t->Font_Direction,
"indexToLocFormat",
@@ -1180,64 +1180,64 @@ static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObj
}
case 1: {
char maxp_dict[] =
- "{s:(h,h), s:i, s:i, s:i, s:i, s:i, s:i,"
- "s:i, s:i, s:i, s:i, s:i, s:i, s:i, s:i}";
+ "{s:(h,H), s:H, s:H, s:H, s:H, s:H, s:H,"
+ "s:H, s:H, s:H, s:H, s:H, s:H, s:H, s:H}";
TT_MaxProfile *t = (TT_MaxProfile *)table;
return Py_BuildValue(maxp_dict,
"version",
FIXED_MAJOR(t->version),
FIXED_MINOR(t->version),
"numGlyphs",
- (unsigned)t->numGlyphs,
+ t->numGlyphs,
"maxPoints",
- (unsigned)t->maxPoints,
+ t->maxPoints,
"maxContours",
- (unsigned)t->maxContours,
+ t->maxContours,
"maxComponentPoints",
- (unsigned)t->maxCompositePoints,
+ t->maxCompositePoints,
"maxComponentContours",
- (unsigned)t->maxCompositeContours,
+ t->maxCompositeContours,
"maxZones",
- (unsigned)t->maxZones,
+ t->maxZones,
"maxTwilightPoints",
- (unsigned)t->maxTwilightPoints,
+ t->maxTwilightPoints,
"maxStorage",
- (unsigned)t->maxStorage,
+ t->maxStorage,
"maxFunctionDefs",
- (unsigned)t->maxFunctionDefs,
+ t->maxFunctionDefs,
"maxInstructionDefs",
- (unsigned)t->maxInstructionDefs,
+ t->maxInstructionDefs,
"maxStackElements",
- (unsigned)t->maxStackElements,
+ t->maxStackElements,
"maxSizeOfInstructions",
- (unsigned)t->maxSizeOfInstructions,
+ t->maxSizeOfInstructions,
"maxComponentElements",
- (unsigned)t->maxComponentElements,
+ t->maxComponentElements,
"maxComponentDepth",
- (unsigned)t->maxComponentDepth);
+ t->maxComponentDepth);
}
case 2: {
#if PY3K
char os_2_dict[] =
- "{s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:h,"
- "s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:y#, s:(llll),"
- "s:y#, s:h, s:h, s:h}";
+ "{s:H, s:h, s:H, s:H, s:H, s:h, s:h, s:h,"
+ "s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:y#, s:(kkkk),"
+ "s:y#, s:H, s:H, s:H}";
#else
char os_2_dict[] =
- "{s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:h,"
- "s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:s#, s:(llll),"
- "s:s#, s:h, s:h, s:h}";
+ "{s:H, s:h, s:H, s:H, s:H, s:h, s:h, s:h,"
+ "s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:h, s:s#, s:(kkkk),"
+ "s:s#, s:H, s:H, s:H}";
#endif
TT_OS2 *t = (TT_OS2 *)table;
return Py_BuildValue(os_2_dict,
"version",
- (unsigned)t->version,
+ t->version,
"xAvgCharWidth",
t->xAvgCharWidth,
"usWeightClass",
- (unsigned)t->usWeightClass,
+ t->usWeightClass,
"usWidthClass",
- (unsigned)t->usWidthClass,
+ t->usWidthClass,
"fsType",
t->fsType,
"ySubscriptXSize",
@@ -1264,26 +1264,26 @@ static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObj
t->sFamilyClass,
"panose",
t->panose,
- 10,
+ Py_ssize_t(10),
"ulCharRange",
- (unsigned long)t->ulUnicodeRange1,
- (unsigned long)t->ulUnicodeRange2,
- (unsigned long)t->ulUnicodeRange3,
- (unsigned long)t->ulUnicodeRange4,
+ t->ulUnicodeRange1,
+ t->ulUnicodeRange2,
+ t->ulUnicodeRange3,
+ t->ulUnicodeRange4,
"achVendID",
t->achVendID,
- 4,
+ Py_ssize_t(4),
"fsSelection",
- (unsigned)t->fsSelection,
+ t->fsSelection,
"fsFirstCharIndex",
- (unsigned)t->usFirstCharIndex,
+ t->usFirstCharIndex,
"fsLastCharIndex",
- (unsigned)t->usLastCharIndex);
+ t->usLastCharIndex);
}
case 3: {
char hhea_dict[] =
- "{s:(h,h), s:h, s:h, s:h, s:i, s:h, s:h, s:h,"
- "s:h, s:h, s:h, s:h, s:i}";
+ "{s:(h,H), s:h, s:h, s:h, s:H, s:h, s:h, s:h,"
+ "s:h, s:h, s:h, s:h, s:H}";
TT_HoriHeader *t = (TT_HoriHeader *)table;
return Py_BuildValue(hhea_dict,
"version",
@@ -1296,7 +1296,7 @@ static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObj
"lineGap",
t->Line_Gap,
"advanceWidthMax",
- (unsigned)t->advance_Width_Max,
+ t->advance_Width_Max,
"minLeftBearing",
t->min_Left_Side_Bearing,
"minRightBearing",
@@ -1312,12 +1312,12 @@ static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObj
"metricDataFormat",
t->metric_Data_Format,
"numOfLongHorMetrics",
- (unsigned)t->number_Of_HMetrics);
+ t->number_Of_HMetrics);
}
case 4: {
char vhea_dict[] =
- "{s:(h,h), s:h, s:h, s:h, s:i, s:h, s:h, s:h,"
- "s:h, s:h, s:h, s:h, s:i}";
+ "{s:(h,H), s:h, s:h, s:h, s:H, s:h, s:h, s:h,"
+ "s:h, s:h, s:h, s:h, s:H}";
TT_VertHeader *t = (TT_VertHeader *)table;
return Py_BuildValue(vhea_dict,
"version",
@@ -1330,7 +1330,7 @@ static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObj
"vertTypoLineGap",
t->Line_Gap,
"advanceHeightMax",
- (unsigned)t->advance_Height_Max,
+ t->advance_Height_Max,
"minTopSideBearing",
t->min_Top_Side_Bearing,
"minBottomSizeBearing",
@@ -1346,10 +1346,10 @@ static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObj
"metricDataFormat",
t->metric_Data_Format,
"numOfLongVerMetrics",
- (unsigned)t->number_Of_VMetrics);
+ t->number_Of_VMetrics);
}
case 5: {
- char post_dict[] = "{s:(h,h), s:(h,h), s:h, s:h, s:k, s:k, s:k, s:k, s:k}";
+ char post_dict[] = "{s:(h,H), s:(h,H), s:h, s:h, s:k, s:k, s:k, s:k, s:k}";
TT_Postscript *t = (TT_Postscript *)table;
return Py_BuildValue(post_dict,
"format",
@@ -1376,12 +1376,12 @@ static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObj
case 6: {
#if PY3K
char pclt_dict[] =
- "{s:(h,h), s:k, s:H, s:H, s:H, s:H, s:H, s:H, s:y, s:y, s:b, s:b, "
- "s:b}";
+ "{s:(h,H), s:k, s:H, s:H, s:H, s:H, s:H, s:H, s:y#, s:y#, s:b, "
+ "s:b, s:b}";
#else
char pclt_dict[] =
- "{s:(h,h), s:k, s:H, s:H, s:H, s:H, s:H, s:H, s:s, s:s, s:b, s:b, "
- "s:b}";
+ "{s:(h,H), s:k, s:H, s:H, s:H, s:H, s:H, s:H, s:s#, s:s#, s:b, "
+ "s:b, s:b}";
#endif
TT_PCLT *t = (TT_PCLT *)table;
return Py_BuildValue(pclt_dict,
@@ -1404,8 +1404,10 @@ static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObj
t->SymbolSet,
"typeFace",
t->TypeFace,
+ Py_ssize_t(16),
"characterComplement",
t->CharacterComplement,
+ Py_ssize_t(8),
"strokeWeight",
t->StrokeWeight,
"widthType",
@@ -1528,7 +1530,8 @@ static PyObject *PyFT2Font_get_bbox(PyFT2Font *self, void *closure)
{
FT_BBox *bbox = &(self->x->get_face()->bbox);
- return Py_BuildValue("iiii", bbox->xMin, bbox->yMin, bbox->xMax, bbox->yMax);
+ return Py_BuildValue("llll",
+ bbox->xMin, bbox->yMin, bbox->xMax, bbox->yMax);
}
static PyObject *PyFT2Font_ascender(PyFT2Font *self, void *closure)
diff --git a/contrib/python/matplotlib/py2/src/mplutils.h b/contrib/python/matplotlib/py2/src/mplutils.h
index 140a8156347..4b59e08bbd4 100644
--- a/contrib/python/matplotlib/py2/src/mplutils.h
+++ b/contrib/python/matplotlib/py2/src/mplutils.h
@@ -4,6 +4,7 @@
#ifndef _MPLUTILS_H
#define _MPLUTILS_H
+#define PY_SSIZE_T_CLEAN
#if defined(_MSC_VER) && _MSC_VER <= 1600
typedef unsigned __int8 uint8_t;
diff --git a/contrib/python/matplotlib/py2/src/numpy_cpp.h b/contrib/python/matplotlib/py2/src/numpy_cpp.h
index 03b4a695d18..75f773ee58e 100644
--- a/contrib/python/matplotlib/py2/src/numpy_cpp.h
+++ b/contrib/python/matplotlib/py2/src/numpy_cpp.h
@@ -2,7 +2,7 @@
#ifndef _NUMPY_CPP_H_
#define _NUMPY_CPP_H_
-
+#define PY_SSIZE_T_CLEAN
/***************************************************************************
* This file is based on original work by Mark Wiebe, available at:
*
diff --git a/contrib/python/matplotlib/py2/src/py_adaptors.h b/contrib/python/matplotlib/py2/src/py_adaptors.h
index 8eaa7ad6c71..3d0dbdab45b 100644
--- a/contrib/python/matplotlib/py2/src/py_adaptors.h
+++ b/contrib/python/matplotlib/py2/src/py_adaptors.h
@@ -2,7 +2,7 @@
#ifndef __PY_ADAPTORS_H__
#define __PY_ADAPTORS_H__
-
+#define PY_SSIZE_T_CLEAN
/***************************************************************************
* This module contains a number of C++ classes that adapt Python data
* structures to C++ and Agg-friendly interfaces.
diff --git a/contrib/python/matplotlib/py2/src/py_converters.cpp b/contrib/python/matplotlib/py2/src/py_converters.cpp
index c36fc59f59d..2d5d415a2c9 100644
--- a/contrib/python/matplotlib/py2/src/py_converters.cpp
+++ b/contrib/python/matplotlib/py2/src/py_converters.cpp
@@ -1,5 +1,5 @@
#define NO_IMPORT_ARRAY
-
+#define PY_SSIZE_T_CLEAN
#include "py_converters.h"
#include "numpy_cpp.h"
diff --git a/contrib/python/matplotlib/py2/src/qhull_wrap.c b/contrib/python/matplotlib/py2/src/qhull_wrap.c
index 9cbaf64f01d..836a16c555b 100644
--- a/contrib/python/matplotlib/py2/src/qhull_wrap.c
+++ b/contrib/python/matplotlib/py2/src/qhull_wrap.c
@@ -5,6 +5,7 @@
* triangulation, construct an instance of the matplotlib.tri.Triangulation
* class without specifying a triangles array.
*/
+#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "numpy/noprefix.h"
#include "qhull_ra.h"
diff --git a/contrib/python/matplotlib/py2/ya.make b/contrib/python/matplotlib/py2/ya.make
index 7242059690a..1d5ee4878bb 100644
--- a/contrib/python/matplotlib/py2/ya.make
+++ b/contrib/python/matplotlib/py2/ya.make
@@ -2,7 +2,7 @@ PY2_LIBRARY()
LICENSE(PSF-2.0)
-VERSION(2.2.4)
+VERSION(2.2.5)
PEERDIR(
contrib/deprecated/python/backports.functools-lru-cache