Address typing issues hidden by memoization.caching (#322)

This commit is contained in:
bmc-msft
2020-11-18 15:08:40 -05:00
committed by GitHub
parent bb6d083768
commit b2b4a06afa
5 changed files with 41 additions and 1 deletions

17
src/ci/enable-py-cache.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# Temporary work-around to improve the efficacy of static analysis of functions
# decorated with memoization.cached.
#
# For more information:
# https://github.com/lonelyenvoy/python-memoization/issues/16
set -ex
SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]})
sed -i "s/^##### from memoization import cached/from memoization import cached/" $(find . -name '*.py' -not -path .python_packages)
sed -i "s/^##### @cached/@cached/" $(find . -name '*.py' -not -path .python_packages)