-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdeploy-conda.sh
38 lines (29 loc) · 1.19 KB
/
deploy-conda.sh
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
37
38
#!/bin/bash
# Extract version from __init__.py
version=$(grep -E "__version__[^=]*=" ds_utils/__init__.py | cut -d'"' -f2)
# Get numpy version
numpy_version=$(python -c "import numpy; print(numpy.__version__)")
# Create output directory if it doesn't exist
mkdir -p ./outputdir
# Build for different Python versions
for pyver in 3.9 3.10 3.11 3.12; do
conda build --python $pyver data-science-utils --numpy $numpy_version --output-folder outputdir/ --package-format 1
done
conda build purge
# Convert packages for all Python versions and platforms
for pyver in 39 310 311 312; do
conda convert -f --platform all "outputdir/osx-arm64/data-science-utils-${version}-py${pyver}_0.tar.bz2" -o outputdir/
done
# Get available platforms
platforms=$(conda convert --help | grep -E "(-p|--platform)" | grep -o "{.*}" | sed 's/[{}]//g' | tr ',' ' ')
# Login to Anaconda
anaconda login --username IdanMorad
# Upload packages for all Python versions and platforms
for pyver in 39 310 311 312; do
for platform in $platforms; do
if [ "$platform" != "all" ]; then
anaconda upload "outputdir/${platform}/data-science-utils-${version}-py${pyver}_0.tar.bz2"
fi
done
done
anaconda logout