Skip to content

Commit

Permalink
[dev] enable specifying conda env name (#5886)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhett-Ying committed Jun 20, 2023
1 parent d381f22 commit 3e2b5a0
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions script/create_dev_conda_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ examples:
bash $0 -g 11.7
bash $0 -g 11.7 -p 3.8
bash $0 -g 11.7 -p 3.8 -t 1.13.0
bash $0 -c -n dgl-dev-cpu
Create a developement environment for DGL developers.
Expand All @@ -23,6 +24,7 @@ OPTIONS:
environment of the same name).
-g Create dev environment in GPU mode with specified CUDA version,
supported: ${CUDA_VERSIONS}.
-n Specify the name of the environment.
-o Save environment YAML file to specified path.
-p Create dev environment based on specified python version.
-s Run silently which indicates always 'yes' for any confirmation.
Expand Down Expand Up @@ -51,7 +53,7 @@ confirm() {
}

# Parse flags.
while getopts "cdfg:ho:p:st:" flag; do
while getopts "cdfg:hn:o:p:st:" flag; do
case "${flag}" in
c)
cpu=1
Expand All @@ -69,6 +71,9 @@ while getopts "cdfg:ho:p:st:" flag; do
usage
exit 0
;;
n)
name=${OPTARG}
;;
o)
output_path=${OPTARG}
;;
Expand Down Expand Up @@ -109,7 +114,9 @@ fi
# Set up CPU mode.
if [[ ${cpu} -eq 1 ]]; then
torchversion=${torch_version}"+cpu"
name="dgl-dev-cpu"
if [[ -z "${name}" ]]; then
name="dgl-dev-cpu"
fi
fi

# Set up GPU mode.
Expand All @@ -124,7 +131,9 @@ if [[ -n ${cuda_version} ]]; then
[[ -n "${always_yes}" ]] || confirm

torchversion=${torch_version}"+cu"${cuda_version//[-._]/}
name="dgl-dev-gpu"
if [[ -z "${name}" ]]; then
name="dgl-dev-gpu-"${cuda_version//[-._]/}
fi
fi

# Set python version.
Expand Down

0 comments on commit 3e2b5a0

Please sign in to comment.