diff --git a/.github/workflows/ci.py b/.github/workflows/ci.py index c97a6ffc7..d9dabfb8a 100644 --- a/.github/workflows/ci.py +++ b/.github/workflows/ci.py @@ -131,7 +131,7 @@ def main(): elif action == 'test': test_kitty() elif action == 'gofmt': - q = subprocess.check_output('gofmt -s -l tools version.go'.split()) + q = subprocess.check_output('gofmt -s -l tools'.split()) if q.strip(): print(q.decode()) raise SystemExit(1) diff --git a/.gitignore b/.gitignore index 5e40a54d1..ad9fc483f 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,7 @@ /glad/out/ /kitty/launcher/kitty* /tools/cmd/at/*_generated.go -/constants.go +*_generated.go /*.dSYM/ __pycache__/ /glfw/wayland-*-client-protocol.[ch] diff --git a/bypy/rsync.conf b/bypy/rsync.conf index 9b2165745..0879a4c4e 100644 --- a/bypy/rsync.conf +++ b/bypy/rsync.conf @@ -1 +1 @@ -to_vm_excludes '/build /dist /kitty/launcher/kitty /.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 *_generated.go' diff --git a/gen-rc-go.py b/gen-rc-go.py index e6ac91eda..a64c0d90b 100755 --- a/gen-rc-go.py +++ b/gen-rc-go.py @@ -27,7 +27,7 @@ def main() -> None: if 'prewarmed' in getattr(sys, 'kitty_run_data'): os.environ.pop('KITTY_PREWARM_SOCKET') os.execlp(sys.executable, sys.executable, '+launch', __file__, *sys.argv[1:]) - with open('constants.go', 'w') as f: + with open('constants_generated.go', 'w') as f: dp = ", ".join(map(lambda x: f'"{serialize_as_go_string(x)}"', kc.default_pager_for_help)) f.write(f'''\ // auto-generated by {__file__} do no edit diff --git a/setup.py b/setup.py index fa98b4aba..d14bff7ae 100755 --- a/setup.py +++ b/setup.py @@ -880,15 +880,15 @@ def update_go_generated_files() -> None: # update all the various auto-generated go files, if needed rc_sources = [x for x in glob.glob('kitty/rc/*.py') if os.path.basename(x) not in ('base.py', '__init__.py')] rc_objects = glob.glob('tools/cmd/at/*_generated.go') - generated = rc_objects + glob.glob('constants.go') + generated = rc_objects + glob.glob('constants_generated.go') sources = ['gen-rc-go.py', 'kitty/constants.py', 'setup.py', 'tools/cmd/at/template.go'] + rc_sources if generated: oldest_generated = min(map(os.path.getmtime, generated)) newest_source = max(map(os.path.getmtime, sources)) - if oldest_generated > newest_source and len(rc_sources) == len(rc_objects) and 'constants.go' in generated: + if oldest_generated > newest_source and len(rc_sources) == len(rc_objects) and 'constants_generated.go' in generated: return print('Updating Go generated files...') - subprocess.check_call(['./gen-rc-go.py']) + subprocess.check_call([os.path.join(base, 'gen-rc-go.py')]) def build_kitty_tool(args: Options, launcher_dir: str = '.') -> None: @@ -1443,7 +1443,7 @@ def clean() -> None: safe_remove( 'build', 'compile_commands.json', 'link_commands.json', 'linux-package', 'kitty.app', 'asan-launcher', - 'kitty-profile', 'docs/generated') + 'kitty-profile', 'docs/generated', 'constants.go') clean_launcher_dir('kitty/launcher') def excluded(root: str, d: str) -> bool: @@ -1458,7 +1458,7 @@ def clean() -> None: dirs.remove(d) for f in files: ext = f.rpartition('.')[-1] - if ext in ('so', 'dylib', 'pyc', 'pyo') or f.endswith('_generated.h'): + if ext in ('so', 'dylib', 'pyc', 'pyo') or f.endswith('_generated.h') or f.endswith('_generated.go'): os.unlink(os.path.join(root, f)) for x in glob.glob('glfw/wayland-*-protocol.[ch]'): os.unlink(x)