(venv: str)
| 37 | |
| 38 | |
| 39 | def get_env_patch(venv: str) -> PatchesT: |
| 40 | if sys.platform == 'cygwin': # pragma: no cover |
| 41 | _, win_venv, _ = cmd_output('cygpath', '-w', venv) |
| 42 | install_prefix = fr'{win_venv.strip()}\bin' |
| 43 | lib_dir = 'lib' |
| 44 | elif sys.platform == 'win32': # pragma: no cover |
| 45 | install_prefix = bin_dir(venv) |
| 46 | lib_dir = 'Scripts' |
| 47 | else: # pragma: win32 no cover |
| 48 | install_prefix = venv |
| 49 | lib_dir = 'lib' |
| 50 | return ( |
| 51 | ('NODE_VIRTUAL_ENV', venv), |
| 52 | ('NPM_CONFIG_PREFIX', install_prefix), |
| 53 | ('npm_config_prefix', install_prefix), |
| 54 | ('NPM_CONFIG_USERCONFIG', UNSET), |
| 55 | ('npm_config_userconfig', UNSET), |
| 56 | ('NODE_PATH', os.path.join(venv, lib_dir, 'node_modules')), |
| 57 | ('PATH', (bin_dir(venv), os.pathsep, Var('PATH'))), |
| 58 | ) |
| 59 | |
| 60 | |
| 61 | @contextlib.contextmanager |
no test coverage detected