Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit47a4870

Browse files
committed
Move local freetype building resp. to freetypy
1 parent315a30c commit47a4870

File tree

5 files changed

+7
-41
lines changed

5 files changed

+7
-41
lines changed

‎lib/matplotlib/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,11 +1503,11 @@ def _init_tests():
15031503
# tests. This must match the value in `setupext.py`
15041504
LOCAL_FREETYPE_VERSION='2.6.1'
15051505

1506-
frommatplotlibimportft2font
1507-
if (ft2font.__freetype_version__!=LOCAL_FREETYPE_VERSIONor
1508-
ft2font.__freetype_build_type__!='local'):
1506+
importfreetypyasft
1507+
if (ft.__freetype_version__!=LOCAL_FREETYPE_VERSIONor
1508+
ft.__freetype_build_type__!='local'):
15091509
warnings.warn(
1510-
"matplotlib is not built with the correct FreeType version to run "
1510+
"freetypy is not built with the correct FreeType version to run "
15111511
"tests. Set local_freetype=True in setup.cfg and rebuild. "
15121512
"Expect many image comparison failures below.")
15131513

‎lib/matplotlib/font_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
importnumpyasnp
1616

17-
frommatplotlibimportceil
17+
frommathimportceil
1818

1919

2020
defdraw_glyph_to_bitmap(image,x,y,glyph):

‎lib/matplotlib/testing/decorators.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
importnose
1515
importnumpyasnp
16+
importfreetypyasft
1617

1718
importmatplotlibasmpl
1819
importmatplotlib.style
@@ -123,8 +124,6 @@ def wrapped_function(*args, **kwargs):
123124

124125

125126
defcheck_freetype_version(ver):
126-
importfreetypyasft
127-
128127
ifverisNone:
129128
returnTrue
130129

@@ -224,7 +223,7 @@ def do_test():
224223
ifnotcheck_freetype_version(self._freetype_version):
225224
raiseKnownFailureTest(
226225
"Mismatched version of freetype. Test requires '%s', you have '%s'"%
227-
(self._freetype_version,ft2font.__freetype_version__))
226+
(self._freetype_version,ft.__freetype_version__))
228227
raise
229228

230229
yield (do_test,)

‎setup.cfg.template

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@
88
# This can be a single directory or a comma-delimited list of directories.
99
#basedirlist = /usr
1010

11-
[test]
12-
# If you plan to develop matplotlib and run or add to the test suite,
13-
# set this to True. It will download and build a specific version of
14-
# FreeType, and then use that to build the ft2font extension. This
15-
# ensures that test images are exactly reproducible.
16-
#local_freetype = False
17-
1811
[status]
1912
# To suppress display of the dependencies and their versions
2013
# at the top of the build log, uncomment the following line:

‎setupext.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
fromdistutilsimportversion
55
fromdistutils.coreimportExtension
66
importglob
7-
importio
87
importmultiprocessing
98
importos
109
importre
@@ -20,13 +19,6 @@
2019
PY3= (sys.version_info[0]>=3)
2120

2221

23-
# This is the version of FreeType to use when building a local
24-
# version. It must match the value in
25-
# lib/matplotlib.__init__.py
26-
LOCAL_FREETYPE_VERSION='2.6.1'
27-
# md5 hash of the freetype tarball
28-
LOCAL_FREETYPE_HASH='348e667d728c597360e4a87c16556597'
29-
3022
ifsys.platform!='win32':
3123
ifsys.version_info[0]<3:
3224
fromcommandsimportgetstatusoutput
@@ -64,9 +56,6 @@
6456
options['basedirlist']= [
6557
x.strip()forxin
6658
config.get("directories","basedirlist").split(',')]
67-
68-
ifconfig.has_option('test','local_freetype'):
69-
options['local_freetype']=config.get("test","local_freetype")
7059
else:
7160
config=None
7261

@@ -223,21 +212,6 @@ def make_extension(name, files, *args, **kwargs):
223212
returnext
224213

225214

226-
defget_file_hash(filename):
227-
"""
228-
Get the MD5 hash of a given filename.
229-
"""
230-
importhashlib
231-
BLOCKSIZE=1<<16
232-
hasher=hashlib.md5()
233-
withopen(filename,'rb')asfd:
234-
buf=fd.read(BLOCKSIZE)
235-
whilelen(buf)>0:
236-
hasher.update(buf)
237-
buf=fd.read(BLOCKSIZE)
238-
returnhasher.hexdigest()
239-
240-
241215
classPkgConfig(object):
242216
"""
243217
This is a class for communicating with pkg-config.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp