Extract cache directory name in a constant

GitOrigin-RevId: 0b1fecbbae5032d34cb81c683154fdf5d1860987
This commit is contained in:
Mikhail Golubev
2019-06-10 19:47:30 +03:00
committed by intellij-monorepo-bot
parent cf5a86d687
commit e805c345e2
3 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -511,7 +511,7 @@ def process_one(name, mod_file_name, doing_builtins, sdk_skeletons_dir):
sdk_skeletons_dir = sdk_skeletons_dir.rstrip(os.path.sep)
try:
python_stubs_dir = os.path.dirname(sdk_skeletons_dir)
global_cache_dir = os.path.join(python_stubs_dir, 'cache')
global_cache_dir = os.path.join(python_stubs_dir, CACHE_DIR_NAME)
mod_cache_dir = build_cache_dir_path(global_cache_dir, name, mod_file_name)
# At the moment this is actually enforced on Java-side
if not should_update_skeleton(sdk_skeletons_dir, name, mod_file_name):
@@ -812,4 +812,7 @@ BLACKLIST_VERSION_LINE = re.compile(r'(?P<path>[^=]+) = (?P<version>\d+\.\d+) (?
ENV_TEST_MODE_FLAG = 'GENERATOR3_TEST_MODE'
ENV_VERSION = 'GENERATOR3_VERSION'
ENV_REQUIRED_GEN_VERSION_FILE = 'GENERATOR3_REQUIRED_GEN_VERSION_FILE'
FAILED_VERSION_STAMP_PREFIX = '.failed__'
CACHE_DIR_NAME = 'cache'
@@ -11,6 +11,7 @@ from pycharm_generator_utils.constants import (
ENV_TEST_MODE_FLAG,
ENV_VERSION,
ENV_REQUIRED_GEN_VERSION_FILE,
CACHE_DIR_NAME,
)
from pycharm_generator_utils.test import GeneratorTestCase
@@ -95,7 +96,7 @@ class SkeletonCachingTest(GeneratorTestCase):
@property
def temp_cache_dir(self):
return os.path.join(self.temp_dir, self.PYTHON_STUBS_DIR, 'cache')
return os.path.join(self.temp_dir, self.PYTHON_STUBS_DIR, CACHE_DIR_NAME)
@staticmethod
def imported_module_path(mod_qname, extra_syspath_entry):