File: play_out_381.bash

package info (click to toggle)
setuptools-scm 8.2.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 584 kB
  • sloc: python: 4,567; sh: 27; makefile: 6
file content (23 lines) | stat: -rwxr-xr-x 577 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash
set -euxo pipefail

rm -rf y z home venv tmp

[ ! -d black ] && git clone https://github.com/psf/black
export SETUPTOOLS_SCM_DEBUG=1
export PRE_COMMIT_HOME="$PWD/home"
export TMPDIR="$PWD/tmp"

git init y
git init z
git -C z commit --allow-empty -m 'commit!'
git -C y submodule add "$PWD/z"
cat > "$PWD/y/.git/modules/z/hooks/pre-commit" <<EOF
#!/usr/bin/env bash
virtualenv "$PWD/venv"
"$PWD/venv/bin/pip" install -e "$1"
"$PWD/venv/bin/pip" install --no-clean "$PWD/black"
EOF
chmod +x "$PWD/y/.git/modules/z/hooks/pre-commit"
cd y/z
git commit -m "test"