Skip to content

Commit

Permalink
Check objects type rather than None for deps and properties
Browse files Browse the repository at this point in the history
 * this allow subclasses working without clients to override the
   _get_pom_factory method and return plain artifacts from coordinates
   rather than full Pom objects when there is no client to retrieve an
   artifact remotely.

Link: sassoftware#3
Link: sassoftware#4

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
  • Loading branch information
pombredanne committed Jun 9, 2017
1 parent f99a287 commit 4db7bd1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pymaven/pom.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def dependencies(self):
dependencies = {}

# we depend on our parent
if self.parent is not None:
if isinstance(self.parent, Pom):
group = self.parent.group_id
artifact = self.parent.artifact_id
version = self.parent.version
Expand All @@ -305,7 +305,7 @@ def dependency_management(self):
dep_mgmt = {}

# add parent's block first so we can override it
if self.parent is not None:
if isinstance(self.parent, Pom):
dep_mgmt.update(self.parent.dependency_management)

dep_mgmt.update(self._find_dependency_management())
Expand All @@ -329,8 +329,9 @@ def parent(self):
def properties(self):
properties = {}

if self.parent is not None:
if isinstance(self.parent, Pom):
properties.update(self.parent.properties)
if isinstance(self.parent, Artifact):
properties['parent.groupId'] = self.parent.group_id
properties['parent.artifactId'] = self.parent.artifact_id
properties['parent.version'] = str(self.parent.version)
Expand Down

0 comments on commit 4db7bd1

Please sign in to comment.