hetznercloud/hcloud-python

hcloud-python]$ make docs throws exception

doczkal opened this issue · 1 comments

Bug Report

Current Behavior
hcloud-python]$ make docs
make -C docs clean
[...]
Running Sphinx v3.5.4
making output directory... done
hcloud-python/docs/conf.py:166: RemovedInSphinx40Warning: The app.add_javascript() is deprecated. Please use app.add_js_file() instead.
app.add_javascript('js/open_links_in_new_tab.js')
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 21 source files that are out of date
updating environment: [new config] 21 added, 0 changed, 0 removed
reading sources... [100%] samples
WARNING: autodoc: failed to import class 'CertificateClient' from module 'hcloud.certificates.client'; the following exception was raised:
Traceback (most recent call last):
File "/app/hcloud-python/lib64/python3.8/site-packages/sphinx/util/inspect.py", line 403, in safe_getattr
return getattr(obj, name, *defargs)
AttributeError: module 'hcloud.certificates.client' has no attribute 'CertificateClient'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/app/hcloud-python/lib64/python3.8/site-packages/sphinx/ext/autodoc/importer.py", line 111, in import_object
obj = attrgetter(obj, mangled_name)
File "/app/hcloud-python/lib64/python3.8/site-packages/sphinx/ext/autodoc/init.py", line 320, in get_attr
return autodoc_attrgetter(self.env.app, obj, name, *defargs)
File "/app/hcloud-python/lib64/python3.8/site-packages/sphinx/ext/autodoc/init.py", line 2604, in autodoc_attrgetter
return safe_getattr(obj, name, *defargs)
File "/app/hcloud-python/lib64/python3.8/site-packages/sphinx/util/inspect.py", line 419, in safe_getattr
raise AttributeError(name) from exc
AttributeError: CertificateClient

hcloud-python/hcloud/certificates/client.py:docstring of hcloud.certificates.client.BoundCertificate.update:7: WARNING: Inline interpreted text or phrase reference start-string without end-string.
WARNING: error while formatting arguments for hcloud.firewalls.client.BoundFirewall.get_actions: Handler <function update_annotations_using_type_comments at 0x7f2220505b80> for event 'autodoc-before-process-signature' threw an exception (exception: list index out of range)
WARNING: error while formatting arguments for hcloud.floating_ips.client.BoundFloatingIP.get_actions: Handler <function update_annotations_using_type_comments at 0x7f2220505b80> for event 'autodoc-before-process-signature' threw an exception (exception: list index out of range)
hcloud-python/hcloud/floating_ips/client.py:docstring of hcloud.floating_ips.client.BoundFloatingIP.get_actions_list:5: WARNING: Definition list ends without a blank line; unexpected unindent.
hcloud-python/hcloud/images/client.py:docstring of hcloud.images.client.ImagesClient.get_by_id:4: WARNING: Inline interpreted text or phrase reference start-string without end-string.
WARNING: error while formatting arguments for hcloud.images.client.BoundImage.update: Handler <function update_annotations_using_type_comments at 0x7f2220505b80> for event 'autodoc-before-process-signature' threw an exception (exception: list index out of range)
hcloud-python/docs/api.clients.load_balancer_types.rst:2: WARNING: Title underline too short.

LoadBalancerTypesClient

hcloud-python/hcloud/load_balancers/client.py:docstring of hcloud.load_balancers.client.LoadBalancersClient.get_by_id:4: WARNING: Inline interpreted text or phrase reference start-string without end-string.
WARNING: autodoc: failed to import class 'LoadBalancerHealthCheckHttp' from module 'hcloud.load_balancers.domain'; the following exception was raised:
Traceback (most recent call last):
File "/app/hcloud-python/lib64/python3.8/site-packages/sphinx/util/inspect.py", line 403, in safe_getattr
return getattr(obj, name, *defargs)
AttributeError: module 'hcloud.load_balancers.domain' has no attribute 'LoadBalancerHealthCheckHttp'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/app/hcloud-python/lib64/python3.8/site-packages/sphinx/ext/autodoc/importer.py", line 111, in import_object
obj = attrgetter(obj, mangled_name)
File "/app/hcloud-python/lib64/python3.8/site-packages/sphinx/ext/autodoc/init.py", line 320, in get_attr
return autodoc_attrgetter(self.env.app, obj, name, *defargs)
File "/app/hcloud-python/lib64/python3.8/site-packages/sphinx/ext/autodoc/init.py", line 2604, in autodoc_attrgetter
return safe_getattr(obj, name, *defargs)
File "/app/hcloud-python/lib64/python3.8/site-packages/sphinx/util/inspect.py", line 419, in safe_getattr
raise AttributeError(name) from exc
AttributeError: LoadBalancerHealthCheckHttp

hcloud-python/hcloud/load_balancers/domain.py:docstring of hcloud.load_balancers.domain.LoadBalancerTarget:3: WARNING: Unexpected indentation.
hcloud-python/hcloud/load_balancers/domain.py:docstring of hcloud.load_balancers.domain.LoadBalancerTarget:4: WARNING: Block quote ends without a blank line; unexpected unindent.
hcloud-python/hcloud/load_balancers/domain.py:docstring of hcloud.load_balancers.domain.LoadBalancerTargetLabelSelector:3: WARNING: Unexpected indentation.
hcloud-python/hcloud/load_balancers/domain.py:docstring of hcloud.load_balancers.domain.LoadBalancerTargetIP:3: WARNING: Unexpected indentation.
hcloud-python/hcloud/load_balancers/domain.py:docstring of hcloud.load_balancers.domain.LoadBalancerAlgorithm:3: WARNING: Unexpected indentation.
hcloud-python/hcloud/networks/client.py:docstring of hcloud.networks.client.NetworksClient.get_by_id:4: WARNING: Inline interpreted text or phrase reference start-string without end-string.
hcloud-python/hcloud/ssh_keys/client.py:docstring of hcloud.ssh_keys.client.BoundSSHKey.update:7: WARNING: Inline interpreted text or phrase reference start-string without end-string.
WARNING: error while formatting arguments for hcloud.volumes.client.VolumesClient.get_actions: Handler <function update_annotations_using_type_comments at 0x7f2220505b80> for event 'autodoc-before-process-signature' threw an exception (exception: list index out of range)
WARNING: error while formatting arguments for hcloud.volumes.client.VolumesClient.get_actions_list: Handler <function update_annotations_using_type_comments at 0x7f2220505b80> for event 'autodoc-before-process-signature' threw an exception (exception: list index out of range)
hcloud-python/hcloud/volumes/client.py:docstring of hcloud.volumes.client.VolumesClient.get_actions:6: WARNING: Field list ends without a blank line; unexpected unindent.
hcloud-python/hcloud/volumes/client.py:docstring of hcloud.volumes.client.VolumesClient.get_actions:8: WARNING: Definition list ends without a blank line; unexpected unindent.
WARNING: error while formatting arguments for hcloud.volumes.client.BoundVolume.attach: Handler <function update_annotations_using_type_comments at 0x7f2220505b80> for event 'autodoc-before-process-signature' threw an exception (exception: list index out of range)
WARNING: error while formatting arguments for hcloud.volumes.client.BoundVolume.get_actions: Handler <function update_annotations_using_type_comments at 0x7f2220505b80> for event 'autodoc-before-process-signature' threw an exception (exception: list index out of range)
WARNING: error while formatting arguments for hcloud.volumes.client.BoundVolume.get_actions_list: Handler <function update_annotations_using_type_comments at 0x7f2220505b80> for event 'autodoc-before-process-signature' threw an exception (exception: list index out of range)
hcloud-python/hcloud/volumes/client.py:docstring of hcloud.volumes.client.BoundVolume.get_actions:5: WARNING: Field list ends without a blank line; unexpected unindent.
hcloud-python/hcloud/volumes/client.py:docstring of hcloud.volumes.client.BoundVolume.get_actions:7: WARNING: Definition list ends without a blank line; unexpected unindent.
../CONTRIBUTING.rst:122: WARNING: Literal block expected; none found.
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] samples
generating indices... genindex done
highlighting module code... [100%] hcloud.volumes.domain
writing additional pages... search done
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded, 27 warnings.

Expected behavior/code
no build errors for 'make docs'

Environment

  • Python Version: v3.8.8
  • Hcloud-Python Version: v.1.12.0

Hey @doczkal,

thank you for the report! I have fixed the issues in the MR #128.