Skip to content

Commit

Permalink
Add a simple shortcut for plain system environment
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrueden committed Jun 23, 2023
1 parent 7a0bcdb commit dd85f6e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/appose/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def task_listener(event):

from pathlib import Path

from .environment import Builder
from .environment import Builder, Environment


def base(directory: Path) -> Builder:
Expand All @@ -146,3 +146,7 @@ def java(vendor: str, version: str) -> Builder:

def conda(environment_yaml: Path) -> Builder:
return Builder().conda(environment_yaml=environment_yaml)


def system(directory: Path = Path(".")) -> Environment:
return Builder().base(directory).use_system_path().build()
4 changes: 2 additions & 2 deletions tests/test_appose.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@


def test_groovy():
env = appose.base(".").use_system_path().build()
env = appose.system()
# FIXME: Resolve these dependencies in a better way.
class_path = [
"../appose-java/target/appose-0.1.0-SNAPSHOT.jar",
Expand All @@ -72,7 +72,7 @@ def test_groovy():


def test_python():
env = appose.base(".").use_system_path().build()
env = appose.system()
with env.python() as service:
execute_and_assert(service, collatz_python)

Expand Down

0 comments on commit dd85f6e

Please sign in to comment.