diff --git a/setup/commands.py b/setup/commands.py index 8e2d121b13..8a1dd599b4 100644 --- a/setup/commands.py +++ b/setup/commands.py @@ -13,7 +13,7 @@ __all__ = [ 'git_version', 'develop', 'install', 'kakasi', 'rapydscript', 'cacerts', 'recent_uas', 'resources', - 'check', 'to6', 'test', 'test_rs', + 'check', 'test', 'test_rs', 'sdist', 'bootstrap', 'extdev', 'manual', 'tag_release', 'upload_to_server', @@ -68,8 +68,6 @@ gui = GUI() from setup.check import Check check = Check() -from setup.port import To6 -to6 = To6() from setup.test import Test, TestRS test = Test() diff --git a/setup/git_post_checkout_hook.py b/setup/git_post_checkout_hook.py index e482505771..808021b925 100755 --- a/setup/git_post_checkout_hook.py +++ b/setup/git_post_checkout_hook.py @@ -18,6 +18,15 @@ os.chdir(base) if flags == '1': # A branch checkout prev_branch, cur_branch = list(map(get_branch_name, (prev_rev, current_rev))) + os.chdir(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + + if 'qt6' in (prev_branch, cur_branch): + os.rename('bypy/b/other-b', 'bypy/c') + os.rename('bypy/b', 'bypy/c/other-b') + os.rename('bypy/c', 'bypy/b') + subprocess.check_call('./setup.py build --clean'.split()) + subprocess.check_call('./setup.py gui --clean'.split()) + subprocess.check_call('./setup.py build'.split()) subprocess.check_call(['./setup.py', 'gui', '--summary']) diff --git a/setup/port.py b/setup/port.py deleted file mode 100644 index 620525c624..0000000000 --- a/setup/port.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python -# vim:fileencoding=utf-8 -# License: GPL v3 Copyright: 2019, Kovid Goyal - - -import os -import subprocess -import sys - -from setup import Command - - -class To6(Command): - - description = 'Toggle between the Qt6 and master branches building everything needed' - - def ccall(self, *a): - self.info(*a) - subprocess.check_call(a) - - def run(self, opts): - self.ccall('git', 'switch', '-') - os.rename('bypy/b/other-b', 'bypy/c') - os.rename('bypy/b', 'bypy/c/other-b') - os.rename('bypy/c', 'bypy/b') - self.ccall(sys.executable, 'setup.py', 'build', '--clean') - self.ccall(sys.executable, 'setup.py', 'build') - self.ccall(sys.executable, 'setup.py', 'gui', '--clean') - self.ccall(sys.executable, 'setup.py', 'gui', '--summary')