README.md 1.24 KB
Newer Older
Felix Hummel's avatar
Felix Hummel committed
1
# Prerequisites
Felix Hummel's avatar
RDD  
Felix Hummel committed
2 3
- Python 3.8 (a virtual environment is recommended)
- PostgreSQL
Felix Hummel's avatar
Felix Hummel committed
4 5


Felix Hummel's avatar
RDD  
Felix Hummel committed
6
# Installation from Source
7
```
Felix Hummel's avatar
RDD  
Felix Hummel committed
8 9 10 11
mkdir ~/puddl
git clone https://gitlab.com/puddl/puddl.git
cd ~/puddl/puddl/
pip install -e .
Felix Hummel's avatar
Felix Hummel committed
12 13 14 15 16 17 18 19 20 21 22
```

Install completion for bash (for other shells please refer to [the click
documentation][click-completion]):
```
mkdir -p ~/.bash/
_PUDDL_COMPLETE=source_bash puddl > ~/.bash/puddl

cat <<'EOF' >> ~/.bashrc
[[ -f ~/.bash/puddl ]] && source ~/.bash/puddl
EOF
Felix Hummel's avatar
Felix Hummel committed
23

Felix Hummel's avatar
Felix Hummel committed
24
exec $SHELL
25
```
Felix Hummel's avatar
Felix Hummel committed
26
[click-completion]: https://click.palletsprojects.com/en/7.x/bashcomplete/#activation-script
27

Felix Hummel's avatar
Felix Hummel committed
28 29
Initialize the database. The command `puddl config init` will consume the `.env`
file if present in the current working directory.
Felix Hummel's avatar
Felix Hummel committed
30
```
Felix Hummel's avatar
RDD  
Felix Hummel committed
31
cd ~/puddl/puddl/
Felix Hummel's avatar
Felix Hummel committed
32 33
./env/dev/generate_env_file.sh > .env
./env/dev/create_database.sh
Felix Hummel's avatar
RDD  
Felix Hummel committed
34

Felix Hummel's avatar
Felix Hummel committed
35 36
puddl config init
puddl db health
Felix Hummel's avatar
Felix Hummel committed
37 38
```

Felix Hummel's avatar
Felix Hummel committed
39 40
Try it:
```
Felix Hummel's avatar
oops  
Felix Hummel committed
41 42 43
puddl app add puddl.felix.file
puddl file db create

Felix Hummel's avatar
Felix Hummel committed
44 45
puddl file index README.md
puddl file ls
Felix Hummel's avatar
oops  
Felix Hummel committed
46

Felix Hummel's avatar
Felix Hummel committed
47
puddl db shell
Felix Hummel's avatar
Felix Hummel committed
48
```
Felix Hummel's avatar
Felix Hummel committed
49 50 51


# Development
Felix Hummel's avatar
Felix Hummel committed
52 53
Run flake8 before committing
```
Felix Hummel's avatar
Felix Hummel committed
54
ln -s $(readlink -m env/dev/git-hooks/pre-commit.sample) .git/hooks/pre-commit
Felix Hummel's avatar
Felix Hummel committed
55 56
```

Felix Hummel's avatar
Felix Hummel committed
57 58 59 60 61 62
Basic development workflow:
```
# hack, hack
make
```

Felix Hummel's avatar
Felix Hummel committed
63 64
Got `psql` installed?
```
Felix Hummel's avatar
Felix Hummel committed
65 66
source <(puddl db env)
echo "SELECT path, stat->>'st_uid' as uid FROM file.file" | psql
Felix Hummel's avatar
Felix Hummel committed
67
```