Skip to content

Commit 0fbefaa

Browse files
hrobartscasperdcl
andauthored
Update install script to pip install into correct conda env (#2144)
* pip install into conda env * Make compatible with windows * Install linux specific packages separately --------- Co-authored-by: Casper da Costa-Luis <[email protected]>
1 parent 26f9556 commit 0fbefaa

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Extra functionality for sampler: `get_previous_samples()` and `get_current_sample()` (#2079)
1919
- Renamed Sampler's `get_samples` to `view_samples` (deprecating `get_samples`) #2128
2020
- PDHG 'check_convergence' updated for new literature (#2084)
21+
- Make install local env script work on windows (#2144)
2122
- Testing
2223
- Developers can now add `#all-tests` to their commit message on a PR to run the full matrix of GitHub actions tests (#2081)
2324
- Added tests for ProjectionOperator inputs that use `unittest-parametrize` module (#1990)

scripts/create_local_env_for_cil_development.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ conda_args=(create --name="$name"
5454
ipp'>=2021.10'
5555
ipp-devel'>=2021.10'
5656
ipp-include'>=2021.10'
57-
libgcc-ng
58-
libstdcxx-ng
5957
matplotlib-base
6058
numba
6159
olefile'>=0.46'
@@ -68,6 +66,11 @@ conda_args=(create --name="$name"
6866
tqdm
6967
zenodo_get'>=1.6'
7068
)
69+
70+
if test "$(uname)" = Linux; then
71+
conda_args+=(libgcc-ng libstdcxx-ng)
72+
fi
73+
7174
if test -n "$cil_ver"; then
7275
echo "CIL version $cil_ver"
7376
conda_args+=(cil="${cil_ver}")
@@ -99,7 +102,13 @@ else
99102
)
100103
fi
101104

102-
conda "${conda_args[@]}"
105+
conda "${conda_args[@]}"
103106
if [[ -n "${pip_install_pkgs[@]}" ]]; then
104-
python -m pip install "${pip_install_pkgs[@]}"
105-
fi
107+
env_path=$(conda info --base)/envs/"$name"
108+
if [[ "$OSTYPE" =~ msys|win32|cygwin ]]; then
109+
python_exec="$env_path/python.exe"
110+
else
111+
python_exec="$env_path/bin/python"
112+
fi
113+
"$python_exec" -m pip install "${pip_install_pkgs[@]}"
114+
fi

0 commit comments

Comments
 (0)