Skip to content

Commit 5a1bbfa

Browse files
committed
build.py: Remove argh dependency
1 parent 0e185d7 commit 5a1bbfa

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

Scripts/build.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
import argh
3+
import argparse
44
import subprocess
55
import os
66

@@ -29,17 +29,15 @@
2929
updates_signing_key_file = os.path.join(project_root, 'updates', 'gitx-updates.key')
3030
updates_appcast_file = 'GitX-dev.xml'
3131

32-
clean = ""
3332
pause = 3
3433

3534
build_base_dir = os.path.join(project_root, "build")
3635

3736
class BuildError(RuntimeError):
3837
pass
3938

40-
@argh.arg("config", choices=['debug', 'release'])
41-
def clean(config):
42-
clean_scheme(scheme, config)
39+
def clean(args):
40+
clean_scheme(scheme, args.config)
4341

4442
def release():
4543
try:
@@ -101,11 +99,10 @@ def prepare_release(build_number, image_source_path):
10199
shutil.copyfile(release_notes_file, publish_release_notes_version_file)
102100

103101

104-
@argh.arg("scheme", choices=['debug', 'release'])
105-
def build(scheme):
106-
if scheme == "debug":
102+
def build(args):
103+
if args.config == "debug":
107104
debug()
108-
if scheme == "release":
105+
if args.config == "release":
109106
release()
110107

111108

@@ -168,4 +165,17 @@ def package_app(app_path, image_path, image_name):
168165

169166
if __name__ == "__main__":
170167
script_dir = os.path.dirname(os.path.abspath(__file__))
171-
argh.dispatch_commands([clean, build])
168+
169+
parser = argparse.ArgumentParser()
170+
subparsers = parser.add_subparsers()
171+
172+
parser_config = subparsers.add_parser('config')
173+
parser_config.add_argument('config', choices=['debug', 'release'])
174+
parser_config.set_defaults(func=clean)
175+
176+
parser_build = subparsers.add_parser('build')
177+
parser_build.add_argument('config', choices=['debug', 'release'])
178+
parser_build.set_defaults(func=build)
179+
180+
args = parser.parse_args()
181+
args.func(args)

requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)