File tree 4 files changed +14
-10
lines changed
4 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,8 @@ export enum State {
10
10
11
11
abstract class CacheDistributor {
12
12
protected CACHE_KEY_PREFIX = 'setup-python' ;
13
- constructor (
14
- protected packageManager : string ,
15
- protected cacheDependencyPath : string
16
- ) { }
13
+ protected abstract readonly packageManager : string ;
14
+ protected abstract readonly cacheDependencyPath : string ;
17
15
18
16
protected abstract getCacheGlobalDirectories ( ) : Promise < string [ ] > ;
19
17
protected abstract computeKeys ( ) : Promise < {
Original file line number Diff line number Diff line change @@ -12,12 +12,13 @@ import {CACHE_DEPENDENCY_BACKUP_PATH} from './constants';
12
12
13
13
class PipCache extends CacheDistributor {
14
14
private cacheDependencyBackupPath : string = CACHE_DEPENDENCY_BACKUP_PATH ;
15
+ protected readonly packageManager = 'pip' ;
15
16
16
17
constructor (
17
18
private pythonVersion : string ,
18
- cacheDependencyPath = '**/requirements.txt'
19
+ protected readonly cacheDependencyPath = '**/requirements.txt'
19
20
) {
20
- super ( 'pip' , cacheDependencyPath ) ;
21
+ super ( ) ;
21
22
}
22
23
23
24
protected async getCacheGlobalDirectories ( ) {
Original file line number Diff line number Diff line change @@ -6,11 +6,13 @@ import * as core from '@actions/core';
6
6
import CacheDistributor from './cache-distributor' ;
7
7
8
8
class PipenvCache extends CacheDistributor {
9
+ protected readonly packageManager = 'pipenv' ;
10
+
9
11
constructor (
10
12
private pythonVersion : string ,
11
- protected cacheDependencyPath : string = '**/Pipfile.lock'
13
+ protected readonly cacheDependencyPath : string = '**/Pipfile.lock'
12
14
) {
13
- super ( 'pipenv' , cacheDependencyPath ) ;
15
+ super ( ) ;
14
16
}
15
17
16
18
protected async getCacheGlobalDirectories ( ) {
Original file line number Diff line number Diff line change @@ -8,12 +8,15 @@ import CacheDistributor from './cache-distributor';
8
8
import { logWarning } from '../utils' ;
9
9
10
10
class PoetryCache extends CacheDistributor {
11
+ protected readonly packageManager = 'poetry' ;
12
+
13
+
11
14
constructor (
12
15
private pythonVersion : string ,
13
- protected cacheDependencyPath : string = '**/poetry.lock' ,
16
+ protected readonly cacheDependencyPath : string = '**/poetry.lock' ,
14
17
protected poetryProjects : Set < string > = new Set < string > ( )
15
18
) {
16
- super ( 'poetry' , cacheDependencyPath ) ;
19
+ super ( ) ;
17
20
}
18
21
19
22
protected async getCacheGlobalDirectories ( ) {
You can’t perform that action at this time.
0 commit comments