Skip to content

Commit

Permalink
add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Jan 17, 2024
1 parent 70d60a1 commit 599588b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions dcor_control/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ def get_max_compatible_version(name, ckan_version=None):
- if current CKAN matches or is newer, return None
- if current version is lower (compatibility mode), return the
latest package version listed in `compatible_versions.txt`
Parameters
----------
name: str
Name of the package to install, e.g. "ckanext.dc_log_view"
ckan_version: str
CKAN version to consider (used in testing). If not provided,
the currently installed CKAN version is used.
"""
# parse ``resources/compatible_versions.txt``
compatible_versions = parse_compatible_versions()
Expand All @@ -45,6 +53,7 @@ def get_max_compatible_version(name, ckan_version=None):


def get_package_version(name):
"""Return version string of an installed Python package, None otherwise"""
try:
info = sp.check_output(f"pip show {name}", shell=True).decode("utf-8")
except sp.CalledProcessError:
Expand Down

0 comments on commit 599588b

Please sign in to comment.