Skip to content

Commit b78bb3a

Browse files
committed
Identify shell as bash and adjust sparse checkout to use a subshell.
1 parent 2eae850 commit b78bb3a

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

README.md

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,36 @@ the `ClientCannotConnectError`.
2828

2929
### Installation
3030

31-
Using PyPI.org:
31+
Using `pip` and [PyPI](https://PyPI.org):
3232

33-
$ pip install py-postgresql
33+
```bash
34+
python3 -m pip install py-postgresql
35+
```
3436

35-
From a clone:
37+
From [GitHub](https://github.com) using a full clone:
3638

37-
$ git clone https://github.com/python-postgres/fe.git
38-
$ cd fe
39-
$ python3 ./setup.py install # Or use in-place without installation(PYTHONPATH).
39+
```bash
40+
git clone https://github.com/python-postgres/fe.git
41+
cd fe
42+
python3 ./setup.py install
43+
```
4044

41-
Direct from a sparse checkout:
45+
From [GitHub](https://github.com) using a sparse checkout:
4246

43-
export BRANCH=v1.3
44-
export TARGET="$(pwd)/py-packages"
45-
export PYTHONPATH="$PYTHONPATH:$TARGET"
47+
```bash
48+
TARGET="$(pwd)/py-packages"
49+
export PYTHONPATH="$PYTHONPATH:$TARGET"
50+
(set -e
51+
BRANCH=v1.3
4652
git clone --origin=pypg-frontend --branch=$BRANCH \
4753
--sparse --filter=blob:none --no-checkout --depth=1 \
4854
https://github.com/python-postgres/fe.git "$TARGET"
49-
pushd "$TARGET"
55+
cd "$TARGET"
5056
git sparse-checkout set --no-cone postgresql
5157
git switch $BRANCH
52-
popd; unset TARGET BRANCH
58+
)
59+
unset TARGET
60+
```
5361

5462
### Basic Usage
5563

@@ -68,7 +76,9 @@ with db.xact():
6876

6977
REPL with connection bound to `db` builtin:
7078

71-
python3 -m postgresql.bin.pg_python -I 'pq://postgres@localhost:5423/postgres'
79+
```bash
80+
python3 -m postgresql.bin.pg_python -I 'pq://postgres@localhost:5423/postgres'
81+
```
7282

7383
### Documentation
7484

0 commit comments

Comments
 (0)