davebshow / goblin

A Python 3.5 rewrite of the TinkerPop 3 OGM Goblin
Other
93 stars 21 forks source link

Issues with Sphinx: `VertexProperty` Missing Attribute #52

Closed rosenbrockc closed 7 years ago

rosenbrockc commented 7 years ago

Build failure in sphinx:

  File "/lib/python3.5/site-packages/sphinx/ext/autodoc.py", line 862, in filter_members
    not keep, self.options)
  File "/lib/python3.5/site-packages/sphinx/application.py", line 593, in emit_firstresult
    for result in self.emit(event, *args):
  File "/lib/python3.5/site-packages/sphinx/application.py", line 589, in emit
    results.append(callback(self, *args))
  File "/lib/python3.5/site-packages/sphinxcontrib/napoleon/__init__.py", line 428, in _skip_member
    qualname = getattr(obj, '__qualname__', '')
  File "/lib/python3.5/site-packages/goblin/element.py", line 211, in __repr__
    self._data_type, self.value)
  File "/lib/python3.5/site-packages/goblin/element.py", line 194, in getvalue
    return self._val
AttributeError: 'SubOption' object has no attribute '_val'

SubOption is a sub-class of VertexProperty:

class SubOption(goblin.VertexProperty):
    a = goblin.Property(goblin.Boolean, default=True)
    b = goblin.Property(goblin.Boolean, default=True)

I hacked element.py to get my build to pass by adding self._val = None to the class initializer for VertexProperty (https://github.com/davebshow/goblin/blob/master/goblin/element.py#L183).

davebshow commented 7 years ago

Good catch. Do you mind submitting a PR with this change and maybe a simple test?