File: build_conda_packed.ps1

package info (click to toggle)
python-bumps 1.0.0b2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,144 kB
  • sloc: python: 23,941; xml: 493; ansic: 373; makefile: 209; sh: 91; javascript: 90
file content (36 lines) | stat: -rw-r--r-- 1,247 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
$ENV_NAME="isolated-base"
$PYTHON_VERSION="3.10"
$DIRNAME="bumps"

conda activate "base"

conda install -y conda-pack
conda create -n "$ENV_NAME" -q --force -y "python=$PYTHON_VERSION"
conda-pack -n "$ENV_NAME" -f -o "$ENV_NAME.tar.gz"

# unpack the new environment, that contains only python + pip
$tmpdir="dist"
$destdir="$tmpdir\$DIRNAME"
$envdir = "$destdir\env"
Remove-Item -r -Force "$destdir"
mkdir "$envdir"
tar -xzf "$ENV_NAME.tar.gz" -C "$envdir"

# activate the unpacked environment and install pip packages
conda deactivate
$WORKING_DIRECTORY="$pwd"
echo "WORKING_DIRECTORY=$WORKING_DIRECTORY"
dir .
dir ..
# add our batch script:
Copy-Item .\extra\bumps_webview.bat "$destdir"

& "$envdir\python.exe" -m pip install --no-input --no-compile numba
& "$envdir\python.exe" -m pip install --no-input --no-compile git+https://github.com/bumps/bumps@webview
& "$envdir\python.exe" -m pip install --no-compile -r https://raw.githubusercontent.com/bumps/bumps/webview/webview-requirements

$version=$(& "$envdir\python.exe" -c "import bumps; print(bumps.__version__)")
# zip it back up
cd $tmpdir
Rename-Item "$DIRNAME" "$DIRNAME-$version"
tar -czf "bumps-webview-Windows-x86_64.tar.gz" "$DIRNAME-$version"