-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDependency.py
33 lines (29 loc) · 1.14 KB
/
Dependency.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
##############################################################################
# Copyright (c) 2019 by Paul Scherrer Institute, Switzerland
# All rights reserved.
# Authors: Oliver Bruendler
##############################################################################
import os
from .VersionNr import VersionNr
class Dependency:
"""
This class describes a dependency
"""
def __init__(self, libraryName : str, url : str, relativePath : str, minVersion : str):
"""
Constructor
:param libraryName: Name of the library
:param url: Url of the remote git repo
:param relativePath: Path relative to the library the dependencies are resolved for
:param minVersion: Minimum required version
"""
self.libraryName = libraryName
self.url = url
self.relativePath = relativePath
self.minVersion = VersionNr(minVersion)
def GetParentDir(self) -> str:
"""
Get parent directory
:return: Parent directory of this dependency relative to the library the dependencies are resolved for
"""
return os.path.dirname(self.relativePath)