Browse Source

Intermediate changes

robot-piglet 1 year ago
parent
commit
7732db443b

+ 2 - 9
contrib/python/appnope/py3/.dist-info/METADATA

@@ -1,20 +1,15 @@
 Metadata-Version: 2.1
 Name: appnope
-Version: 0.1.3
+Version: 0.1.4
 Summary: Disable App Nap on macOS >= 10.9
 Home-page: http://github.com/minrk/appnope
 Author: Min Ragan-Kelley
 Author-email: benjaminrk@gmail.com
 License: BSD
-Platform: UNKNOWN
 Classifier: License :: OSI Approved :: BSD License
 Classifier: Operating System :: MacOS :: MacOS X
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.6
-Classifier: Programming Language :: Python :: 2.7
 Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.2
-Classifier: Programming Language :: Python :: 3.3
+Requires-Python: >=3.6
 Description-Content-Type: text/markdown
 License-File: LICENSE
 
@@ -48,5 +43,3 @@ It uses ctypes to wrap a `[NSProcessInfo beginActivityWithOptions]` call to disa
 To install:
 
     pip install appnope
-
-

+ 6 - 4
contrib/python/appnope/py3/appnope/__init__.py

@@ -1,13 +1,15 @@
-__version__ = '0.1.3'
+__version__ = "0.1.4"
 
 import re
 import sys
 import platform
 
+
 def _v(version_s):
-    return tuple(int(s) for s in re.findall("\d+", version_s))
+    return tuple(int(s) for s in re.findall(r"\d+", version_s))
+
 
 if sys.platform != "darwin" or _v(platform.mac_ver()[0]) < _v("10.9"):
-    from ._dummy import *
+    from ._dummy import *  # noqa
 else:
-    from ._nope import *
+    from ._nope import *  # noqa

+ 9 - 7
contrib/python/appnope/py3/appnope/_dummy.py

@@ -1,30 +1,32 @@
-#-----------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
 #  Copyright (C) 2013 Min RK
 #
 #  Distributed under the terms of the 2-clause BSD License.
-#-----------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
 
 from contextlib import contextmanager
 
+
 def beginActivityWithOptions(options, reason=""):
     return
 
+
 def endActivity(activity):
     return
 
+
 def nope():
     return
 
+
 def nap():
     return
 
 
 @contextmanager
-def nope_scope(
-        options=0,
-        reason="Because Reasons"
-    ):
+def nope_scope(options=0, reason="Because Reasons"):
     yield
 
+
 def napping_allowed():
-    return True
+    return True

+ 41 - 31
contrib/python/appnope/py3/appnope/_nope.py

@@ -1,16 +1,16 @@
-#-----------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
 #  Copyright (C) 2013 Min RK
 #
 #  Distributed under the terms of the 2-clause BSD License.
-#-----------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
 
 from contextlib import contextmanager
 
 import ctypes
 import ctypes.util
 
-objc = ctypes.cdll.LoadLibrary(ctypes.util.find_library('objc'))
-_ = ctypes.cdll.LoadLibrary(ctypes.util.find_library('Foundation'))
+objc = ctypes.cdll.LoadLibrary(ctypes.util.find_library("objc"))
+_ = ctypes.cdll.LoadLibrary(ctypes.util.find_library("Foundation"))
 
 void_p = ctypes.c_void_p
 ull = ctypes.c_uint64
@@ -22,74 +22,82 @@ objc.objc_msgSend.argtypes = [void_p, void_p]
 
 msg = objc.objc_msgSend
 
+
 def _utf8(s):
     """ensure utf8 bytes"""
     if not isinstance(s, bytes):
-        s = s.encode('utf8')
+        s = s.encode("utf8")
     return s
 
+
 def n(name):
     """create a selector name (for methods)"""
     return objc.sel_registerName(_utf8(name))
 
+
 def C(classname):
     """get an ObjC Class by name"""
     ret = objc.objc_getClass(_utf8(classname))
     assert ret is not None, "Couldn't find Class %s" % classname
     return ret
 
+
 # constants from Foundation
 
-NSActivityIdleDisplaySleepDisabled             = (1 << 40)
-NSActivityIdleSystemSleepDisabled              = (1 << 20)
-NSActivitySuddenTerminationDisabled            = (1 << 14)
-NSActivityAutomaticTerminationDisabled         = (1 << 15)
-NSActivityUserInitiated                        = (0x00FFFFFF | NSActivityIdleSystemSleepDisabled)
-NSActivityUserInitiatedAllowingIdleSystemSleep = (NSActivityUserInitiated & ~NSActivityIdleSystemSleepDisabled)
-NSActivityBackground                           = 0x000000FF
-NSActivityLatencyCritical                      = 0xFF00000000
+NSActivityIdleDisplaySleepDisabled = 1 << 40
+NSActivityIdleSystemSleepDisabled = 1 << 20
+NSActivitySuddenTerminationDisabled = 1 << 14
+NSActivityAutomaticTerminationDisabled = 1 << 15
+NSActivityUserInitiated = 0x00FFFFFF | NSActivityIdleSystemSleepDisabled
+NSActivityUserInitiatedAllowingIdleSystemSleep = (
+    NSActivityUserInitiated & ~NSActivityIdleSystemSleepDisabled
+)
+NSActivityBackground = 0x000000FF
+NSActivityLatencyCritical = 0xFF00000000
+
 
 def beginActivityWithOptions(options, reason=""):
     """Wrapper for:
-    
-    [ [ NSProcessInfo processInfo] 
+
+    [ [ NSProcessInfo processInfo]
         beginActivityWithOptions: (uint64)options
                           reason: (str)reason
     ]
     """
-    NSProcessInfo = C('NSProcessInfo')
-    NSString = C('NSString')
-    
+    NSProcessInfo = C("NSProcessInfo")
+    NSString = C("NSString")
+
     objc.objc_msgSend.argtypes = [void_p, void_p, void_p]
     reason = msg(NSString, n("stringWithUTF8String:"), _utf8(reason))
     objc.objc_msgSend.argtypes = [void_p, void_p]
-    info = msg(NSProcessInfo, n('processInfo'))
+    info = msg(NSProcessInfo, n("processInfo"))
     objc.objc_msgSend.argtypes = [void_p, void_p, ull, void_p]
-    activity = msg(info,
-        n('beginActivityWithOptions:reason:'),
-        ull(options),
-        void_p(reason)
+    activity = msg(
+        info, n("beginActivityWithOptions:reason:"), ull(options), void_p(reason)
     )
     return activity
 
+
 def endActivity(activity):
     """end a process activity assertion"""
-    NSProcessInfo = C('NSProcessInfo')
+    NSProcessInfo = C("NSProcessInfo")
     objc.objc_msgSend.argtypes = [void_p, void_p]
-    info = msg(NSProcessInfo, n('processInfo'))
+    info = msg(NSProcessInfo, n("processInfo"))
     objc.objc_msgSend.argtypes = [void_p, void_p, void_p]
     msg(info, n("endActivity:"), void_p(activity))
 
+
 _theactivity = None
 
+
 def nope():
     """disable App Nap by setting NSActivityUserInitiatedAllowingIdleSystemSleep"""
     global _theactivity
     _theactivity = beginActivityWithOptions(
-        NSActivityUserInitiatedAllowingIdleSystemSleep,
-        "Because Reasons"
+        NSActivityUserInitiatedAllowingIdleSystemSleep, "Because Reasons"
     )
 
+
 def nap():
     """end the caffeinated state started by `nope`"""
     global _theactivity
@@ -97,17 +105,18 @@ def nap():
         endActivity(_theactivity)
         _theactivity = None
 
+
 def napping_allowed():
     """is napping allowed?"""
     return _theactivity is None
 
+
 @contextmanager
 def nope_scope(
-        options=NSActivityUserInitiatedAllowingIdleSystemSleep,
-        reason="Because Reasons"
-    ):
+    options=NSActivityUserInitiatedAllowingIdleSystemSleep, reason="Because Reasons"
+):
     """context manager for beginActivityWithOptions.
-    
+
     Within this context, App Nap will be disabled.
     """
     activity = beginActivityWithOptions(options, reason)
@@ -116,6 +125,7 @@ def nope_scope(
     finally:
         endActivity(activity)
 
+
 __all__ = [
     "NSActivityIdleDisplaySleepDisabled",
     "NSActivityIdleSystemSleepDisabled",

+ 1 - 1
contrib/python/appnope/py3/ya.make

@@ -2,7 +2,7 @@
 
 PY3_LIBRARY()
 
-VERSION(0.1.3)
+VERSION(0.1.4)
 
 LICENSE(BSD-2-Clause)
 

+ 30 - 4
contrib/python/fonttools/.dist-info/METADATA

@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: fonttools
-Version: 4.47.2
+Version: 4.48.1
 Summary: Tools to manipulate font files
 Home-page: http://github.com/fonttools/fonttools
 Author: Just van Rossum
@@ -31,7 +31,7 @@ Requires-Python: >=3.8
 License-File: LICENSE
 Provides-Extra: all
 Requires-Dist: fs <3,>=2.2.0 ; extra == 'all'
-Requires-Dist: lxml <5,>=4.0 ; extra == 'all'
+Requires-Dist: lxml >=4.0 ; extra == 'all'
 Requires-Dist: zopfli >=0.1.4 ; extra == 'all'
 Requires-Dist: lz4 >=1.7.4.2 ; extra == 'all'
 Requires-Dist: pycairo ; extra == 'all'
@@ -52,7 +52,7 @@ Requires-Dist: pycairo ; extra == 'interpolatable'
 Requires-Dist: scipy ; (platform_python_implementation != "PyPy") and extra == 'interpolatable'
 Requires-Dist: munkres ; (platform_python_implementation == "PyPy") and extra == 'interpolatable'
 Provides-Extra: lxml
-Requires-Dist: lxml <5,>=4.0 ; extra == 'lxml'
+Requires-Dist: lxml >=4.0 ; extra == 'lxml'
 Provides-Extra: pathops
 Requires-Dist: skia-pathops >=0.5.0 ; extra == 'pathops'
 Provides-Extra: plot
@@ -118,7 +118,7 @@ Python 3 `venv <https://docs.python.org/3/library/venv.html>`__ module.
     # create new virtual environment called e.g. 'fonttools-venv', or anything you like
     python -m virtualenv fonttools-venv
 
-    # source the `activate` shell script to enter the environment (Un*x); to exit, just type `deactivate`
+    # source the `activate` shell script to enter the environment (Unix-like); to exit, just type `deactivate`
     . fonttools-venv/bin/activate
 
     # to activate the virtual environment in Windows `cmd.exe`, do
@@ -375,6 +375,32 @@ Have fun!
 Changelog
 ~~~~~~~~~
 
+4.48.1 (released 2024-02-06)
+----------------------------
+
+- Fixed uploading wheels to PyPI, no code changes since v4.48.0.
+
+4.48.0 (released 2024-02-06)
+----------------------------
+
+- [varLib] Do not log when there are no OTL tables to be merged.
+- [setup.py] Do not restrict lxml<5 any more, tests pass just fine with lxml>=5.
+- [feaLib] Remove glyph and class names length restrictions in FEA (#3424).
+- [roundingPens] Added ``transformRoundFunc`` parameter to the rounding pens to allow
+  for custom rounding of the components' transforms (#3426).
+- [feaLib] Keep declaration order of ligature components within a ligature set, instead
+  of sorting by glyph name (#3429).
+- [feaLib] Fixed ordering of alternates in ``aalt`` lookups, following the declaration
+  order of feature references within the ``aalt`` feature block (#3430).
+- [varLib.instancer] Fixed a bug in the instancer's IUP optimization (#3432).
+- [sbix] Support sbix glyphs with new graphicType "flip" (#3433).
+- [svgPathPen] Added ``--glyphs`` option to dump the SVG paths for the named glyphs
+  in the font (0572f78).
+- [designspaceLib] Added "description" attribute to ``<mappings>`` and ``<mapping>``
+  elements, and allow multiple ``<mappings>`` elements to group ``<mapping>`` elements
+  that are logically related (#3435, #3437).
+- [otlLib] Correctly choose the most compact GSUB contextual lookup format (#3439).
+
 4.47.2 (released 2024-01-11)
 ----------------------------
 

+ 1 - 1
contrib/python/fonttools/README.rst

@@ -44,7 +44,7 @@ Python 3 `venv <https://docs.python.org/3/library/venv.html>`__ module.
     # create new virtual environment called e.g. 'fonttools-venv', or anything you like
     python -m virtualenv fonttools-venv
 
-    # source the `activate` shell script to enter the environment (Un*x); to exit, just type `deactivate`
+    # source the `activate` shell script to enter the environment (Unix-like); to exit, just type `deactivate`
     . fonttools-venv/bin/activate
 
     # to activate the virtual environment in Windows `cmd.exe`, do

+ 1 - 1
contrib/python/fonttools/fontTools/__init__.py

@@ -3,6 +3,6 @@ from fontTools.misc.loggingTools import configLogger
 
 log = logging.getLogger(__name__)
 
-version = __version__ = "4.47.2"
+version = __version__ = "4.48.1"
 
 __all__ = ["version", "log", "configLogger"]

+ 62 - 6
contrib/python/fonttools/fontTools/designspaceLib/__init__.py

@@ -476,7 +476,14 @@ class AxisMappingDescriptor(SimpleDescriptor):
 
     _attrs = ["inputLocation", "outputLocation"]
 
-    def __init__(self, *, inputLocation=None, outputLocation=None):
+    def __init__(
+        self,
+        *,
+        inputLocation=None,
+        outputLocation=None,
+        description=None,
+        groupDescription=None,
+    ):
         self.inputLocation: SimpleLocationDict = inputLocation or {}
         """dict. Axis values for the input of the mapping, in design space coordinates.
 
@@ -491,6 +498,20 @@ class AxisMappingDescriptor(SimpleDescriptor):
 
         .. versionadded:: 5.1
         """
+        self.description = description
+        """string. A description of the mapping.
+
+        varLib.
+
+        .. versionadded:: 5.2
+        """
+        self.groupDescription = groupDescription
+        """string. A description of the group of mappings.
+
+        varLib.
+
+        .. versionadded:: 5.2
+        """
 
 
 class InstanceDescriptor(SimpleDescriptor):
@@ -1421,10 +1442,19 @@ class BaseDocWriter(object):
             self._addAxis(axisObject)
 
         if self.documentObject.axisMappings:
-            mappingsElement = ET.Element("mappings")
-            self.root.findall(".axes")[0].append(mappingsElement)
+            mappingsElement = None
+            lastGroup = object()
             for mappingObject in self.documentObject.axisMappings:
+                if getattr(mappingObject, "groupDescription", None) != lastGroup:
+                    if mappingsElement is not None:
+                        self.root.findall(".axes")[0].append(mappingsElement)
+                    lastGroup = getattr(mappingObject, "groupDescription", None)
+                    mappingsElement = ET.Element("mappings")
+                    if lastGroup is not None:
+                        mappingsElement.attrib["description"] = lastGroup
                 self._addAxisMapping(mappingsElement, mappingObject)
+            if mappingsElement is not None:
+                self.root.findall(".axes")[0].append(mappingsElement)
 
         if self.documentObject.locationLabels:
             labelsElement = ET.Element("labels")
@@ -1586,6 +1616,8 @@ class BaseDocWriter(object):
 
     def _addAxisMapping(self, mappingsElement, mappingObject):
         mappingElement = ET.Element("mapping")
+        if getattr(mappingObject, "description", None) is not None:
+            mappingElement.attrib["description"] = mappingObject.description
         for what in ("inputLocation", "outputLocation"):
             whatObject = getattr(mappingObject, what, None)
             if whatObject is None:
@@ -2081,10 +2113,11 @@ class BaseDocReader(LogMixin):
             self.documentObject.axes.append(axisObject)
             self.axisDefaults[axisObject.name] = axisObject.default
 
-        mappingsElement = self.root.find(".axes/mappings")
         self.documentObject.axisMappings = []
-        if mappingsElement is not None:
+        for mappingsElement in self.root.findall(".axes/mappings"):
+            groupDescription = mappingsElement.attrib.get("description")
             for mappingElement in mappingsElement.findall("mapping"):
+                description = mappingElement.attrib.get("description")
                 inputElement = mappingElement.find("input")
                 outputElement = mappingElement.find("output")
                 inputLoc = {}
@@ -2098,7 +2131,10 @@ class BaseDocReader(LogMixin):
                     value = float(dimElement.attrib["xvalue"])
                     outputLoc[name] = value
                 axisMappingObject = self.axisMappingDescriptorClass(
-                    inputLocation=inputLoc, outputLocation=outputLoc
+                    inputLocation=inputLoc,
+                    outputLocation=outputLoc,
+                    description=description,
+                    groupDescription=groupDescription,
                 )
                 self.documentObject.axisMappings.append(axisMappingObject)
 
@@ -3279,3 +3315,23 @@ class DesignSpaceDocument(LogMixin, AsDictMixin):
         finally:
             for source, font in zip(self.sources, fonts):
                 source.font = font
+
+
+def main(args=None):
+    """Roundtrip .designspace file through the DesignSpaceDocument class"""
+
+    if args is None:
+        import sys
+
+        args = sys.argv[1:]
+
+    from argparse import ArgumentParser
+
+    parser = ArgumentParser(prog="designspaceLib", description=main.__doc__)
+    parser.add_argument("input")
+    parser.add_argument("output")
+
+    options = parser.parse_args(args)
+
+    ds = DesignSpaceDocument.fromfile(options.input)
+    ds.write(options.output)

+ 6 - 0
contrib/python/fonttools/fontTools/designspaceLib/__main__.py

@@ -0,0 +1,6 @@
+import sys
+from fontTools.designspaceLib import main
+
+
+if __name__ == "__main__":
+    sys.exit(main())

Some files were not shown because too many files changed in this diff