Implementation of python's caching (#266)

This commit is contained in:
Dmitry Shibanov authored and GitHub committed 2021-11-17 13:31:22 +03:00
1 parent 52636cf49a
commit 280924fbef
75 files changed
+126753 -7699

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
import PipCache from './pip-cache';
import PipenvCache from './pipenv-cache';
export enum PackageManagers {
Pip = 'pip',
Pipenv = 'pipenv'
}
export function getCacheDistributor(
packageManager: string,
pythonVersion: string,
cacheDependencyPath: string | undefined
) {
switch (packageManager) {
case PackageManagers.Pip:
return new PipCache(cacheDependencyPath);
case PackageManagers.Pipenv:
return new PipenvCache(pythonVersion, cacheDependencyPath);
default:
throw new Error(`Caching for '${packageManager}' is not supported`);
}
}