Skip to content

Commit

Permalink
Typo: s/get_depencies/get_dependencies/g
Browse files Browse the repository at this point in the history
Adds deprecation to keep the API for now until future removal.
  • Loading branch information
zmughal committed May 13, 2024
1 parent 1a16144 commit 8aac82f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* Deprecation of `LocalBB.get_depencies()`. Use `LocalBB.get_dependencies()` instead.
# 0.2.0

1. remove bb.load
Expand Down
24 changes: 18 additions & 6 deletions biobricks/local_bb.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,32 @@ def FromWorkingDirectory():
return LocalBB(cwd)
return None

def get_depencies(self):
"""get bricks from the local bb dependencies file"""
def get_dependencies(self):
"""Get bricks from the local bb dependencies file."""
lines = self.dependencies_path.open("r").readlines()
lines = [line.strip() for line in lines]
return [Brick.Resolve(line) for line in lines]

def get_depencies(self):
"""
Get bricks from the local bb dependencies file.
.. deprecated::
Replaced by `get_dependencies()`.
This method is deprecated. Use `get_dependencies()` instead.
"""
import warnings
warnings.warn("Method renamed to get_dependencies().", DeprecationWarning)
return self.get_dependencies()

def add_dependency(self, ref: str):
"""add a dependency to the local bb dependencies file"""

brickref = Brick.Resolve(ref)

# check if the added dependency already exists
bricknames = [brick.name for brick in self.get_depencies()]
bricknames = [brick.name for brick in self.get_dependencies()]

if brickref.name in bricknames:
raise ValueError(
Expand All @@ -50,7 +63,7 @@ def remove_dependency(self, ref: str):
brickref = Brick.Resolve(ref)

# Check if the dependency exists before attempting to remove it
current_dependencies = self.get_depencies()
current_dependencies = self.get_dependencies()
bricknames = [brick.name for brick in current_dependencies]

if brickref.name not in bricknames:
Expand All @@ -67,6 +80,5 @@ def remove_dependency(self, ref: str):

def install_dependencies(self):
"""install all dependencies"""
for brick in self.get_depencies():
for brick in self.get_dependencies():
brick.install()

0 comments on commit 8aac82f

Please sign in to comment.