Skip to content

Commit

Permalink
fix: read property to determine if using python virtual env (#65)
Browse files Browse the repository at this point in the history
## Description

In addition to reading environment variable `EXHORT_PYTHON_VIRTUAL_ENV`
to determining if using python virtual environment, also ready system
property.

## Checklist

- [x] I have followed this repository's contributing guidelines.
- [x] I will adhere to the project's code of conduct.

## Additional information

> Anything else?
  • Loading branch information
xieshenzh authored Oct 18, 2023
1 parent 270a8bb commit 86ba112
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ private PythonControllerBase getPythonController() {
String[] parts = pythonPipBinaries.split(";;");
var python = parts[0];
var pip = parts[1];
String useVirtualPythonEnv = Objects.requireNonNullElse(System.getenv("EXHORT_PYTHON_VIRTUAL_ENV"), "false");
String useVirtualPythonEnv = Objects.requireNonNullElseGet(
System.getenv("EXHORT_PYTHON_VIRTUAL_ENV"),
() -> Objects.requireNonNullElse(System.getProperty("EXHORT_PYTHON_VIRTUAL_ENV"), "false"));
PythonControllerBase pythonController;
if(this.pythonController == null) {
if (Boolean.parseBoolean(useVirtualPythonEnv)) {
Expand Down

0 comments on commit 86ba112

Please sign in to comment.