ionelmc / python-hunter

Hunter is a flexible code tracing toolkit.
https://python-hunter.readthedocs.io/
BSD 2-Clause "Simplified" License
794 stars 46 forks source link

3.4.3: sphins warnings and call trace #108

Open kloczek opened 2 years ago

kloczek commented 2 years ago

Looks like it is some issue on rendering dosumentation

+ /usr/bin/python3 setup.py build_sphinx -b man --build-dir build/sphinx
/usr/lib/python3.8/site-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.16.0-unknown is an invalid version and will not be supported in a future release
  warnings.warn(
/usr/lib/python3.8/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
  warnings.warn(
WARNING: The wheel package is not available.
running build_sphinx
Running Sphinx v4.3.2
/usr/lib/python3.8/site-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.16.0-unknown is an invalid version and will not be supported in a future release
  warnings.warn(
Traceback (most recent call last):
  File "/home/tkloczko/rpmbuild/BUILD/python-hunter-3.4.3/docs/conf.py", line 34, in <module>
    version = release = get_distribution('hunter').version
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 471, in get_distribution
    dist = get_provider(dist)
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 347, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 891, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 777, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'hunter' distribution was not found and is required by the application
making output directory... done
[autosummary] generating autosummary for: authors.rst, changelog.rst, configuration.rst, contributing.rst, cookbook.rst, filtering.rst, index.rst, installation.rst, introduction.rst, readme.rst, reference.rst, remote.rst
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 12 added, 0 changed, 0 removed
reading sources... [100%] remote
README.rst:79: WARNING: duplicate label readme:overview, other instance in /home/tkloczko/rpmbuild/BUILD/python-hunter-3.4.3/docs/readme.rst
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-hunter.3 { readme installation introduction remote configuration filtering cookbook reference contributing authors changelog } done
build succeeded, 1 warning.
ionelmc commented 2 years ago

Because the docs include a reference section generated from docstrings and such the package needs to be importable in the sphinx env.

kloczek commented 2 years ago

Nope This not because of that. Small fix for that to allow generate documentation out of only source tree without forcing module to be installed:

--- a/docs/conf.py~     2021-12-15 17:43:12.000000000 +0000
+++ b/docs/conf.py      2022-01-04 04:07:58.264017243 +0000
@@ -2,8 +2,11 @@
 from __future__ import unicode_literals

 import os
+import sys
 import traceback

+sys.path.append(os.path.abspath('../src'))
+
 import sphinx_py3doc_enhanced_theme

 os.environ['PUREPYTHONHUNTER'] = 'yes'

That kind of fix is suggested in sphinx example copy.py https://www.sphinx-doc.org/en/master/usage/configuration.html#example-of-configuration-file

Than with that patch .. On building my packages I'm using sphinx-build command with -n switch which shows warmings about missing references. These are not critical issues. Here is the output with warnings:

+ /usr/bin/sphinx-build -n -T -b man docs build/sphinx/man
Running Sphinx v4.5.0
making output directory... done
[autosummary] generating autosummary for: authors.rst, changelog.rst, configuration.rst, contributing.rst, cookbook.rst, filtering.rst, index.rst, installation.rst, introduction.rst, readme.rst, reference.rst, remote.rst
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 12 added, 0 changed, 0 removed
reading sources... [100%] remote
README.rst:79: WARNING: duplicate label readme:overview, other instance in /home/tkloczko/rpmbuild/BUILD/python-hunter-3.4.3/docs/readme.rst
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-hunter.3 { readme installation introduction remote configuration filtering cookbook reference contributing authors changelog } /home/tkloczko/rpmbuild/BUILD/python-hunter-3.4.3/docs/introduction.rst:18: WARNING: py:obj reference target not found: hunter.Event
/home/tkloczko/rpmbuild/BUILD/python-hunter-3.4.3/docs/introduction.rst:22: WARNING: py:class reference target not found: hunter.When
/home/tkloczko/rpmbuild/BUILD/python-hunter-3.4.3/docs/reference.rst:33:<autosummary>:1: WARNING: py:obj reference target not found: hunter.CodePrinter
/home/tkloczko/rpmbuild/BUILD/python-hunter-3.4.3/src/hunter/actions.py:docstring of hunter.actions.CallPrinter:1: WARNING: py:obj reference target not found: hunter.CodePrinter
/home/tkloczko/rpmbuild/BUILD/python-hunter-3.4.3/src/hunter/predicates.py:docstring of hunter.predicates.Backlog:11: WARNING: py:class reference target not found: hunter.When
docstring of hunter.event.Event.function_object:9: WARNING: py:class reference target not found: function
docstring of hunter.event.Event.instruction:4: WARNING: py:class reference target not found: single char string
/home/tkloczko/rpmbuild/BUILD/python-hunter-3.4.3/src/hunter/tracer.py:docstring of hunter.tracer.Tracer.handler:1: WARNING: py:func reference target not found: hunter.Tracer.trace
/home/tkloczko/rpmbuild/BUILD/python-hunter-3.4.3/src/hunter/tracer.py:docstring of hunter.tracer.Tracer.previous:1: WARNING: py:func reference target not found: hunter.Tracer.trace
CHANGELOG.rst:144: WARNING: py:func reference target not found: hunter.load_config
CHANGELOG.rst:268: WARNING: py:attr reference target not found: hunter.event.Event.count
CHANGELOG.rst:292: WARNING: py:attr reference target not found: hunter.event.Event.thread
CHANGELOG.rst:300: WARNING: py:attr reference target not found: hunter.event.Event.handler
CHANGELOG.rst:428: WARNING: py:attr reference target not found: hunter.event.Event.line
done
build succeeded, 15 warnings.

You can peak on fixes that kind of issues in other projects https://github.com/latchset/jwcrypto/pull/289 https://github.com/click-contrib/sphinx-click/commit/abc31069