From a240ac5bb368422adc475fe5624fec7151950e34 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 23 Oct 2023 16:55:07 +0100 Subject: [PATCH 01/10] Update sphinx from 5.3.0 to 7.2.6 --- Doc/docs-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/docs-requirements.txt b/Doc/docs-requirements.txt index d80c533af..da5fcf203 100644 --- a/Doc/docs-requirements.txt +++ b/Doc/docs-requirements.txt @@ -1,4 +1,4 @@ -sphinx==5.3.0 +sphinx==7.2.6 sphinx_rtd_theme==1.1.1 reportlab==3.6.13 freetype-py==2.3.0 From 22cf47de513a7e5d6bd75c2c0aa4c2be284d6ec2 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 23 Oct 2023 16:55:07 +0100 Subject: [PATCH 02/10] Update sphinx_rtd_theme from 1.1.1 to 1.3.0 --- Doc/docs-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/docs-requirements.txt b/Doc/docs-requirements.txt index da5fcf203..3ba409fc6 100644 --- a/Doc/docs-requirements.txt +++ b/Doc/docs-requirements.txt @@ -1,4 +1,4 @@ sphinx==7.2.6 -sphinx_rtd_theme==1.1.1 +sphinx_rtd_theme==1.3.0 reportlab==3.6.13 freetype-py==2.3.0 From 6f74f07f42da8b5dedab82ce382844d180ae33cd Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 23 Oct 2023 16:55:08 +0100 Subject: [PATCH 03/10] Update reportlab from 3.6.13 to 4.0.6 --- Doc/docs-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/docs-requirements.txt b/Doc/docs-requirements.txt index 3ba409fc6..0c71684c8 100644 --- a/Doc/docs-requirements.txt +++ b/Doc/docs-requirements.txt @@ -1,4 +1,4 @@ sphinx==7.2.6 sphinx_rtd_theme==1.3.0 -reportlab==3.6.13 +reportlab==4.0.6 freetype-py==2.3.0 From b00533db1b519269f2aa92f5f7ab8a3cc591be8a Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 23 Oct 2023 16:55:08 +0100 Subject: [PATCH 04/10] Update freetype-py from 2.3.0 to 2.4.0 --- Doc/docs-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/docs-requirements.txt b/Doc/docs-requirements.txt index 0c71684c8..f8f93c157 100644 --- a/Doc/docs-requirements.txt +++ b/Doc/docs-requirements.txt @@ -1,4 +1,4 @@ sphinx==7.2.6 sphinx_rtd_theme==1.3.0 reportlab==4.0.6 -freetype-py==2.3.0 +freetype-py==2.4.0 From e9f72917021aebe032ea76f4819f0c2f301c6790 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 23 Oct 2023 16:55:09 +0100 Subject: [PATCH 05/10] Update black from 22.12.0 to 23.10.0 --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index a986a1fe7..69601f35c 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -5,4 +5,4 @@ sphinx>=1.5.5 mypy>=0.782 # Pin black as each version could change formatting, breaking CI randomly. -black==22.12.0 +black==23.10.0 From 480e69399b2867e0bf6bdbb81dbdf4c06c654c7f Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 23 Oct 2023 16:55:09 +0100 Subject: [PATCH 06/10] Update unicodedata2 from 15.0.0 to 15.1.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5861e458e..aeb9b5a73 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ # extension 'brotlipy' on PyPy brotli==1.1.0; platform_python_implementation != "PyPy" brotlicffi==1.1.0.0; platform_python_implementation == "PyPy" -unicodedata2==15.0.0; python_version <= '3.11' +unicodedata2==15.1.0; python_version <= '3.11' scipy==1.10.0; platform_python_implementation != "PyPy" and python_version <= '3.8' scipy==1.11.3; platform_python_implementation != "PyPy" and python_version >= '3.9' munkres==1.1.4; platform_python_implementation == "PyPy" From 1e56041a2060e806d7c31cb3bee7d62ed3b9fd4f Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 23 Oct 2023 16:55:10 +0100 Subject: [PATCH 07/10] Update scipy from 1.10.0 to 1.11.3 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index aeb9b5a73..7843dca4c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ brotli==1.1.0; platform_python_implementation != "PyPy" brotlicffi==1.1.0.0; platform_python_implementation == "PyPy" unicodedata2==15.1.0; python_version <= '3.11' -scipy==1.10.0; platform_python_implementation != "PyPy" and python_version <= '3.8' +scipy==1.11.3; platform_python_implementation != "PyPy" and python_version <= '3.8' scipy==1.11.3; platform_python_implementation != "PyPy" and python_version >= '3.9' munkres==1.1.4; platform_python_implementation == "PyPy" zopfli==0.2.3 From f77844215f3e7f3a0987475e2acdc1f14a68bd74 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Mon, 23 Oct 2023 16:55:10 +0100 Subject: [PATCH 08/10] Update glyphslib from 6.4.0 to 6.4.1 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 7843dca4c..e990b8fb7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,5 +15,5 @@ ufo2ft==2.33.4 pyobjc==10.0; sys_platform == "darwin" freetype-py==2.4.0 uharfbuzz==0.37.3 -glyphsLib==6.4.0 # this is only required to run Tests/varLib/interpolatable_test.py +glyphsLib==6.4.1 # this is only required to run Tests/varLib/interpolatable_test.py lxml==4.9.3 From d210cc5ac1a51e6b54f03740836c1fe9d012841b Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Fri, 3 Nov 2023 10:15:23 +0000 Subject: [PATCH 09/10] requirements.txt: tell pyup bot to keep scipy pinned for py3.8 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e990b8fb7..8a7641024 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ brotli==1.1.0; platform_python_implementation != "PyPy" brotlicffi==1.1.0.0; platform_python_implementation == "PyPy" unicodedata2==15.1.0; python_version <= '3.11' -scipy==1.11.3; platform_python_implementation != "PyPy" and python_version <= '3.8' +scipy==1.10.0; platform_python_implementation != "PyPy" and python_version <= '3.8' # pyup: ignore scipy==1.11.3; platform_python_implementation != "PyPy" and python_version >= '3.9' munkres==1.1.4; platform_python_implementation == "PyPy" zopfli==0.2.3 From 335a1e56ec49db1966f4934190bcd435b7460b53 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Fri, 3 Nov 2023 10:25:15 +0000 Subject: [PATCH 10/10] re-run black v23.10 on all .py files --- Lib/fontTools/afmLib.py | 1 - Lib/fontTools/cffLib/__init__.py | 3 --- Lib/fontTools/cffLib/specializer.py | 1 - Lib/fontTools/cffLib/width.py | 2 -- Lib/fontTools/feaLib/parser.py | 4 ++-- Lib/fontTools/merge/__init__.py | 1 - Lib/fontTools/merge/options.py | 1 - Lib/fontTools/misc/classifyTools.py | 1 - Lib/fontTools/misc/dictTools.py | 1 + Lib/fontTools/misc/psCharStrings.py | 3 --- Lib/fontTools/misc/psLib.py | 1 - Lib/fontTools/misc/psOperators.py | 2 -- Lib/fontTools/misc/symfont.py | 3 --- Lib/fontTools/misc/visitor.py | 2 -- Lib/fontTools/otlLib/optimize/gpos.py | 3 ++- Lib/fontTools/pens/cu2quPen.py | 4 ++-- Lib/fontTools/subset/svg.py | 1 - Lib/fontTools/svgLib/path/parser.py | 1 - Lib/fontTools/ttLib/scaleUpem.py | 1 - Lib/fontTools/ttLib/sfnt.py | 3 --- Lib/fontTools/ttLib/tables/C_B_D_T_.py | 2 -- Lib/fontTools/ttLib/tables/C_B_L_C_.py | 1 - Lib/fontTools/ttLib/tables/C_O_L_R_.py | 2 +- Lib/fontTools/ttLib/tables/C_P_A_L_.py | 1 - Lib/fontTools/ttLib/tables/DefaultTable.py | 1 - Lib/fontTools/ttLib/tables/E_B_D_T_.py | 4 +--- Lib/fontTools/ttLib/tables/E_B_L_C_.py | 7 ------- Lib/fontTools/ttLib/tables/G_M_A_P_.py | 1 - Lib/fontTools/ttLib/tables/M_E_T_A_.py | 1 - Lib/fontTools/ttLib/tables/S_I_N_G_.py | 1 - Lib/fontTools/ttLib/tables/T_S_I__0.py | 1 - Lib/fontTools/ttLib/tables/T_S_I__1.py | 1 - Lib/fontTools/ttLib/tables/T_S_I__2.py | 1 - Lib/fontTools/ttLib/tables/T_S_I__3.py | 1 - Lib/fontTools/ttLib/tables/_c_m_a_p.py | 2 -- Lib/fontTools/ttLib/tables/_h_e_a_d.py | 1 - Lib/fontTools/ttLib/tables/_h_h_e_a.py | 1 - Lib/fontTools/ttLib/tables/_h_m_t_x.py | 1 - Lib/fontTools/ttLib/tables/_k_e_r_n.py | 1 - Lib/fontTools/ttLib/tables/_l_o_c_a.py | 1 - Lib/fontTools/ttLib/tables/_m_a_x_p.py | 1 - Lib/fontTools/ttLib/tables/_v_h_e_a.py | 1 - Lib/fontTools/ttLib/tables/_v_m_t_x.py | 1 - Lib/fontTools/ttLib/tables/otTables.py | 1 - Lib/fontTools/ttLib/ttCollection.py | 1 - Lib/fontTools/ttLib/ttFont.py | 1 - Lib/fontTools/ttLib/ttGlyphSet.py | 4 ---- Lib/fontTools/ttLib/woff2.py | 3 --- Lib/fontTools/ttx.py | 1 - Lib/fontTools/varLib/models.py | 1 - MetaTools/buildTableList.py | 1 - Snippets/interpolate.py | 2 +- Snippets/print-json.py | 1 - Tests/misc/encodingTools_test.py | 1 - Tests/misc/psCharStrings_test.py | 2 +- Tests/misc/py23_test.py | 3 --- Tests/mtiLib/mti_test.py | 2 -- Tests/pens/cu2quPen_test.py | 1 - Tests/pens/ttGlyphPen_test.py | 3 --- Tests/qu2cu/qu2cu_test.py | 2 -- Tests/ttLib/scaleUpem_test.py | 3 --- Tests/ttLib/tables/_a_v_a_r_test.py | 1 - Tests/ttLib/tables/_c_v_a_r_test.py | 2 +- Tests/ttLib/tables/_g_v_a_r_test.py | 2 +- Tests/ttLib/tables/_l_t_a_g_test.py | 1 - Tests/ttLib/ttVisitor_test.py | 1 - Tests/ufoLib/UFO3_test.py | 1 - Tests/ufoLib/UFOConversion_test.py | 2 -- Tests/varLib/featureVars_test.py | 1 - Tests/varLib/iup_test.py | 1 - 70 files changed, 13 insertions(+), 106 deletions(-) diff --git a/Lib/fontTools/afmLib.py b/Lib/fontTools/afmLib.py index 394b901ff..935a1e8e0 100644 --- a/Lib/fontTools/afmLib.py +++ b/Lib/fontTools/afmLib.py @@ -119,7 +119,6 @@ class error(Exception): class AFM(object): - _attrs = None _keywords = [ diff --git a/Lib/fontTools/cffLib/__init__.py b/Lib/fontTools/cffLib/__init__.py index b5b859fc5..644508c15 100644 --- a/Lib/fontTools/cffLib/__init__.py +++ b/Lib/fontTools/cffLib/__init__.py @@ -1000,7 +1000,6 @@ class TopDictIndex(Index): class FDArrayIndex(Index): - compilerClass = FDArrayIndexCompiler def toXML(self, xmlWriter): @@ -2483,7 +2482,6 @@ def encodeNumber(num): class TopDictCompiler(DictCompiler): - opcodes = buildOpcodeDict(topDictOperators) def getChildren(self, strings): @@ -2590,7 +2588,6 @@ class FontDictCompiler(DictCompiler): class PrivateDictCompiler(DictCompiler): - maxBlendStack = maxStackLimit opcodes = buildOpcodeDict(privateDictOperators) diff --git a/Lib/fontTools/cffLib/specializer.py b/Lib/fontTools/cffLib/specializer.py index 3d28c82dc..f3645bf10 100644 --- a/Lib/fontTools/cffLib/specializer.py +++ b/Lib/fontTools/cffLib/specializer.py @@ -513,7 +513,6 @@ def specializeCommands( preserveTopology=False, maxstack=48, ): - # We perform several rounds of optimizations. They are carefully ordered and are: # # 0. Generalize commands. diff --git a/Lib/fontTools/cffLib/width.py b/Lib/fontTools/cffLib/width.py index c0a746b69..0ba3ed39b 100644 --- a/Lib/fontTools/cffLib/width.py +++ b/Lib/fontTools/cffLib/width.py @@ -22,7 +22,6 @@ class missingdict(dict): def cumSum(f, op=add, start=0, decreasing=False): - keys = sorted(f.keys()) minx, maxx = keys[0], keys[-1] @@ -46,7 +45,6 @@ def cumSum(f, op=add, start=0, decreasing=False): def byteCost(widths, default, nominal): - if not hasattr(widths, "items"): d = defaultdict(int) for w in widths: diff --git a/Lib/fontTools/feaLib/parser.py b/Lib/fontTools/feaLib/parser.py index 49667f450..8ffdf644c 100644 --- a/Lib/fontTools/feaLib/parser.py +++ b/Lib/fontTools/feaLib/parser.py @@ -45,7 +45,6 @@ class Parser(object): def __init__( self, featurefile, glyphNames=(), followIncludes=True, includeDir=None, **kwargs ): - if "glyphMap" in kwargs: from fontTools.misc.loggingTools import deprecateArgument @@ -1754,7 +1753,8 @@ class Parser(object): def parse_featureNames_(self, tag): """Parses a ``featureNames`` statement found in stylistic set features. - See section `8.c `_.""" + See section `8.c `_. + """ assert self.cur_token_ == "featureNames", self.cur_token_ block = self.ast.NestedBlock( tag, self.cur_token_, location=self.cur_token_location_ diff --git a/Lib/fontTools/merge/__init__.py b/Lib/fontTools/merge/__init__.py index 10eff133f..8d8a5213e 100644 --- a/Lib/fontTools/merge/__init__.py +++ b/Lib/fontTools/merge/__init__.py @@ -51,7 +51,6 @@ class Merger(object): """ def __init__(self, options=None): - if not options: options = Options() diff --git a/Lib/fontTools/merge/options.py b/Lib/fontTools/merge/options.py index 0c4cfb998..f13400936 100644 --- a/Lib/fontTools/merge/options.py +++ b/Lib/fontTools/merge/options.py @@ -8,7 +8,6 @@ class Options(object): pass def __init__(self, **kwargs): - self.verbose = False self.timing = False self.drop_tables = [] diff --git a/Lib/fontTools/misc/classifyTools.py b/Lib/fontTools/misc/classifyTools.py index e46386230..2235bbd7f 100644 --- a/Lib/fontTools/misc/classifyTools.py +++ b/Lib/fontTools/misc/classifyTools.py @@ -9,7 +9,6 @@ class Classifier(object): """ def __init__(self, sort=True): - self._things = set() # set of all things known so far self._sets = [] # list of class sets produced so far self._mapping = {} # map from things to their class set diff --git a/Lib/fontTools/misc/dictTools.py b/Lib/fontTools/misc/dictTools.py index 259613b27..e3c0df735 100644 --- a/Lib/fontTools/misc/dictTools.py +++ b/Lib/fontTools/misc/dictTools.py @@ -3,6 +3,7 @@ __all__ = ["hashdict"] + # https://stackoverflow.com/questions/1151658/python-hashable-dicts class hashdict(dict): """ diff --git a/Lib/fontTools/misc/psCharStrings.py b/Lib/fontTools/misc/psCharStrings.py index 0092a98ec..cc9ca01c7 100644 --- a/Lib/fontTools/misc/psCharStrings.py +++ b/Lib/fontTools/misc/psCharStrings.py @@ -1092,7 +1092,6 @@ class T1OutlineExtractor(T2OutlineExtractor): class T2CharString(object): - operandEncoding = t2OperandEncoding operators, opcodes = buildOperatorDict(t2Operators) decompilerClass = SimpleT2Decompiler @@ -1313,7 +1312,6 @@ class T2CharString(object): class T1CharString(T2CharString): - operandEncoding = t1OperandEncoding operators, opcodes = buildOperatorDict(t1Operators) @@ -1347,7 +1345,6 @@ class T1CharString(T2CharString): class DictDecompiler(object): - operandEncoding = cffDictOperandEncoding def __init__(self, strings, parent=None): diff --git a/Lib/fontTools/misc/psLib.py b/Lib/fontTools/misc/psLib.py index 1e0408ce9..3bfdb4ae9 100644 --- a/Lib/fontTools/misc/psLib.py +++ b/Lib/fontTools/misc/psLib.py @@ -100,7 +100,6 @@ class PSTokenizer(object): commentmatch=commentRE.match, endmatch=endofthingRE.match, ): - self.skipwhite() if self.pos >= self.len: return None, None diff --git a/Lib/fontTools/misc/psOperators.py b/Lib/fontTools/misc/psOperators.py index d0ef432f5..d0b975eab 100644 --- a/Lib/fontTools/misc/psOperators.py +++ b/Lib/fontTools/misc/psOperators.py @@ -2,7 +2,6 @@ _accessstrings = {0: "", 1: "readonly", 2: "executeonly", 3: "noaccess"} class ps_object(object): - literal = 1 access = 0 value = None @@ -16,7 +15,6 @@ class ps_object(object): class ps_operator(ps_object): - literal = 0 def __init__(self, name, function): diff --git a/Lib/fontTools/misc/symfont.py b/Lib/fontTools/misc/symfont.py index 0bd69a386..fb9e20a46 100644 --- a/Lib/fontTools/misc/symfont.py +++ b/Lib/fontTools/misc/symfont.py @@ -61,7 +61,6 @@ class _BezierFuncsLazy(dict): class GreenPen(BasePen): - _BezierFuncs = {} @classmethod @@ -115,7 +114,6 @@ MomentXYPen = partial(GreenPen, func=x * y) def printGreenPen(penName, funcs, file=sys.stdout, docstring=None): - if docstring is not None: print('"""%s"""' % docstring) @@ -167,7 +165,6 @@ class %s(BasePen): ) for n in (1, 2, 3): - subs = {P[i][j]: [X, Y][j][i] for i in range(n + 1) for j in range(2)} greens = [green(f, BezierCurve[n]) for name, f in funcs] greens = [sp.gcd_terms(f.collect(sum(P, ()))) for f in greens] # Optimize diff --git a/Lib/fontTools/misc/visitor.py b/Lib/fontTools/misc/visitor.py index 3d28135fa..d28989546 100644 --- a/Lib/fontTools/misc/visitor.py +++ b/Lib/fontTools/misc/visitor.py @@ -4,7 +4,6 @@ import enum class Visitor(object): - defaultStop = False @classmethod @@ -58,7 +57,6 @@ class Visitor(object): typ = type(thing) for celf in celf.mro(): - _visitors = getattr(celf, "_visitors", None) if _visitors is None: break diff --git a/Lib/fontTools/otlLib/optimize/gpos.py b/Lib/fontTools/otlLib/optimize/gpos.py index 0acd9ed04..01c2257cd 100644 --- a/Lib/fontTools/otlLib/optimize/gpos.py +++ b/Lib/fontTools/otlLib/optimize/gpos.py @@ -135,6 +135,7 @@ Pairs = Dict[ Tuple[otBase.ValueRecord, otBase.ValueRecord], ] + # Adapted from https://github.com/fonttools/fonttools/blob/f64f0b42f2d1163b2d85194e0979def539f5dca3/Lib/fontTools/ttLib/tables/otTables.py#L935-L958 def _getClassRanges(glyphIDs: Iterable[int]): glyphIDs = sorted(glyphIDs) @@ -274,7 +275,7 @@ class Cluster: ) merged_range_count = 0 last = None - for (start, end) in ranges: + for start, end in ranges: if last is not None and start != last + 1: merged_range_count += 1 last = end diff --git a/Lib/fontTools/pens/cu2quPen.py b/Lib/fontTools/pens/cu2quPen.py index f182aed44..5730b325c 100644 --- a/Lib/fontTools/pens/cu2quPen.py +++ b/Lib/fontTools/pens/cu2quPen.py @@ -199,7 +199,7 @@ class Cu2QuPointPen(BasePointToSegmentPen): # will be appended at the end of the contour last_offcurves = offcurves else: - for (pt, smooth, name, kwargs) in offcurves: + for pt, smooth, name, kwargs in offcurves: pen.addPoint(pt, None, smooth, name, **kwargs) pt, smooth, name, kwargs = points[-1] if pt is None: @@ -212,7 +212,7 @@ class Cu2QuPointPen(BasePointToSegmentPen): pen.addPoint(pt, segment_type, smooth, name, **kwargs) else: raise AssertionError("unexpected segment type: %r" % segment_type) - for (pt, smooth, name, kwargs) in last_offcurves: + for pt, smooth, name, kwargs in last_offcurves: pen.addPoint(pt, None, smooth, name, **kwargs) pen.endPath() diff --git a/Lib/fontTools/subset/svg.py b/Lib/fontTools/subset/svg.py index 9daac6470..329c68fb0 100644 --- a/Lib/fontTools/subset/svg.py +++ b/Lib/fontTools/subset/svg.py @@ -204,7 +204,6 @@ def subset_glyphs(self, s) -> bool: new_docs: List[SVGDocument] = [] for doc in self.docList: - glyphs = { glyph_order[i] for i in range(doc.startGlyphID, doc.endGlyphID + 1) }.intersection(s.glyphs) diff --git a/Lib/fontTools/svgLib/path/parser.py b/Lib/fontTools/svgLib/path/parser.py index 70ae4c17e..fa5347455 100644 --- a/Lib/fontTools/svgLib/path/parser.py +++ b/Lib/fontTools/svgLib/path/parser.py @@ -125,7 +125,6 @@ def parse_path(pathdef, pen, current_pos=(0, 0), arc_class=EllipticalArc): have_arcTo = hasattr(pen, "arcTo") while elements: - if elements[-1] in COMMANDS: # New command. last_command = command # Used by S and T diff --git a/Lib/fontTools/ttLib/scaleUpem.py b/Lib/fontTools/ttLib/scaleUpem.py index 7018f27a7..3f9b22af8 100644 --- a/Lib/fontTools/ttLib/scaleUpem.py +++ b/Lib/fontTools/ttLib/scaleUpem.py @@ -139,7 +139,6 @@ def visit(visitor, obj, attr, glyphs): @ScalerVisitor.register_attr(ttLib.getTableClass("gvar"), "variations") def visit(visitor, obj, attr, variations): - # VarComposites are a pain to handle :-( glyfTable = visitor.font["glyf"] diff --git a/Lib/fontTools/ttLib/sfnt.py b/Lib/fontTools/ttLib/sfnt.py index 354fb85ea..b1569423c 100644 --- a/Lib/fontTools/ttLib/sfnt.py +++ b/Lib/fontTools/ttLib/sfnt.py @@ -524,13 +524,11 @@ class DirectoryEntry(object): class SFNTDirectoryEntry(DirectoryEntry): - format = sfntDirectoryEntryFormat formatSize = sfntDirectoryEntrySize class WOFFDirectoryEntry(DirectoryEntry): - format = woffDirectoryEntryFormat formatSize = woffDirectoryEntrySize @@ -571,7 +569,6 @@ class WOFFDirectoryEntry(DirectoryEntry): class WOFFFlavorData: - Flavor = "woff" def __init__(self, reader=None): diff --git a/Lib/fontTools/ttLib/tables/C_B_D_T_.py b/Lib/fontTools/ttLib/tables/C_B_D_T_.py index e9e2d5fde..2b87ac862 100644 --- a/Lib/fontTools/ttLib/tables/C_B_D_T_.py +++ b/Lib/fontTools/ttLib/tables/C_B_D_T_.py @@ -21,7 +21,6 @@ import struct class table_C_B_D_T_(E_B_D_T_.table_E_B_D_T_): - # Change the data locator table being referenced. locatorName = "CBLC" @@ -42,7 +41,6 @@ def _removeUnsupportedForColor(dataFunctions): class ColorBitmapGlyph(BitmapGlyph): - fileExtension = ".png" xmlDataFunctions = _removeUnsupportedForColor(BitmapGlyph.xmlDataFunctions) diff --git a/Lib/fontTools/ttLib/tables/C_B_L_C_.py b/Lib/fontTools/ttLib/tables/C_B_L_C_.py index e9ed58e58..fc3974ece 100644 --- a/Lib/fontTools/ttLib/tables/C_B_L_C_.py +++ b/Lib/fontTools/ttLib/tables/C_B_L_C_.py @@ -6,5 +6,4 @@ from . import E_B_L_C_ class table_C_B_L_C_(E_B_L_C_.table_E_B_L_C_): - dependencies = ["CBDT"] diff --git a/Lib/fontTools/ttLib/tables/C_O_L_R_.py b/Lib/fontTools/ttLib/tables/C_O_L_R_.py index b4bc5d0c2..2f03ec054 100644 --- a/Lib/fontTools/ttLib/tables/C_O_L_R_.py +++ b/Lib/fontTools/ttLib/tables/C_O_L_R_.py @@ -151,7 +151,7 @@ class LayerRecord(object): writer.newline() def fromXML(self, eltname, attrs, content, ttFont): - for (name, value) in attrs.items(): + for name, value in attrs.items(): if name == "name": setattr(self, name, value) else: diff --git a/Lib/fontTools/ttLib/tables/C_P_A_L_.py b/Lib/fontTools/ttLib/tables/C_P_A_L_.py index 03eb851e8..9fb2074af 100644 --- a/Lib/fontTools/ttLib/tables/C_P_A_L_.py +++ b/Lib/fontTools/ttLib/tables/C_P_A_L_.py @@ -11,7 +11,6 @@ import sys class table_C_P_A_L_(DefaultTable.DefaultTable): - NO_NAME_ID = 0xFFFF DEFAULT_PALETTE_TYPE = 0 diff --git a/Lib/fontTools/ttLib/tables/DefaultTable.py b/Lib/fontTools/ttLib/tables/DefaultTable.py index 32a4b1f25..92f2aa652 100644 --- a/Lib/fontTools/ttLib/tables/DefaultTable.py +++ b/Lib/fontTools/ttLib/tables/DefaultTable.py @@ -3,7 +3,6 @@ from fontTools.ttLib import getClassTag class DefaultTable(object): - dependencies = [] def __init__(self, tag=None): diff --git a/Lib/fontTools/ttLib/tables/E_B_D_T_.py b/Lib/fontTools/ttLib/tables/E_B_D_T_.py index 535f98fd8..9f7f82efd 100644 --- a/Lib/fontTools/ttLib/tables/E_B_D_T_.py +++ b/Lib/fontTools/ttLib/tables/E_B_D_T_.py @@ -38,7 +38,6 @@ ebdtComponentFormat = """ class table_E_B_D_T_(DefaultTable.DefaultTable): - # Keep a reference to the name of the data locator table. locatorName = "EBLC" @@ -84,7 +83,6 @@ class table_E_B_D_T_(DefaultTable.DefaultTable): bitmapGlyphDict[curName] = curGlyph def compile(self, ttFont): - dataList = [] dataList.append(sstruct.pack(ebdtTableVersionFormat, self)) dataSize = len(dataList[0]) @@ -428,7 +426,6 @@ _bitmapGlyphSubclassPrefix = "ebdt_bitmap_format_" class BitmapGlyph(object): - # For the external file format. This can be changed in subclasses. This way # when the extfile option is turned on files have the form: glyphName.ext # The default is just a flat binary file with no meaning. @@ -555,6 +552,7 @@ def _createBitmapPlusMetricsMixin(metricsClass): BitmapPlusBigMetricsMixin = _createBitmapPlusMetricsMixin(BigGlyphMetrics) BitmapPlusSmallMetricsMixin = _createBitmapPlusMetricsMixin(SmallGlyphMetrics) + # Data that is bit aligned can be tricky to deal with. These classes implement # helper functionality for dealing with the data and getting a particular row # of bitwise data. Also helps implement fancy data export/import in XML. diff --git a/Lib/fontTools/ttLib/tables/E_B_L_C_.py b/Lib/fontTools/ttLib/tables/E_B_L_C_.py index 9cc60ff82..6046d9100 100644 --- a/Lib/fontTools/ttLib/tables/E_B_L_C_.py +++ b/Lib/fontTools/ttLib/tables/E_B_L_C_.py @@ -66,7 +66,6 @@ codeOffsetPairSize = struct.calcsize(codeOffsetPairFormat) class table_E_B_L_C_(DefaultTable.DefaultTable): - dependencies = ["EBDT"] # This method can be overridden in subclasses to support new formats @@ -76,7 +75,6 @@ class table_E_B_L_C_(DefaultTable.DefaultTable): return eblc_sub_table_classes[indexFormat] def decompile(self, data, ttFont): - # Save the original data because offsets are from the start of the table. origData = data i = 0 @@ -138,7 +136,6 @@ class table_E_B_L_C_(DefaultTable.DefaultTable): curStrike.indexSubTables.append(indexSubTable) def compile(self, ttFont): - dataList = [] self.numSizes = len(self.strikes) dataList.append(sstruct.pack(eblcHeaderFormat, self)) @@ -297,7 +294,6 @@ class Strike(object): class BitmapSizeTable(object): - # Returns all the simple metric names that bitmap size table # cares about in terms of XML creation. def _getXMLMetricNames(self): @@ -476,14 +472,12 @@ class EblcIndexSubTable(object): # are very similar. The only difference between them is the size per offset # value. Code put in here should handle both cases generally. def _createOffsetArrayIndexSubTableMixin(formatStringForDataType): - # Prep the data size for the offset array data format. dataFormat = ">" + formatStringForDataType offsetDataSize = struct.calcsize(dataFormat) class OffsetArrayIndexSubTableMixin(object): def decompile(self): - numGlyphs = self.lastGlyphIndex - self.firstGlyphIndex + 1 indexingOffsets = [ glyphIndex * offsetDataSize for glyphIndex in range(numGlyphs + 2) @@ -625,7 +619,6 @@ class eblc_index_sub_table_3( class eblc_index_sub_table_4(EblcIndexSubTable): def decompile(self): - (numGlyphs,) = struct.unpack(">L", self.data[:4]) data = self.data[4:] indexingOffsets = [ diff --git a/Lib/fontTools/ttLib/tables/G_M_A_P_.py b/Lib/fontTools/ttLib/tables/G_M_A_P_.py index 39b0050c5..949ef842e 100644 --- a/Lib/fontTools/ttLib/tables/G_M_A_P_.py +++ b/Lib/fontTools/ttLib/tables/G_M_A_P_.py @@ -81,7 +81,6 @@ class GMAPRecord(object): class table_G_M_A_P_(DefaultTable.DefaultTable): - dependencies = [] def decompile(self, data, ttFont): diff --git a/Lib/fontTools/ttLib/tables/M_E_T_A_.py b/Lib/fontTools/ttLib/tables/M_E_T_A_.py index 6631e2f30..445aeb4de 100644 --- a/Lib/fontTools/ttLib/tables/M_E_T_A_.py +++ b/Lib/fontTools/ttLib/tables/M_E_T_A_.py @@ -68,7 +68,6 @@ def getLabelString(labelID): class table_M_E_T_A_(DefaultTable.DefaultTable): - dependencies = [] def decompile(self, data, ttFont): diff --git a/Lib/fontTools/ttLib/tables/S_I_N_G_.py b/Lib/fontTools/ttLib/tables/S_I_N_G_.py index 7420da7e5..4522c06c6 100644 --- a/Lib/fontTools/ttLib/tables/S_I_N_G_.py +++ b/Lib/fontTools/ttLib/tables/S_I_N_G_.py @@ -20,7 +20,6 @@ SINGFormat = """ class table_S_I_N_G_(DefaultTable.DefaultTable): - dependencies = [] def decompile(self, data, ttFont): diff --git a/Lib/fontTools/ttLib/tables/T_S_I__0.py b/Lib/fontTools/ttLib/tables/T_S_I__0.py index 4112937d4..f15fc67bc 100644 --- a/Lib/fontTools/ttLib/tables/T_S_I__0.py +++ b/Lib/fontTools/ttLib/tables/T_S_I__0.py @@ -16,7 +16,6 @@ def fixlongs(glyphID, textLength, textOffset): class table_T_S_I__0(DefaultTable.DefaultTable): - dependencies = ["TSI1"] def decompile(self, data, ttFont): diff --git a/Lib/fontTools/ttLib/tables/T_S_I__1.py b/Lib/fontTools/ttLib/tables/T_S_I__1.py index 57163d726..55aca3399 100644 --- a/Lib/fontTools/ttLib/tables/T_S_I__1.py +++ b/Lib/fontTools/ttLib/tables/T_S_I__1.py @@ -10,7 +10,6 @@ from fontTools.misc.textTools import strjoin, tobytes, tostr class table_T_S_I__1(LogMixin, DefaultTable.DefaultTable): - extras = {0xFFFA: "ppgm", 0xFFFB: "cvt", 0xFFFC: "reserved", 0xFFFD: "fpgm"} indextable = "TSI0" diff --git a/Lib/fontTools/ttLib/tables/T_S_I__2.py b/Lib/fontTools/ttLib/tables/T_S_I__2.py index 43a17f6f1..4278be155 100644 --- a/Lib/fontTools/ttLib/tables/T_S_I__2.py +++ b/Lib/fontTools/ttLib/tables/T_S_I__2.py @@ -11,5 +11,4 @@ superclass = ttLib.getTableClass("TSI0") class table_T_S_I__2(superclass): - dependencies = ["TSI3"] diff --git a/Lib/fontTools/ttLib/tables/T_S_I__3.py b/Lib/fontTools/ttLib/tables/T_S_I__3.py index 8ef3c5ade..785ca2315 100644 --- a/Lib/fontTools/ttLib/tables/T_S_I__3.py +++ b/Lib/fontTools/ttLib/tables/T_S_I__3.py @@ -9,7 +9,6 @@ superclass = ttLib.getTableClass("TSI1") class table_T_S_I__3(superclass): - extras = { 0xFFFA: "reserved0", 0xFFFB: "reserved1", diff --git a/Lib/fontTools/ttLib/tables/_c_m_a_p.py b/Lib/fontTools/ttLib/tables/_c_m_a_p.py index 6c00aaf63..484c331cb 100644 --- a/Lib/fontTools/ttLib/tables/_c_m_a_p.py +++ b/Lib/fontTools/ttLib/tables/_c_m_a_p.py @@ -1291,7 +1291,6 @@ class cmap_format_12_or_13(CmapSubtable): class cmap_format_12(cmap_format_12_or_13): - _format_step = 1 def __init__(self, format=12): @@ -1305,7 +1304,6 @@ class cmap_format_12(cmap_format_12_or_13): class cmap_format_13(cmap_format_12_or_13): - _format_step = 0 def __init__(self, format=13): diff --git a/Lib/fontTools/ttLib/tables/_h_e_a_d.py b/Lib/fontTools/ttLib/tables/_h_e_a_d.py index 04505e825..fe29c8fc4 100644 --- a/Lib/fontTools/ttLib/tables/_h_e_a_d.py +++ b/Lib/fontTools/ttLib/tables/_h_e_a_d.py @@ -37,7 +37,6 @@ headFormat = """ class table__h_e_a_d(DefaultTable.DefaultTable): - dependencies = ["maxp", "loca", "CFF ", "CFF2"] def decompile(self, data, ttFont): diff --git a/Lib/fontTools/ttLib/tables/_h_h_e_a.py b/Lib/fontTools/ttLib/tables/_h_h_e_a.py index 5500cf6a9..43e464f74 100644 --- a/Lib/fontTools/ttLib/tables/_h_h_e_a.py +++ b/Lib/fontTools/ttLib/tables/_h_h_e_a.py @@ -31,7 +31,6 @@ hheaFormat = """ class table__h_h_e_a(DefaultTable.DefaultTable): - # Note: Keep in sync with table__v_h_e_a dependencies = ["hmtx", "glyf", "CFF ", "CFF2"] diff --git a/Lib/fontTools/ttLib/tables/_h_m_t_x.py b/Lib/fontTools/ttLib/tables/_h_m_t_x.py index 2dafe617a..2dbdd7f98 100644 --- a/Lib/fontTools/ttLib/tables/_h_m_t_x.py +++ b/Lib/fontTools/ttLib/tables/_h_m_t_x.py @@ -12,7 +12,6 @@ log = logging.getLogger(__name__) class table__h_m_t_x(DefaultTable.DefaultTable): - headerTag = "hhea" advanceName = "width" sideBearingName = "lsb" diff --git a/Lib/fontTools/ttLib/tables/_k_e_r_n.py b/Lib/fontTools/ttLib/tables/_k_e_r_n.py index 94183c8a0..8f55a311c 100644 --- a/Lib/fontTools/ttLib/tables/_k_e_r_n.py +++ b/Lib/fontTools/ttLib/tables/_k_e_r_n.py @@ -101,7 +101,6 @@ class table__k_e_r_n(DefaultTable.DefaultTable): class KernTable_format_0(object): - # 'version' is kept for backward compatibility version = format = 0 diff --git a/Lib/fontTools/ttLib/tables/_l_o_c_a.py b/Lib/fontTools/ttLib/tables/_l_o_c_a.py index ad1b71513..5884cef45 100644 --- a/Lib/fontTools/ttLib/tables/_l_o_c_a.py +++ b/Lib/fontTools/ttLib/tables/_l_o_c_a.py @@ -8,7 +8,6 @@ log = logging.getLogger(__name__) class table__l_o_c_a(DefaultTable.DefaultTable): - dependencies = ["glyf"] def decompile(self, data, ttFont): diff --git a/Lib/fontTools/ttLib/tables/_m_a_x_p.py b/Lib/fontTools/ttLib/tables/_m_a_x_p.py index 293414977..f0e6c33ae 100644 --- a/Lib/fontTools/ttLib/tables/_m_a_x_p.py +++ b/Lib/fontTools/ttLib/tables/_m_a_x_p.py @@ -27,7 +27,6 @@ maxpFormat_1_0_add = """ class table__m_a_x_p(DefaultTable.DefaultTable): - dependencies = ["glyf"] def decompile(self, data, ttFont): diff --git a/Lib/fontTools/ttLib/tables/_v_h_e_a.py b/Lib/fontTools/ttLib/tables/_v_h_e_a.py index 934f2f12d..de7ce245a 100644 --- a/Lib/fontTools/ttLib/tables/_v_h_e_a.py +++ b/Lib/fontTools/ttLib/tables/_v_h_e_a.py @@ -31,7 +31,6 @@ vheaFormat = """ class table__v_h_e_a(DefaultTable.DefaultTable): - # Note: Keep in sync with table__h_h_e_a dependencies = ["vmtx", "glyf", "CFF ", "CFF2"] diff --git a/Lib/fontTools/ttLib/tables/_v_m_t_x.py b/Lib/fontTools/ttLib/tables/_v_m_t_x.py index c965c94ee..a13304c32 100644 --- a/Lib/fontTools/ttLib/tables/_v_m_t_x.py +++ b/Lib/fontTools/ttLib/tables/_v_m_t_x.py @@ -4,7 +4,6 @@ superclass = ttLib.getTableClass("hmtx") class table__v_m_t_x(superclass): - headerTag = "vhea" advanceName = "height" sideBearingName = "tsb" diff --git a/Lib/fontTools/ttLib/tables/otTables.py b/Lib/fontTools/ttLib/tables/otTables.py index 947087344..262f8d418 100644 --- a/Lib/fontTools/ttLib/tables/otTables.py +++ b/Lib/fontTools/ttLib/tables/otTables.py @@ -538,7 +538,6 @@ class FeatureParamsCharacterVariants(FeatureParams): class Coverage(FormatSwitchingBaseTable): - # manual implementation to get rid of glyphID dependencies def populateDefaults(self, propagator=None): diff --git a/Lib/fontTools/ttLib/ttCollection.py b/Lib/fontTools/ttLib/ttCollection.py index 3ab579ee0..70ed4b7a0 100644 --- a/Lib/fontTools/ttLib/ttCollection.py +++ b/Lib/fontTools/ttLib/ttCollection.py @@ -87,7 +87,6 @@ class TTCollection(object): file.close() def saveXML(self, fileOrPath, newlinestr="\n", writeVersion=True, **kwargs): - from fontTools.misc import xmlWriter writer = xmlWriter.XMLWriter(fileOrPath, newlinestr=newlinestr) diff --git a/Lib/fontTools/ttLib/ttFont.py b/Lib/fontTools/ttLib/ttFont.py index 1bece8e5e..6a9ca0982 100644 --- a/Lib/fontTools/ttLib/ttFont.py +++ b/Lib/fontTools/ttLib/ttFont.py @@ -287,7 +287,6 @@ class TTFont(object): disassembleInstructions=True, bitmapGlyphDataFormat="raw", ): - if quiet is not None: deprecateArgument("quiet", "configure logging instead") diff --git a/Lib/fontTools/ttLib/ttGlyphSet.py b/Lib/fontTools/ttLib/ttGlyphSet.py index fa7fbd4f2..d4384c89f 100644 --- a/Lib/fontTools/ttLib/ttGlyphSet.py +++ b/Lib/fontTools/ttLib/ttGlyphSet.py @@ -170,7 +170,6 @@ class _TTGlyphGlyf(_TTGlyph): glyph, offset = self._getGlyphAndOffset() with self.glyphSet.pushDepth() as depth: - if depth: offset = 0 # Offset should only apply at top-level @@ -187,7 +186,6 @@ class _TTGlyphGlyf(_TTGlyph): glyph, offset = self._getGlyphAndOffset() with self.glyphSet.pushDepth() as depth: - if depth: offset = 0 # Offset should only apply at top-level @@ -198,14 +196,12 @@ class _TTGlyphGlyf(_TTGlyph): glyph.drawPoints(pen, self.glyphSet.glyfTable, offset) def _drawVarComposite(self, glyph, pen, isPointPen): - from fontTools.ttLib.tables._g_l_y_f import ( VarComponentFlags, VAR_COMPONENT_TRANSFORM_MAPPING, ) for comp in glyph.components: - with self.glyphSet.pushLocation( comp.location, comp.flags & VarComponentFlags.RESET_UNSPECIFIED_AXES ): diff --git a/Lib/fontTools/ttLib/woff2.py b/Lib/fontTools/ttLib/woff2.py index 3e247b02e..9da2f7e6d 100644 --- a/Lib/fontTools/ttLib/woff2.py +++ b/Lib/fontTools/ttLib/woff2.py @@ -42,7 +42,6 @@ except ImportError: class WOFF2Reader(SFNTReader): - flavor = "woff2" def __init__(self, file, checkChecksums=0, fontNumber=-1): @@ -177,7 +176,6 @@ class WOFF2Reader(SFNTReader): class WOFF2Writer(SFNTWriter): - flavor = "woff2" def __init__( @@ -1291,7 +1289,6 @@ class WOFF2HmtxTable(getTableClass("hmtx")): class WOFF2FlavorData(WOFFFlavorData): - Flavor = "woff2" def __init__(self, reader=None, data=None, transformedTables=None): diff --git a/Lib/fontTools/ttx.py b/Lib/fontTools/ttx.py index 65a3c7a80..d8c2a3a75 100644 --- a/Lib/fontTools/ttx.py +++ b/Lib/fontTools/ttx.py @@ -124,7 +124,6 @@ opentypeheaderRE = re.compile("""sfntVersion=['"]OTTO["']""") class Options(object): - listTables = False outputDir = None outputFile = None diff --git a/Lib/fontTools/varLib/models.py b/Lib/fontTools/varLib/models.py index 954cf87bf..5bd66dba1 100644 --- a/Lib/fontTools/varLib/models.py +++ b/Lib/fontTools/varLib/models.py @@ -248,7 +248,6 @@ class VariationModel(object): """ def __init__(self, locations, axisOrder=None, extrapolate=False): - if len(set(tuple(sorted(l.items())) for l in locations)) != len(locations): raise VariationModelError("Locations must be unique.") diff --git a/MetaTools/buildTableList.py b/MetaTools/buildTableList.py index 76c336f4a..c0a6453ea 100755 --- a/MetaTools/buildTableList.py +++ b/MetaTools/buildTableList.py @@ -30,7 +30,6 @@ tables.sort() with open(os.path.join(tablesDir, "__init__.py"), "w") as file: - file.write( ''' # DON'T EDIT! This file is generated by MetaTools/buildTableList.py. diff --git a/Snippets/interpolate.py b/Snippets/interpolate.py index 432380118..89300095a 100755 --- a/Snippets/interpolate.py +++ b/Snippets/interpolate.py @@ -85,7 +85,7 @@ def AddGlyphVariations(font, thin, regular, black): continue thinDelta = [] blackDelta = [] - for ((regX, regY), (blackX, blackY), (thinX, thinY)) in zip( + for (regX, regY), (blackX, blackY), (thinX, thinY) in zip( regularCoord, blackCoord, thinCoord ): thinDelta.append(((thinX - regX, thinY - regY))) diff --git a/Snippets/print-json.py b/Snippets/print-json.py index bcd255ee3..18d44c0ad 100644 --- a/Snippets/print-json.py +++ b/Snippets/print-json.py @@ -139,7 +139,6 @@ def visit(self, obj): if __name__ == "__main__": - from fontTools.ttLib import TTFont import sys diff --git a/Tests/misc/encodingTools_test.py b/Tests/misc/encodingTools_test.py index 80859cf64..7c4e14359 100644 --- a/Tests/misc/encodingTools_test.py +++ b/Tests/misc/encodingTools_test.py @@ -4,7 +4,6 @@ from fontTools.misc.encodingTools import getEncoding class EncodingTest(unittest.TestCase): def test_encoding_unicode(self): - self.assertEqual( getEncoding(3, 0, None), "utf_16_be" ) # MS Symbol is Unicode as well diff --git a/Tests/misc/psCharStrings_test.py b/Tests/misc/psCharStrings_test.py index 35aa4949b..5eb2f774b 100644 --- a/Tests/misc/psCharStrings_test.py +++ b/Tests/misc/psCharStrings_test.py @@ -120,7 +120,7 @@ class T2CharStringTest(unittest.TestCase): (-456.8, "ff fe 37 33 33", -456.8000031), ] - for (value, expected_hex, expected_float) in testNums: + for value, expected_hex, expected_float in testNums: encoded_result = encodeFixed(value) # check to see if we got the expected bytes diff --git a/Tests/misc/py23_test.py b/Tests/misc/py23_test.py index 1a0e1396d..30382455b 100644 --- a/Tests/misc/py23_test.py +++ b/Tests/misc/py23_test.py @@ -394,7 +394,6 @@ class IsCloseTests(unittest.TestCase): class TestRedirectStream: - redirect_stream = None orig_stream = None @@ -444,13 +443,11 @@ class TestRedirectStream: class TestRedirectStdout(TestRedirectStream, unittest.TestCase): - redirect_stream = redirect_stdout orig_stream = "stdout" class TestRedirectStderr(TestRedirectStream, unittest.TestCase): - redirect_stream = redirect_stderr orig_stream = "stderr" diff --git a/Tests/mtiLib/mti_test.py b/Tests/mtiLib/mti_test.py index f9008b060..a4cc098ca 100644 --- a/Tests/mtiLib/mti_test.py +++ b/Tests/mtiLib/mti_test.py @@ -15,7 +15,6 @@ def set_lookup_debug_env_var(monkeypatch): class MtiTest: - GLYPH_ORDER = [ ".notdef", "a", @@ -425,7 +424,6 @@ class MtiTest: return font def check_mti_file(self, name, tableTag=None): - xml_expected_path = self.getpath( "%s.ttx" % name + ("." + tableTag if tableTag is not None else "") ) diff --git a/Tests/pens/cu2quPen_test.py b/Tests/pens/cu2quPen_test.py index 7082d5dc8..779254c3f 100644 --- a/Tests/pens/cu2quPen_test.py +++ b/Tests/pens/cu2quPen_test.py @@ -339,7 +339,6 @@ pen.endPath()""".splitlines(), class TestCu2QuMultiPen(unittest.TestCase): def test_multi_pen(self): - pens = [RecordingPen(), RecordingPen()] pen = Cu2QuMultiPen(pens, 0.1) pen.moveTo([((0, 0),), ((0, 0),)]) diff --git a/Tests/pens/ttGlyphPen_test.py b/Tests/pens/ttGlyphPen_test.py index 376b75eb3..6a74cb25a 100644 --- a/Tests/pens/ttGlyphPen_test.py +++ b/Tests/pens/ttGlyphPen_test.py @@ -615,11 +615,9 @@ class CubicGlyfTest: ppen.endPath() for pen in (spen, ppen): - glyph = pen.glyph() for i in range(2): - if i == 1: glyph.compile(None) @@ -797,7 +795,6 @@ class CubicGlyfTest: rpen.replay(ppen) for pen in (spen, ppen): - glyph = pen.glyph(dropImpliedOnCurves=dropImpliedOnCurves) assert list(glyph.coordinates) == expected_coordinates diff --git a/Tests/qu2cu/qu2cu_test.py b/Tests/qu2cu/qu2cu_test.py index fae240cc9..3ca7ab559 100644 --- a/Tests/qu2cu/qu2cu_test.py +++ b/Tests/qu2cu/qu2cu_test.py @@ -75,7 +75,6 @@ class Qu2CuTest: ], ) def test_simple(self, quadratics, expected, tolerance, cubic_only): - expected = [ tuple((pytest.approx(p[0]), pytest.approx(p[1])) for p in curve) for curve in expected @@ -85,7 +84,6 @@ class Qu2CuTest: assert c == expected def test_roundtrip(self): - DATADIR = os.path.join(os.path.dirname(__file__), "..", "cu2qu", "data") with open(os.path.join(DATADIR, "curves.json"), "r") as fp: curves = json.load(fp) diff --git a/Tests/ttLib/scaleUpem_test.py b/Tests/ttLib/scaleUpem_test.py index 0e9631663..6024758f3 100644 --- a/Tests/ttLib/scaleUpem_test.py +++ b/Tests/ttLib/scaleUpem_test.py @@ -56,7 +56,6 @@ class ScaleUpemTest(unittest.TestCase): self.fail("TTX output is different from expected") def test_scale_upem_ttf(self): - font = TTFont(self.get_path("I.ttf")) tables = [table_tag for table_tag in font.keys() if table_tag != "head"] @@ -66,7 +65,6 @@ class ScaleUpemTest(unittest.TestCase): self.expect_ttx(font, expected_ttx_path, tables) def test_scale_upem_varComposite(self): - font = TTFont(self.get_path("varc-ac00-ac01.ttf")) tables = [table_tag for table_tag in font.keys() if table_tag != "head"] @@ -80,7 +78,6 @@ class ScaleUpemTest(unittest.TestCase): scale_upem(font, 500) def test_scale_upem_otf(self): - # Just test that it doesn't crash font = TTFont(self.get_path("TestVGID-Regular.otf")) diff --git a/Tests/ttLib/tables/_a_v_a_r_test.py b/Tests/ttLib/tables/_a_v_a_r_test.py index 6ae8d0a9e..dbe07b3a5 100644 --- a/Tests/ttLib/tables/_a_v_a_r_test.py +++ b/Tests/ttLib/tables/_a_v_a_r_test.py @@ -101,7 +101,6 @@ class AxisVariationTableTest(unittest.TestCase): class Avar2Test(unittest.TestCase): def test(self): - axisTags = ["wght", "wdth"] fvar = table__f_v_a_r() for tag in axisTags: diff --git a/Tests/ttLib/tables/_c_v_a_r_test.py b/Tests/ttLib/tables/_c_v_a_r_test.py index 0281d4bdc..c6fe0113e 100644 --- a/Tests/ttLib/tables/_c_v_a_r_test.py +++ b/Tests/ttLib/tables/_c_v_a_r_test.py @@ -62,7 +62,7 @@ CVAR_VARIATIONS = [ class CVARTableTest(unittest.TestCase): def assertVariationsAlmostEqual(self, variations1, variations2): self.assertEqual(len(variations1), len(variations2)) - for (v1, v2) in zip(variations1, variations2): + for v1, v2 in zip(variations1, variations2): self.assertSetEqual(set(v1.axes), set(v2.axes)) for axisTag, support1 in v1.axes.items(): support2 = v2.axes[axisTag] diff --git a/Tests/ttLib/tables/_g_v_a_r_test.py b/Tests/ttLib/tables/_g_v_a_r_test.py index 0aa7f352a..4fe3ae968 100644 --- a/Tests/ttLib/tables/_g_v_a_r_test.py +++ b/Tests/ttLib/tables/_g_v_a_r_test.py @@ -137,7 +137,7 @@ class GVARTableTest(unittest.TestCase): for glyphName, variations1 in vars1.items(): variations2 = vars2[glyphName] self.assertEqual(len(variations1), len(variations2)) - for (v1, v2) in zip(variations1, variations2): + for v1, v2 in zip(variations1, variations2): self.assertSetEqual(set(v1.axes), set(v2.axes)) for axisTag, support1 in v1.axes.items(): support2 = v2.axes[axisTag] diff --git a/Tests/ttLib/tables/_l_t_a_g_test.py b/Tests/ttLib/tables/_l_t_a_g_test.py index 4ad35416f..aa73cde65 100644 --- a/Tests/ttLib/tables/_l_t_a_g_test.py +++ b/Tests/ttLib/tables/_l_t_a_g_test.py @@ -7,7 +7,6 @@ from fontTools.ttLib import newTable class Test_l_t_a_g(unittest.TestCase): - DATA_ = ( struct.pack(b">LLLHHHHHH", 1, 0, 3, 24 + 0, 2, 24 + 2, 7, 24 + 2, 2) + b"enzh-Hant" diff --git a/Tests/ttLib/ttVisitor_test.py b/Tests/ttLib/ttVisitor_test.py index 65d65d7db..1c4293433 100644 --- a/Tests/ttLib/ttVisitor_test.py +++ b/Tests/ttLib/ttVisitor_test.py @@ -27,7 +27,6 @@ class TTVisitorTest(object): return os.path.join(path, "data", testfile) def test_ttvisitor(self): - font = TTFont(self.getpath("TestVGID-Regular.otf")) visitor = TestVisitor() diff --git a/Tests/ufoLib/UFO3_test.py b/Tests/ufoLib/UFO3_test.py index 026e85e9c..95a51c4df 100644 --- a/Tests/ufoLib/UFO3_test.py +++ b/Tests/ufoLib/UFO3_test.py @@ -4712,7 +4712,6 @@ class UFO3WriteDataTestCase(unittest.TestCase): class TestLayerInfoObject: - color = guidelines = lib = None diff --git a/Tests/ufoLib/UFOConversion_test.py b/Tests/ufoLib/UFOConversion_test.py index 82f7858e4..5519cef6c 100644 --- a/Tests/ufoLib/UFOConversion_test.py +++ b/Tests/ufoLib/UFOConversion_test.py @@ -125,7 +125,6 @@ class TestInfoObject: class KerningUpConversionTestCase(unittest.TestCase): - expectedKerning = { ("public.kern1.BGroup", "public.kern2.CGroup"): 7, ("public.kern1.BGroup", "public.kern2.DGroup"): 8, @@ -239,7 +238,6 @@ class KerningUpConversionTestCase(unittest.TestCase): class KerningDownConversionTestCase(unittest.TestCase): - expectedKerning = { ("public.kern1.BGroup", "public.kern2.CGroup"): 7, ("public.kern1.BGroup", "public.kern2.DGroup"): 8, diff --git a/Tests/varLib/featureVars_test.py b/Tests/varLib/featureVars_test.py index 93fb6c06d..7a3a6650d 100644 --- a/Tests/varLib/featureVars_test.py +++ b/Tests/varLib/featureVars_test.py @@ -111,7 +111,6 @@ def test_overlayBox(): def run(test, n, quiet): - print() print("%s:" % test.__name__) input, output = test(n) diff --git a/Tests/varLib/iup_test.py b/Tests/varLib/iup_test.py index 75782a029..36f63e0e7 100644 --- a/Tests/varLib/iup_test.py +++ b/Tests/varLib/iup_test.py @@ -4,7 +4,6 @@ import pytest class IupTest: - # ----- # Tests # -----