-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathupdate-conda-package.sh
More file actions
executable file
·68 lines (49 loc) · 2.79 KB
/
update-conda-package.sh
File metadata and controls
executable file
·68 lines (49 loc) · 2.79 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
set -e
################################################################################################################
### This is expected to be run after the version currently listed in setup.py is already released on github. ###
################################################################################################################
# this script as written expects the base conda directory to be located at ~/miniconda3/
# auto-works on conda-recipe/ dir
# example usage: bash update-conda-package.sh
##########################################################################
### if setting up on a new system for the first time, these are needed ###
##########################################################################
## needed for build
# conda install conda-build
## need to go through this process for uploads to anaconda to work as performed below
# conda install anaconda-client
# anaconda login
##########################################################################
### some pre-flight checks ###
recipe_dir="conda-recipe"
## making sure it is a directory here
if [ ! -d "${recipe_dir}" ]; then
printf "\n 'conda-recipe/' needs to be a directory here.\n"
printf " You know this, Mike...\n\n"
exit 1
fi
## making sure we are in the base conda environment
if [ "${CONDA_DEFAULT_ENV}" != "base" ]; then
printf "\n This should be run in the 'base' conda environment..\n"
printf " You know this, Mike...\n\n"
exit 1
fi
### getting started ###
## getting current version from setup.py (now pyproject.toml)
# version=$(grep "version" setup.py | cut -f 2 -d '=' | tr -d '",')
version=$(grep -w "^version" pyproject.toml | cut -f 2 -d '=' | tr -d '" ')
## getting current build from meta.yaml
build=$(grep -A 1 ^build ${recipe_dir}/meta.yaml | grep number | cut -f 2 -d ":" | tr -s " " "\t" | cut -f 2)
## conda way
conda-build -c conda-forge -c bioconda -c defaults ${recipe_dir}/
program=$(grep "^name" pyproject.toml | cut -f 2 -d "=" | tr -d '" ')
## converting to other platforms
conda convert --platform linux-64 ~/miniconda3/conda-bld/osx-64/${program}-${version}-*_${build}.tar.bz2 -o ~/miniconda3/conda-bld/
# conda convert --platform osx-arm64 ~/miniconda3/conda-bld/osx-64/${program}-${version}-*_${build}.tar.bz2 -o ~/miniconda3/conda-bld/
# i am leaving off the new mac chip way because most of the dependencies still don't have arm64 versions
## uploading to anaconda
anaconda upload ~/miniconda3/conda-bld/osx-64/${program}-${version}-*_${build}.tar.bz2
anaconda upload ~/miniconda3/conda-bld/linux-64/${program}-${version}-*_${build}.tar.bz2
# anaconda upload ~/miniconda3/conda-bld/osx-arm64/${program}-${version}-*_${build}.tar.bz2
# i am leaving off the new mac chip way because most of the dependencies still don't have arm64 versions