From 563b7ad2d0b2ca15beef15bf364b9bff8f27112d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 11 Oct 2021 20:00:56 +0530 Subject: [PATCH] Linux binary builds: Fix Pygments not being included --- bypy/linux/__main__.py | 3 +-- kitty_tests/check_build.py | 14 +++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/bypy/linux/__main__.py b/bypy/linux/__main__.py index 5fe0cba5a..20d5d40dd 100644 --- a/bypy/linux/__main__.py +++ b/bypy/linux/__main__.py @@ -115,8 +115,7 @@ def copy_python(env): shutil.copy2(y, env.py_dir) srcdir = j(srcdir, 'site-packages') - site_packages_dir = j(env.py_dir, 'site-packages') - import_site_packages(srcdir, site_packages_dir) + import_site_packages(srcdir, env.py_dir) pdir = os.path.join(env.lib_dir, 'kitty-extensions') os.makedirs(pdir, exist_ok=True) diff --git a/kitty_tests/check_build.py b/kitty_tests/check_build.py index 2cdf5d13f..0f7ee54e5 100644 --- a/kitty_tests/check_build.py +++ b/kitty_tests/check_build.py @@ -4,6 +4,7 @@ import os +import sys import unittest from . import BaseTest @@ -22,8 +23,8 @@ class TestBuild(BaseTest): import kitty.fast_data_types as fdt from kittens.choose import subseq_matcher from kittens.diff import diff_speedup - from kittens.unicode_input import unicode_names from kittens.transfer import rsync + from kittens.unicode_input import unicode_names del fdt, unicode_names, subseq_matcher, diff_speedup, rsync def test_loading_shaders(self) -> None: @@ -50,7 +51,9 @@ class TestBuild(BaseTest): self.assertGreater(len(names), 8) def test_filesystem_locations(self) -> None: - from kitty.constants import terminfo_dir, logo_png_file, shell_integration_dir + from kitty.constants import ( + logo_png_file, shell_integration_dir, terminfo_dir + ) zsh = os.path.join(shell_integration_dir, 'kitty.zsh') self.assertTrue(os.path.isdir(terminfo_dir), f'Terminfo dir: {terminfo_dir}') self.assertTrue(os.path.exists(logo_png_file), f'Logo file: {logo_png_file}') @@ -58,12 +61,17 @@ class TestBuild(BaseTest): def test_ca_certificates(self): import ssl - import sys if not getattr(sys, 'frozen', False): self.skipTest('CA certificates are only tested on frozen builds') c = ssl.create_default_context() self.assertGreater(c.cert_store_stats()['x509_ca'], 2) + def test_pygments(self): + if not getattr(sys, 'frozen', False): + self.skipTest('Pygments is only tested on frozen builds') + import pygments + del pygments + def main() -> None: tests = unittest.defaultTestLoader.loadTestsFromTestCase(TestBuild)