Skip to content

Commit d3036e1

Browse files
authored
Fix importing of launch (#18)
* #17: fix importing of launch * #17: use expand * #17: windows needs call * #17: add python.app to osx constructor * add robotframeworklexer * lexer recipe work * yeah, you need python
1 parent 7689627 commit d3036e1

File tree

6 files changed

+50
-6
lines changed

6 files changed

+50
-6
lines changed

anaconda-project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ commands:
4444

4545
robotlab:launch:
4646
env_spec: robotlab-dev
47-
unix: python -m robotlab.launch
47+
unix: python ./robotlab/src/robotlab/launch.py
4848

4949
robotlab:launch:win:
5050
env_spec: robotlab-dev-win

ci/steps.common.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ steps:
1414
jsonpath-ng
1515
flex-swagger
1616
robotframework
17+
robotframeworklexer
1718
robotframework-lint
1819
robotframework-seleniumlibrary
1920
restinstance

constructor/construct.yaml.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ specs:
2424
- robotframework-lint
2525
- robotframework-seleniumlibrary
2626
- robotframework-seleniumscreenshots
27+
- robotframeworklexer
2728
- robotkernel =={{ version }}
2829
- robotlab =={{ version }}
30+
{% if platform == "darwin" %}- python.app{% endif %}
2931

3032
install_in_dependency_order: True
3133

recipes/robotframeworklexer/meta.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{% set name = "robotframeworklexer" %}
2+
{% set version = "1.1" %}
3+
4+
package:
5+
name: {{ name }}
6+
version: {{ version }}
7+
8+
source:
9+
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
10+
sha256: ddd3ea50b54b47aee86a83c400534a61e2588dec875a3c10f04822280e834b8f
11+
12+
build:
13+
number: 0
14+
script: {{ PYTHON }} -m pip install . --no-deps --ignore-installed -vvv
15+
16+
requirements:
17+
host:
18+
- pip
19+
- python
20+
run:
21+
- python
22+
- pygments
23+
24+
test:
25+
imports:
26+
- robotframeworklexer
27+
28+
about:
29+
home: https://github.com/robotframework/pygmentslexer
30+
license: Apache-2.0
31+
license_family: Apache
32+
license_file: LICENSE.txt
33+
summary: >
34+
This project implements a Pygments lexer for Robot Framework test data in
35+
plain text format.

robotlab/src/robotlab/launch.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,34 @@
1111
from pathlib import Path
1212
from tempfile import TemporaryDirectory
1313

14-
from . import WIN, BIN_DIR, SCRIPT_EXT
14+
from robotlab import WIN, BIN_DIR, SCRIPT_EXT
1515

1616

1717
ACTIVATE = [
18-
f'''"{BIN_DIR}\\activate" "{sys.prefix}" || activate "{sys.prefix}"'''
18+
f'''call "{BIN_DIR}\\activate" "{sys.prefix}" || activate "{sys.prefix}"'''
1919
] if WIN else [
2020
"#!" + "/usr/bin/env bash",
2121
f'''. "{BIN_DIR}/activate" "{sys.prefix}" || . activate "{sys.prefix}"'''
2222
]
2323

24+
CMD = [
25+
"call python -m robotlab.labapp"
26+
] if WIN else [
27+
"pyton -m robotlab.labapp"
28+
]
29+
2430

2531
def launch_robotlab():
2632
with TemporaryDirectory() as td:
2733
tdp = Path(td)
2834
script = tdp / f"launch_robotlab.{SCRIPT_EXT}"
29-
lines = ACTIVATE + ["python -m robotlab.labapp"]
35+
lines = ACTIVATE + CMD
3036
script.write_text(os.linesep.join(lines))
3137
script.chmod(0o755)
3238
print(script.read_text(), "\n")
3339
proc = subprocess.Popen(
3440
[str(script)],
35-
cwd=os.environ["HOME"],
36-
preexec_fn=os.setsid
41+
cwd=os.path.expanduser("~")
3742
)
3843
try:
3944
proc.wait()

scripts/build.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def build_constructor():
8888
cd_version=CHROMEDRIVER_VERSION,
8989
ipyw_version=IPYWIDGETS_VERSION,
9090
script_ext=SCRIPT_EXT,
91+
platform=PLATFORM,
9192
)
9293

9394
CONSTRUCT.write_text(construct)

0 commit comments

Comments
 (0)