Skip to content

Commit 546b6dc

Browse files
committed
Use git-select, frighteningly, from curl; rewrite sparse checkout installation to be limited to the subshell.
1 parent c92675b commit 546b6dc

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

README.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,18 @@ cd fe
4242
python3 ./setup.py install
4343
```
4444

45-
From [GitHub](https://github.com) using a sparse checkout:
45+
From [GitHub](https://github.com) using a temporary installation scoped to a subshell:
4646

4747
```bash
48-
TARGET="$(pwd)/py-packages"
49-
export PYTHONPATH="$PYTHONPATH:$TARGET"
50-
(set -e
51-
BRANCH=v1.3
52-
git clone --origin=pypg-frontend --branch=$BRANCH \
53-
--sparse --filter=blob:none --no-checkout --depth=1 \
54-
https://github.com/python-postgres/fe.git "$TARGET"
55-
cd "$TARGET"
56-
git sparse-checkout set --no-cone postgresql
57-
git switch $BRANCH
58-
)
59-
unset TARGET
48+
(PYTMPPKG="$(mktemp -d)"
49+
export PYTHONPATH="$PYTHONPATH:$PYTMPPKG"
50+
curl -s https://raw.githubusercontent.com/jwp/git-select/main/git-select.py | \
51+
python3 /dev/stdin \
52+
https://github.com/python-postgres/fe master "postgresql/./$PYTMPPKG/"
53+
python3 -c "import postgresql.project as pj; print(); print('py-postgresql:', pj.version)"
54+
export pg_console="postgresql.bin.pg_python"
55+
echo ': python3 -m $pg_console'
56+
$SHELL)
6057
```
6158

6259
### Basic Usage

0 commit comments

Comments
 (0)