Hello community,

here is the log from the commit of package kitty for openSUSE:Factory checked 
in at 2020-06-24 15:49:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kitty (Old)
 and      /work/SRC/openSUSE:Factory/.kitty.new.2956 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kitty"

Wed Jun 24 15:49:51 2020 rev:13 rq:816793 version:0.18.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/kitty/kitty.changes      2020-06-22 
17:46:11.641901242 +0200
+++ /work/SRC/openSUSE:Factory/.kitty.new.2956/kitty.changes    2020-06-24 
15:50:29.792803646 +0200
@@ -1,0 +2,6 @@
+Wed Jun 24 07:47:56 UTC 2020 - Michael Vetter <[email protected]>
+
+- Update to 0.18.1:
+  * macOS: Fix for diff kitten not working with python 3.8 (#2780)
+
+-------------------------------------------------------------------

Old:
----
  kitty-0.18.0.tar.gz

New:
----
  kitty-0.18.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kitty.spec ++++++
--- /var/tmp/diff_new_pack.V39hBU/_old  2020-06-24 15:50:31.016808253 +0200
+++ /var/tmp/diff_new_pack.V39hBU/_new  2020-06-24 15:50:31.020808267 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           kitty
-Version:        0.18.0
+Version:        0.18.1
 Release:        0
 Summary:        A GPU-based terminal emulator
 License:        GPL-3.0-only

++++++ kitty-0.18.0.tar.gz -> kitty-0.18.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitty-0.18.0/bypy/rsync.conf 
new/kitty-0.18.1/bypy/rsync.conf
--- old/kitty-0.18.0/bypy/rsync.conf    2020-06-20 09:18:59.000000000 +0200
+++ new/kitty-0.18.1/bypy/rsync.conf    2020-06-23 14:07:04.000000000 +0200
@@ -1 +1 @@
-to_vm_excludes '/build /dist /.build-cache /tags __pycache__ /*_commands.json 
*.so *.pyd *.pyc'
+to_vm_excludes '/build /dist /kitty/launcher/kitty /.build-cache /tags 
__pycache__ /*_commands.json *.so *.pyd *.pyc'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitty-0.18.0/docs/changelog.rst 
new/kitty-0.18.1/docs/changelog.rst
--- old/kitty-0.18.0/docs/changelog.rst 2020-06-20 09:18:59.000000000 +0200
+++ new/kitty-0.18.1/docs/changelog.rst 2020-06-23 14:07:04.000000000 +0200
@@ -4,6 +4,12 @@
 |kitty| is a feature full, cross-platform, *fast*, GPU based terminal emulator.
 To update |kitty|, :doc:`follow the instructions <binary>`.
 
+0.18.1 [2020-06-23]
+--------------------
+
+- macOS: Fix for diff kitten not working with python 3.8 (:iss:`2780`)
+
+
 0.18.0 [2020-06-20]
 --------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitty-0.18.0/glfw/glfw3.h 
new/kitty-0.18.1/glfw/glfw3.h
--- old/kitty-0.18.0/glfw/glfw3.h       2020-06-20 09:18:59.000000000 +0200
+++ new/kitty-0.18.1/glfw/glfw3.h       2020-06-23 14:07:04.000000000 +0200
@@ -195,6 +195,22 @@
 
  #endif /*__APPLE__*/
 
+#elif defined(GLFW_INCLUDE_GLU)
+
+ #if defined(__APPLE__)
+
+  #if defined(GLFW_INCLUDE_GLU)
+   #include <OpenGL/glu.h>
+  #endif
+
+ #else /*__APPLE__*/
+
+  #if defined(GLFW_INCLUDE_GLU)
+   #include <GL/glu.h>
+  #endif
+
+ #endif /*__APPLE__*/
+
 #elif !defined(GLFW_INCLUDE_NONE) && \
       !defined(__gl_h_) && \
       !defined(__gles1_gl_h_) && \
@@ -218,9 +234,6 @@
    #define GL_GLEXT_LEGACY
   #endif
   #include <OpenGL/gl.h>
-  #if defined(GLFW_INCLUDE_GLU)
-   #include <OpenGL/glu.h>
-  #endif
 
  #else /*__APPLE__*/
 
@@ -228,9 +241,6 @@
   #if defined(GLFW_INCLUDE_GLEXT)
    #include <GL/glext.h>
   #endif
-  #if defined(GLFW_INCLUDE_GLU)
-   #include <GL/glu.h>
-  #endif
 
  #endif /*__APPLE__*/
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitty-0.18.0/kittens/diff/highlight.py 
new/kitty-0.18.1/kittens/diff/highlight.py
--- old/kitty-0.18.0/kittens/diff/highlight.py  2020-06-20 09:18:59.000000000 
+0200
+++ new/kitty-0.18.1/kittens/diff/highlight.py  2020-06-23 14:07:04.000000000 
+0200
@@ -12,6 +12,7 @@
 from pygments.lexers import get_lexer_for_filename  # type: ignore
 from pygments.util import ClassNotFound  # type: ignore
 
+from kitty.multiprocessing import get_process_pool_executor
 from kitty.rgb import color_as_sgr, parse_sharp
 
 from .collect import Collection, Segment, data_for_path, lines_for_path
@@ -139,7 +140,7 @@
 def highlight_collection(collection: Collection, aliases: Optional[Dict[str, 
str]] = None) -> Union[str, Dict[str, DiffHighlight]]:
     jobs = {}
     ans: Dict[str, DiffHighlight] = {}
-    with concurrent.futures.ProcessPoolExecutor(max_workers=os.cpu_count()) as 
executor:
+    with get_process_pool_executor(prefer_fork=True) as executor:
         for path, item_type, other_path in collection:
             if item_type != 'rename':
                 for p in (path, other_path):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitty-0.18.0/kitty/constants.py 
new/kitty-0.18.1/kitty/constants.py
--- old/kitty-0.18.0/kitty/constants.py 2020-06-20 09:18:59.000000000 +0200
+++ new/kitty-0.18.1/kitty/constants.py 2020-06-23 14:07:04.000000000 +0200
@@ -20,7 +20,7 @@
 
 
 appname: str = 'kitty'
-version: Version = Version(0, 18, 0)
+version: Version = Version(0, 18, 1)
 str_version: str = '.'.join(map(str, version))
 _plat = sys.platform.lower()
 is_macos: bool = 'darwin' in _plat
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitty-0.18.0/kitty/multiprocessing.py 
new/kitty-0.18.1/kitty/multiprocessing.py
--- old/kitty-0.18.0/kitty/multiprocessing.py   1970-01-01 01:00:00.000000000 
+0100
+++ new/kitty-0.18.1/kitty/multiprocessing.py   2020-06-23 14:07:04.000000000 
+0200
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+# vim:fileencoding=utf-8
+# License: GPLv3 Copyright: 2020, Kovid Goyal <kovid at kovidgoyal.net>
+
+# Monkeypatch the stdlib multiprocessing module to work with the embedded 
python
+# in kitty, when using the spawn launcher.
+
+
+from concurrent.futures import ProcessPoolExecutor
+from multiprocessing import util  # type: ignore
+from multiprocessing import context, get_all_start_methods, get_context, spawn
+from typing import Any, Callable, List, Optional, Tuple, Union
+
+from .constants import kitty_exe
+
+orig_spawn_passfds = util.spawnv_passfds
+orig_executable = spawn.get_executable()
+
+
+def spawnv_passfds(path: str, args: List[str], passfds: List[int]) -> Any:
+    idx = args.index('-c')
+    patched_args = [spawn.get_executable(), '+runpy'] + args[idx + 1:]
+    return orig_spawn_passfds(kitty_exe(), patched_args, passfds)
+
+
+def monkey_patch_multiprocessing() -> None:
+    # Use kitty to run the worker process used by multiprocessing
+    spawn.set_executable(kitty_exe())
+    util.spawnv_passfds = spawnv_passfds
+
+
+def unmonkey_patch_multiprocessing() -> None:
+    spawn.set_executable(orig_executable)
+    util.spawnv_passfds = orig_spawn_passfds
+
+
+def get_process_pool_executor(
+    prefer_fork: bool = False,
+    max_workers: Optional[int] = None,
+    initializer: Optional[Callable] = None,
+    initargs: Tuple[Any, ...] = ()
+) -> ProcessPoolExecutor:
+    if prefer_fork and 'fork' in get_all_start_methods():
+        ctx: Union[context.DefaultContext, context.ForkContext] = 
get_context('fork')
+    else:
+        monkey_patch_multiprocessing()
+        ctx = get_context()
+    try:
+        return ProcessPoolExecutor(max_workers=max_workers, 
initializer=initializer, initargs=initargs, mp_context=ctx)
+    except TypeError:
+        return ProcessPoolExecutor(max_workers=max_workers, 
initializer=initializer, initargs=initargs)
+
+
+def test_spawn() -> None:
+    monkey_patch_multiprocessing()
+    try:
+        from multiprocessing import get_context
+        ctx = get_context('spawn')
+        q = ctx.Queue()
+        p = ctx.Process(target=q.put, args=('hello',))
+        p.start()
+        x = q.get(timeout=2)
+        assert x == 'hello'
+        p.join()
+    finally:
+        unmonkey_patch_multiprocessing()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitty-0.18.0/kitty_tests/tui.py 
new/kitty-0.18.1/kitty_tests/tui.py
--- old/kitty-0.18.0/kitty_tests/tui.py 2020-06-20 09:18:59.000000000 +0200
+++ new/kitty-0.18.1/kitty_tests/tui.py 2020-06-23 14:07:04.000000000 +0200
@@ -42,3 +42,8 @@
         self.ae(le.cursor_pos, 0)
         le.backspace()
         self.assertTrue(le.pending_bell)
+
+    def test_multiprocessing_spawn(self):
+        return  # temporarily disable this test till I can figure out why its 
failing in the build env
+        from kitty.multiprocessing import test_spawn
+        test_spawn()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitty-0.18.0/publish.py new/kitty-0.18.1/publish.py
--- old/kitty-0.18.0/publish.py 2020-06-20 09:18:59.000000000 +0200
+++ new/kitty-0.18.1/publish.py 2020-06-23 14:07:04.000000000 +0200
@@ -257,7 +257,7 @@
                             % (asset['name'], release['tag_name']))
 
     def do_upload(self, url: str, path: str, desc: str, fname: str) -> 
requests.Response:
-        mime_type = mimetypes.guess_type(fname)[0]
+        mime_type = mimetypes.guess_type(fname)[0] or 
'application/octet-stream'
         self.info('Uploading to GitHub: %s (%s)' % (fname, mime_type))
         with ReadFileWithProgressReporting(path) as f:
             return self.requests.post(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitty-0.18.0/setup.py new/kitty-0.18.1/setup.py
--- old/kitty-0.18.0/setup.py   2020-06-20 09:18:59.000000000 +0200
+++ new/kitty-0.18.1/setup.py   2020-06-23 14:07:04.000000000 +0200
@@ -1146,12 +1146,12 @@
     if args.action == 'clean':
         clean()
         return
+    launcher_dir = 'kitty/launcher'
 
     with CompilationDatabase(args.incremental) as cdb:
         args.compilation_database = cdb
         if args.action == 'build':
             build(args)
-            launcher_dir = 'kitty/launcher'
             if is_macos:
                 create_minimal_macos_bundle(args, launcher_dir)
             else:
@@ -1164,6 +1164,7 @@
             package(args, bundle_type='linux-freeze')
         elif args.action == 'macos-freeze':
             build(args, native_optimizations=False)
+            build_launcher(args, launcher_dir=launcher_dir)
             package(args, bundle_type='macos-freeze')
         elif args.action == 'kitty.app':
             args.prefix = 'kitty.app'


Reply via email to