-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathsetup.sh
More file actions
52 lines (44 loc) · 1.74 KB
/
setup.sh
File metadata and controls
52 lines (44 loc) · 1.74 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
# vim: set ft=zsh
# Exit (return) on error.
set -o ERR_RETURN
# Minimum viable bootstrap to run Hemera. UV makes this a little easier now! as
# do my dotfiles, which set $PLATFORM based on whatever heuristics.
export UV_PROJECT_ENVIRONMENT="${WORKON_HOME}/hemera"
export CHECKOUT=~/Code/personal/hemera
case $PLATFORM in
linux )
# Noop for now; assumes this is inside a Hemera-installed system where
# we already have the git checkout and just need to do the venv
# creation (as those are poorly relocatable even in the 2020s, sigh).
;;
mac )
# TODO: I /could/ set up hemera to be a truly /installable/ python
# project with a CLI entrypoint, then aim uv at it like so:
#
# uv tool run --from "git@ssh://git@github.com/bitprophet/hemera" \
# nameofclitoolhere --args
#
# which would use an ephemeral venv to execute.
# TODO: however that got a bit messy fast and it's not like I /don't/
# want to end up with a real project checkout eventually, so below just
# duplicates a teensy bit of what Hemera does internally re: such
# checkouts...probably fine for now? esp given how infrequently I set
# up new macs? ehhh we'll see, if it drifts too much or too fast I'll
# reconsider!
# Reuse some bits (as this is often run in a fresh shell)
source ~/.zsh/python
REPO="git@github.com:bitprophet/hemera"
brew install uv
echo
mkdir -p $(dirname $CHECKOUT)
git clone $REPO $CHECKOUT
echo
;;
esac
cd $CHECKOUT
# --seed to inject pip etc
uv venv --seed
# Hemera has a pyproject.toml now
uv sync
echo
echo "All done! Please execute 'wk hemera && inv converge'."