|
|
@@ -79,11 +79,11 @@ def check_git_status(): |
|
|
|
print(e) |
|
|
|
|
|
|
|
|
|
|
|
def check_requirements(file='requirements.txt'): |
|
|
|
def check_requirements(file='requirements.txt', exclude=()): |
|
|
|
# Check installed dependencies meet requirements |
|
|
|
import pkg_resources |
|
|
|
requirements = pkg_resources.parse_requirements(Path(file).open()) |
|
|
|
requirements = [x.name + ''.join(*x.specs) if len(x.specs) else x.name for x in requirements] |
|
|
|
requirements = [f'{x.name}{x.specifier}' for x in pkg_resources.parse_requirements(Path(file).open()) |
|
|
|
if x.name not in exclude] |
|
|
|
pkg_resources.require(requirements) # DistributionNotFound or VersionConflict exception if requirements not met |
|
|
|
|
|
|
|
|