Skip to content

Commit 97df391

Browse files
committed
formatting updates
1 parent bc1f2e7 commit 97df391

File tree

3 files changed

+24
-20
lines changed

3 files changed

+24
-20
lines changed

conda/web-installer/build.py

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,54 +5,57 @@
55

66

77
def usage():
8-
print('Web installer build script')
9-
print('build.py <installer version> <tag version>')
10-
print('The installer verison is the version number used within the conda constructor script')
11-
print('The tag verison is the version of cadquery that will be pulled from github')
8+
print("Web installer build script")
9+
print("build.py <installer version> <tag version>")
10+
print(
11+
"The installer verison is the version number used within the conda constructor script"
12+
)
13+
print("The tag verison is the version of cadquery that will be pulled from github")
14+
1215

1316
def write_file(destpath, contents):
14-
with open(destpath, "w") as destfile:
15-
destfile.write(contents)
17+
with open(destpath, "w") as destfile:
18+
destfile.write(contents)
19+
1620

1721
def run_cmd(cmdarray, workingdir, captureout=False):
1822
stdout = stderr = None
1923
if captureout:
2024
stdout = stderr = subprocess.PIPE
21-
proc = subprocess.Popen(cmdarray, cwd=workingdir, stdout=stdout, stderr=stderr, universal_newlines=True)
25+
proc = subprocess.Popen(
26+
cmdarray, cwd=workingdir, stdout=stdout, stderr=stderr, universal_newlines=True
27+
)
2228
proc_out, proc_err = proc.communicate()
2329
if proc.returncode != 0:
24-
raise RuntimeError('Failure to run command')
30+
raise RuntimeError("Failure to run command")
2531
return stdout, stderr
2632

33+
2734
def generate_templates(installer_version, tag_version):
28-
print('Generating Scripts')
29-
env = Environment(
30-
loader=FileSystemLoader("."),
31-
autoescape=select_autoescape()
32-
)
35+
print("Generating Scripts")
36+
env = Environment(loader=FileSystemLoader("."), autoescape=select_autoescape())
3337

3438
template = env.get_template("construct.yaml.jinja2")
3539
output = template.render(installer_version=installer_version)
36-
write_file('construct.yaml', output)
40+
write_file("construct.yaml", output)
3741

3842
template = env.get_template("post-install.bat.jinja2")
3943
output = template.render(tag_version=tag_version)
40-
write_file('post-install.bat', output)
44+
write_file("post-install.bat", output)
4145

4246
template = env.get_template("post-install.sh.jinja2")
4347
output = template.render(tag_version=tag_version)
44-
write_file('post-install.sh', output)
48+
write_file("post-install.sh", output)
4549

4650

4751
def run_constructor():
48-
print('Running constructor')
52+
print("Running constructor")
4953
scriptdir = os.path.dirname(os.path.realpath(__file__))
5054
builddir = os.path.join(scriptdir, 'build')
5155
if not os.path.exists(builddir):
5256
os.makedirs(builddir)
5357
run_cmd(['constructor', scriptdir], builddir)
5458

55-
# TODO
5659

5760
def main():
5861
if len(sys.argv) < 2:
@@ -63,4 +66,5 @@ def main():
6366
generate_templates(installer_version, tag_version)
6467
run_constructor()
6568

69+
6670
main()

conda/web-installer/post-install.bat.jinja2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ echo Entering Conda Environment
22
call %PREFIX%\condabin\activate.bat
33

44
echo Updating conda
5-
call conda update -y -n base conda
5+
call conda update -q conda
66

77
echo Cleaning Packages
88
call conda clean -a -y

conda/web-installer/post-install.sh.jinja2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ echo Entering Conda Environment
44
source $PREFIX/bin/activate
55

66
echo Updating conda
7-
conda update -y -n base conda
7+
conda update -q conda
88

99
echo Cleaning Packages
1010
conda clean -a -y

0 commit comments

Comments
 (0)