Skip to content

Commit

Permalink
gtri#2: clean up more build stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
bollwyvl committed Feb 4, 2019
1 parent 1f195ff commit e6b3265
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 24 deletions.
18 changes: 11 additions & 7 deletions ci/steps.common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,23 @@ parameters:
name: Linux

steps:
- script: scripts -m scripts.bootstrap pip kernel js
displayName: Bootstrap

- script: python -m scripts.build sdist wheel
displayName: Build Kernel

- script: python -m scripts.test lint
displayName: Lint

- script: >
python -m pip install -e . --no-deps -vv
&& jupyter kernelspec install --name robotframework --sys-prefix src/irobotframework/resources
displayName: Install
- script: python -m scripts.test unit
displayName: Unit Tests

- script: jlpm bootstrap
displayName: Build
- script: python -m scripts.build lerna npm
displayName: Build JS

- script: python -m scripts.build jupyterlab
displayName: Build Lab

- script: python -m scripts.test acceptance --browser headlessfirefox
displayName: Acceptance Tests (Firefox)
Expand Down
2 changes: 1 addition & 1 deletion scripts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def run(args, **kwargs):
""" Probably unneccessary "convenience" wrapper
"""
str_args = list(map(str, args))
print("====", " ".join(str_args), "\n====")
print("====\n\n", " ".join(str_args), "\n\n====")
p = subprocess.Popen(str_args, **kwargs)

try:
Expand Down
25 changes: 13 additions & 12 deletions scripts/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@
from . import ROOT, run


def bootstrap():
def bootstrap(steps):
res = ROOT / "src" / "irobotframework" / "resources"
commands = [
"pip install -e . --ignore-installed --no-deps",
f"jupyter kernelspec install --name robotframework --sys-prefix {res}",
"jupyter kernelspec list",
"jlpm bootstrap",
"python -m scripts.build",
"python -m scripts.test",
]

commands = dict(
pip="pip install -e . --ignore-installed --no-deps",
kernel=f"jupyter kernelspec install --name robotframework --sys-prefix {res}",
js="jlpm bootstrap",
build="python -m scripts.build",
test="python -m scripts.test",
)

rc = 1

for cmd in commands:
print(f"\n{cmd}\n")
for name, cmd in commands.items():
if steps and name not in steps:
continue
rc = run(cmd.split(" "))
if rc != 0:
break
Expand All @@ -29,4 +30,4 @@ def bootstrap():


if __name__ == "__main__":
sys.exit(bootstrap())
sys.exit(bootstrap(sys.argv[1:]))
8 changes: 4 additions & 4 deletions scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ def wheel(wheel_args):
)


def lerna(lerna_args):
return run(["jlpm", "lerna", "run", "build"] + lerna_args)


def npm(npm_args):
src_dir = ROOT / "src" / "packages" / "jupyterlab-robotframework"
out_dir = DIST / "npm"
Expand All @@ -44,10 +48,6 @@ def npm(npm_args):
return 0


def lerna(lerna_args):
return run(["jlpm", "lerna", "run", "build"] + lerna_args)


def jupyterlab(extra_args):
with tempfile.TemporaryDirectory() as td:
tdp = Path(td)
Expand Down

0 comments on commit e6b3265

Please sign in to comment.