diff options
author | Joris Roovers <joris.roovers@gmail.com> | 2020-02-26 12:31:53 +0100 |
---|---|---|
committer | Joris Roovers <joris.roovers@gmail.com> | 2020-02-26 12:31:53 +0100 |
commit | fadf697f09b4f69703b1fa6ecbfc9d8f6d991b08 (patch) | |
tree | 1a88512f5d7f621f18a637534f9f8712ef124433 | |
parent | 4acc477a19b772e8298e5dac72903e684ab215ad (diff) |
./run_tests.sh tweaks
Most importantly, a fix to properly deactivate virtualenv.
-rw-r--r-- | CHANGELOG.md | 5 | ||||
-rw-r--r-- | gitlint/__init__.py | 2 | ||||
-rwxr-xr-x | run_tests.sh | 18 |
3 files changed, 22 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index fab3426..0a3991d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog # +## v0.13.1 (2020-02-26) + +- Patch to enable `--staged` flag for pre-commit. +- Minor doc updates ([#109](https://github.com/jorisroovers/gitlint/issues/109)) + ## v0.13.0 (2020-02-25) - **Behavior Change**: Revert Commits are now recognized and ignored by default ([#99](https://github.com/jorisroovers/gitlint/issues/99)) diff --git a/gitlint/__init__.py b/gitlint/__init__.py index 54330e1..d36f922 100644 --- a/gitlint/__init__.py +++ b/gitlint/__init__.py @@ -1 +1 @@ -__version__ = "0.14.0dev" +__version__ = "0.13.1dev" diff --git a/run_tests.sh b/run_tests.sh index 2e9b260..23ccb37 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -109,6 +109,10 @@ run_integration_tests(){ # virtualenv's python binary path. export GIT_EXEC_PATH="$PATH" + echo "" + gitlint --version + echo -e "Using $(which gitlint)\n" + # py.test -s => print standard output (i.e. show print statement output) # -rw => print warnings target=${testargs:-"qa/"} @@ -256,12 +260,12 @@ install_virtualenv(){ # For pypy: custom path + fetch from the web if not installed (=distro agnostic) if [[ $version == *"pypy2"* ]]; then - python_binary="/opt/pypy2.7-v7.1.1-linux64/bin/pypy" + python_binary="/opt/pypy2.7-v7.3.0-linux64/bin/pypy" if [ ! -f $python_binary ]; then assert_root "Must be root to install pypy2.7, use sudo" title "### DOWNLOADING PYPY2 ($pypy_archive) ###" pushd "/opt" - pypy_archive="pypy2.7-v7.1.1-linux64.tar.bz2" + pypy_archive="pypy2.7-v7.3.0-linux64.tar.bz2" wget "https://bitbucket.org/pypy/pypy/downloads/$pypy_archive" title "### EXTRACTING PYPY TARBALL ($pypy_archive) ###" tar xvf $pypy_archive @@ -373,7 +377,17 @@ assert_specific_env(){ switch_env(){ if [ "$1" != "default" ]; then + # If we activated a virtualenv within this script, deactivate it deactivate 2> /dev/null # deactivate any active environment + + # If this script was run from within an existing virtualenv, manually remove the current VIRTUAL_ENV from the + # current path. This ensures that our PATH is clean of that virtualenv. + # Note that the 'deactivate' function from the virtualenv is not available here unless the script was invoked + # as 'source ./run_tests.sh'). + # Thanks internet stranger! https://unix.stackexchange.com/a/496050/38465 + if [ ! -z "$VIRTUAL_ENV" ]; then + export PATH=$(echo $PATH | tr ":" "\n" | grep -v "$VIRTUAL_ENV" | tr "\n" ":"); + fi set -e # Let's error out if you try executing against a non-existing env source "/vagrant/.venv${1}/bin/activate" set +e |