-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathdev-setup.sh
More file actions
executable file
·53 lines (41 loc) · 1.85 KB
/
dev-setup.sh
File metadata and controls
executable file
·53 lines (41 loc) · 1.85 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
#!/usr/bin/env bash
# this is meant to be done after a full conda install (or setting up all dependencies)
## making sure we are in the bit-dev conda environment
if [ "${CONDA_DEFAULT_ENV}" != "bit-dev" ]; then
printf "\n This should be run in the 'bit-dev' conda environment..\n"
printf " You know this, Mike...\n\n"
return 1 2>/dev/null || exit 1
fi
# if coverage isn't tracking properly, i may need to set this variable to point at the .coveragerc on whatever system i am working on, e.g.:
# export COVERAGE_PROCESS_START=/Users/michael.lee/Documents/github/bit/.coveragerc
if [[ -z "$COVERAGE_PROCESS_START" ]]; then
conda env config vars set COVERAGE_PROCESS_START="/Users/michael.lee/Documents/github/bit/.coveragerc" --name bit-dev > /dev/null 2>&1
cda bit-dev
fi
rm -rf build/ bit.egg-info/
BIN_DIR=$(dirname $(which python))
# removing stale symlinks that point into bit/scripts/
# (these conflict with pyproject.toml entry points)
for f in ${BIN_DIR}/*; do
target=$(readlink "$f" 2>/dev/null)
if [[ "$target" == *"bit/scripts"* ]]; then
rm -f "$f"
fi
done
pip install --no-build-isolation -e .
printf "\n\n Linking unported scripts to ${BIN_DIR}/ for dev...\n\n\n"
for script in bit/scripts/*; do
name=$(basename "${script}")
# skip if pip already created an entry point for this name
if [ -f "${BIN_DIR}/${name}" ]; then
continue
fi
ln -sf "$(realpath "${script}")" "${BIN_DIR}/${name}"
done
# setting up tab-completion for the bit commands with subcommands
for cmd in bit-extract-seqs bit-ez-screen bit-genbank; do
eval "$(register-python-argcomplete "$cmd")"
done
## if changing conda versions and wanting to install locally entirely (rather than using a prior official conda install of bit)
# conda build -c conda-forge -c bioconda conda-recipe/
# conda create -n bit-dev --use-local bit