1
0
Fork 0
mirror of https://github.com/actions/setup-python.git synced 2024-11-22 14:48:36 +00:00

Get poetry cache implementation when requested

This commit is contained in:
Patrick Arminio 2021-11-24 15:12:00 +00:00
parent 59cb3f4919
commit 95824fd246
No known key found for this signature in database
GPG key ID: 0B13AD30354F6EBE

View file

@ -1,9 +1,11 @@
import PipCache from './pip-cache'; import PipCache from './pip-cache';
import PipenvCache from './pipenv-cache'; import PipenvCache from './pipenv-cache';
import PoetryCache from './poetry-cache';
export enum PackageManagers { export enum PackageManagers {
Pip = 'pip', Pip = 'pip',
Pipenv = 'pipenv' Pipenv = 'pipenv',
Poetry = 'poetry'
} }
export function getCacheDistributor( export function getCacheDistributor(
@ -16,6 +18,8 @@ export function getCacheDistributor(
return new PipCache(pythonVersion, cacheDependencyPath); return new PipCache(pythonVersion, cacheDependencyPath);
case PackageManagers.Pipenv: case PackageManagers.Pipenv:
return new PipenvCache(pythonVersion, cacheDependencyPath); return new PipenvCache(pythonVersion, cacheDependencyPath);
case PackageManagers.Poetry:
return new PoetryCache(pythonVersion, cacheDependencyPath);
default: default:
throw new Error(`Caching for '${packageManager}' is not supported`); throw new Error(`Caching for '${packageManager}' is not supported`);
} }