diff --git a/.dockerignore b/.dockerignore index 3eea7d59c..d08d582f5 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,7 +1,6 @@ * !git_machete/ -!git-machete !MANIFEST.in !README.md !requirements.txt diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 5bf3ac732..ad8841584 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -3,6 +3,7 @@ ## New in git-machete 3.17.2 - fixed: when `origin/feature/foo` branch exists, `git machete add foo` no longer falsely recognizes `origin/feature/foo` as a potential remote tracking branch for `foo` +- fixed: on Windows, git-machete installed globally via `pip` no longer crashes on `ModuleNotFoundError` within venvs (contributed by @cspotcode) ## New in git-machete 3.17.1 diff --git a/ci/checks/enforce-indent-two-spaces-outside-python.sh b/ci/checks/enforce-indent-two-spaces-outside-python.sh index 6f8b6e297..3e8bfb303 100755 --- a/ci/checks/enforce-indent-two-spaces-outside-python.sh +++ b/ci/checks/enforce-indent-two-spaces-outside-python.sh @@ -5,5 +5,5 @@ set -e -o pipefail -u self_dir=$(cd "$(dirname "$0")" &>/dev/null; pwd -P) self_name=$(basename -s .sh "$0") -git ls-files ':!*.awk' ':!/.circleci/config.yml' ':!*/Dockerfile' ':!docs/*' ':!*.gif' ':!git-machete' ':!graphics/setup-sandbox' ':!*.md' ':!*.png' ':!*.py' ':!*.svg' \ +git ls-files ':!*.awk' ':!/.circleci/config.yml' ':!*/Dockerfile' ':!docs/*' ':!*.gif' ':!graphics/setup-sandbox' ':!*.md' ':!*.png' ':!*.py' ':!*.svg' \ | xargs awk -f "$self_dir/$self_name.awk" diff --git a/git_machete/bin.py b/git_machete/bin.py index b2bc57295..5f6d780e6 100644 --- a/git_machete/bin.py +++ b/git_machete/bin.py @@ -1,15 +1,16 @@ -# flake8: noqa import sys +# Since this shim needs to be compatible with Python 2, +# let's skip mypy checks, as type annotations were only introduced in Python 3.5. -def main(): - # Check for correct python version - # Since function below needs to be compatible with python 2, lets skip Mypy checks, cause type annotations were introduced in python 3.5 + +def main(): # type: ignore def validate_python_version(): # type: ignore if sys.version_info[:2] < (3, 6): - version_str = "{}.{}.{}".format(sys.version_info.major, sys.version_info.minor, sys.version_info.micro) + # String interpolations were only introduced in Python 3.6 + version_str = "{}.{}.{}".format(sys.version_info.major, sys.version_info.minor, sys.version_info.micro) # noqa: FS002 sys.stderr.write( - "Python {} is no longer supported. \n".format(version_str) + + "Python {} is no longer supported. \n".format(version_str) + # noqa: FS002 "Please switch to Python 3.6 or higher.\n") sys.exit(1) diff --git a/mypy.ini b/mypy.ini index c5d27b915..32bad6c42 100644 --- a/mypy.ini +++ b/mypy.ini @@ -6,7 +6,6 @@ disallow_subclassing_any = True disallow_untyped_calls = True disallow_untyped_decorators = True disallow_untyped_defs = True -exclude = git_machete/bin.py follow_imports = normal no_implicit_optional = True strict_optional = True diff --git a/tox.ini b/tox.ini index a163febc7..c5ce8c3fb 100644 --- a/tox.ini +++ b/tox.ini @@ -16,7 +16,7 @@ deps = allowlist_externals = mkdir commands = mkdir -p test-results/ - pytest -rP --numprocesses=auto --junitxml=test-results/testenv-{envname}.xml {posargs} + pytest --numprocesses=auto --junitxml=test-results/testenv-{envname}.xml {posargs} [testenv:py36] deps =