MCPcopy
hub / github.com/pex-tool/pex / load

Method load

pex/tools/commands/venv.py:48–60  ·  view source on GitHub ↗
(cls, venv_dir)

Source from the content-addressed store, hash-verified

46class InstallScopeState(object):
47 @classmethod
48 def load(cls, venv_dir):
49 # type: (str) -> InstallScopeState
50
51 state_file = os.path.join(venv_dir, ".pex-venv-scope")
52 prior_state = None # type: Optional[InstallScope.Value]
53 try:
54 with open(state_file) as fp:
55 prior_state = InstallScope.for_value(fp.read().strip())
56 except IOError as e:
57 if e.errno != errno.ENOENT:
58 raise e
59
60 return cls(venv_dir=venv_dir, state_file=state_file, prior_state=prior_state)
61
62 venv_dir = attr.ib() # type: str
63 _state_file = attr.ib() # type: str

Callers 3

_extract_wheelFunction · 0.45
runMethod · 0.45
expose_installed_wheelsFunction · 0.45

Calls 4

stripMethod · 0.80
joinMethod · 0.45
for_valueMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected