Textualize / rich

Rich is a Python library for rich text and beautiful formatting in the terminal.
https://rich.readthedocs.io/en/latest/
MIT License
49.38k stars 1.72k forks source link

[BUG] 10.5.0: sphinx 4.0.2 warnings #1328

Closed kloczek closed 3 years ago

kloczek commented 3 years ago

1) it is not possible to generate documentation before install rich module or unpack it.

[tkloczko@barrel rich-10.5.0]$ make -C docs man
make: Entering directory '/home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs'
Running Sphinx v4.0.2

Configuration error:
There is a programmable error in your configuration file:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/config.py", line 323, in eval_config_file
    exec(code, namespace)
  File "/home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/conf.py", line 34, in <module>
    release = pkg_resources.get_distribution("rich").version
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 482, in get_distribution
    dist = get_provider(dist)
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 358, 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 901, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 787, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'rich' distribution was not found and is required by the application

make: *** [Makefile:20: man] Error 2

2) sphinx 4.0.2 shows some warnings

Running Sphinx v4.0.2
WARNING: html_static_path entry '_static' does not exist
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 61 added, 0 changed, 0 removed
reading sources... [100%] tree
/home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/live.rst:73: WARNING: duplicate label alternate screen, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/console.rst
/home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/pretty.rst:215: WARNING: duplicate label example, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/layout.rst
/home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/progress.rst:20: WARNING: duplicate label basic usage, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/live.rst
/home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/progress.rst:87: WARNING: duplicate label auto refresh, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/live.rst
/home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/progress.rst:101: WARNING: duplicate label columns, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/columns.rst
/home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/progress.rst:154: WARNING: duplicate label print / log, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/live.rst
/home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/progress.rst:175: WARNING: duplicate label redirecting stdout / stderr, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/live.rst
/home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/progress.rst:198: WARNING: duplicate label example, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/pretty.rst
/home/tkloczko/rpmbuild/BUILDROOT/python-rich-10.5.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/rich/console.py:docstring of rich.console.Console.render_lines:12: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/reference/logging.rst:4: WARNING: duplicate label logging, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/console.rst
/home/tkloczko/rpmbuild/BUILDROOT/python-rich-10.5.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/rich/segment.py:docstring of rich.segment.Segment.set_shape:9: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/style.rst:5: WARNING: duplicate label styles, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/style.rst
/home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/syntax.rst:2: WARNING: duplicate label syntax, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/markup.rst
/home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/tree.rst:2: WARNING: duplicate label tree, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/layout.rst
/home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/tree.rst:42: WARNING: duplicate label examples, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.5.0/docs/source/live.rst
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-rich.3 { introduction console style markup text highlighting pretty logging traceback prompt columns group markdown padding panel progress syntax tables tree live layout protocol reference reference/align reference/bar reference/color reference/columns reference/console reference/emoji reference/highlighter reference/init reference/layout reference/live reference/logging reference/markdown reference/markup reference/measure reference/padding reference/panel reference/pretty reference/progress_bar reference/progress reference/prompt reference/protocol reference/rule reference/segment reference/spinner reference/status reference/style reference/styled reference/syntax reference/table reference/text reference/theme reference/traceback reference/tree reference/abc appendix appendix/box appendix/colors } done
build succeeded, 16 warnings.
willmcgugan commented 3 years ago

That is correct. The docs are generated from the code. The docs are online https://rich.readthedocs.io/en/stable/index.html

kloczek commented 3 years ago

And if you will try to generate that documentation usinhg latest sphinx you will see those warnings as well.

I've not been sasking where is published rich module documentation ..

willmcgugan commented 3 years ago

You haven’t actually asked me anything @kloczek

kloczek commented 3 years ago

Of course that I've not been asking you about anything. I've reported the issue.

kloczek commented 3 years ago

Just FTR current list of sphinx warnings for 10.8.0

running build_sphinx
Running Sphinx v4.1.2
making output directory... done
WARNING: html_static_path entry '_static' does not exist
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 62 added, 0 changed, 0 removed
reading sources... [100%] tree
/home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/live.rst:73: WARNING: duplicate label alternate screen, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/console.rst
/home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/pretty.rst:238: WARNING: duplicate label example, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/layout.rst
/home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/progress.rst:20: WARNING: duplicate label basic usage, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/live.rst
/home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/progress.rst:87: WARNING: duplicate label auto refresh, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/live.rst
/home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/progress.rst:101: WARNING: duplicate label columns, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/columns.rst
/home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/progress.rst:154: WARNING: duplicate label print / log, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/live.rst
/home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/progress.rst:175: WARNING: duplicate label redirecting stdout / stderr, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/live.rst
/home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/progress.rst:198: WARNING: duplicate label example, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/pretty.rst
/home/tkloczko/rpmbuild/BUILD/rich-10.8.0/rich/console.py:docstring of rich.console.Console.render_lines:12: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/reference/logging.rst:4: WARNING: duplicate label logging, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/console.rst
/home/tkloczko/rpmbuild/BUILD/rich-10.8.0/rich/segment.py:docstring of rich.segment.Segment.set_shape:9: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/style.rst:5: WARNING: duplicate label styles, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/style.rst
/home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/syntax.rst:2: WARNING: duplicate label syntax, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/markup.rst
/home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/tree.rst:2: WARNING: duplicate label tree, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/layout.rst
/home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/tree.rst:42: WARNING: duplicate label examples, other instance in /home/tkloczko/rpmbuild/BUILD/rich-10.8.0/docs/source/live.rst
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-rich.3 { introduction console style markup text highlighting pretty logging traceback prompt columns group markdown padding panel progress syntax tables tree live layout protocol reference reference/align reference/bar reference/color reference/columns reference/console reference/emoji reference/highlighter reference/init reference/json reference/layout reference/live reference/logging reference/markdown reference/markup reference/measure reference/padding reference/panel reference/pretty reference/progress_bar reference/progress reference/prompt reference/protocol reference/rule reference/segment reference/spinner reference/status reference/style reference/styled reference/syntax reference/table reference/text reference/theme reference/traceback reference/tree reference/abc appendix appendix/box appendix/colors } done
build succeeded, 16 warnings.
kloczek commented 3 years ago

Just checked 10.10.0 and looks like still sphinx shows the same warnings :(

willmcgugan commented 3 years ago

Why does it matter to you? Docs build fine.

kloczek commented 3 years ago

Because during packagin python modules I'm building every module documentation as man page. Here is the resiult

[tkloczko@barrel SPECS]$ man python-<tab><tab>
Display all 296 possibilities? (y or n)
python-aioresponses                       python-flask-sqlalchemy                   python-nose2                              python-service-identity
python-amqp                               python-flexmock                           python-notebook                           python-setuptools
python-anyiodoc                           python-flit                               python-numpydoc                           python-simpleline
python-anytree                            python-fonttools                          python-olefile                            python-six
python-argcomplete                        python-future                             python-openstackdocstheme                 python-smartypants
python-argon2-cffi                        python-gcovr                              python-outcome                            python-smmap.tex
python-arrow                              python-gidocgen                           python-paramiko                           python-sniffio
python-asgi                               python-gitdb                              python-parso                              python-sos
python-aspectlib                          python-gitpython                          python-parver                             python-sphinx-argparse
python-astor                              python-graphviz                           python-paste                              python-sphinx-click
python-astroid                            python-greenlet                           python-paste-deploy                       python-sphinxcontrib-asyncio
python-async_generator                    python-h11                                python-path                               python-sphinxcontrib-autoprogram
python-atomicwrites                       python-h2                                 python-pathspec                           python-sphinxcontrib-bibtex
python-attrs                              python-hacking                            python-pep517                             python-sphinxcontrib-httpdomain
python-augeas                             python-hijri-converter                    python-pillow                             python-sphinxcontrib-programoutput
python-autoapi                            python-hpack                              python-platformdirs                       python-sphinxcontrib-trio
python-autodocsumm                        python-html5lib                           python-pluggy                             python-sphinxcopybutton
python-automat                            python-httpcore                           python-polib                              python-sphinxext-opengraph
python-babel                              python-httplib2                           python-portend                            python-sphinx-inline-tabs
python-backcall                           python-httpretty                          python-prb                                python-sphinx-readable-heme
python-backports.entry-points-selectable  python-hypercorn                          python-priority                           python-sphinx-removed-in
python-beautifulsoup                      python-hyperframe                         python-productmd-compose                  python-sphinx_rtd_theme
python-benchmark                          python-hyperlink                          python-productmd-composeinfo              python-sphinx-tabs
python-betamax                            python-hypothesis                         python-productmd-discinfo                 python-sphinx-typlog-theme
python-billiard                           python-ifaddr                             python-productmd-images                   python-sphobjinv
python-black                              python-importlib-metadata                 python-productmd-rpms                     python-sqlalchemy
python-bleach                             python-inflect                            python-productmd-terminology              python-sqlparse
python-blinker                            python-ipykernel                          python-productmd-treeinfo                 python-stdlib-list
python-boto3                              python-ipythonparallel                    python-prompt_toolkit                     python-stem
python-botocore                           python-itsdangerous                       python-psutil                             python-sure
python-bottle                             python-jaraco-classes                     python-ptyprocess                         python-sybil
python-breathe                            python-jaraco-collections                 python-purl                               python-systemd
python-build                              python-jaraco-envs                        python-py                                 python-tempora
python-cachecontrol                       python-jaraco-functools                   python-pyasn1                             python-terminado
python-cachetools                         python-jaraco.itertools                   python-pybtex                             python-testpath
python-cbor2                              python-jaraco-packaging                   python-pybtex-docutils                    python-test_server
python-celery                             python-jaraco-path                        python-pycodestyle                        python-testtools
python-cffi                               python-jaraco-text                        python-pydocstyle                         python-tidy
python-chai                               python-jedi                               python-pyfakefs                           python-tinycss2
python-characteristic                     python-Jinja                              python-pyftpdlib                          python-toolz
python-chardet                            python-jinja2_pluralize                   python-pygal                              python-tornado
python-charset-normalizer                 python-jmespath                           python-pygments                           python-tox
python-cheroot                            python-jsonschema                         python-pyhamcrest                         python-traitlets
python-cherrypy                           python-jupyter_client                     python-pyiso8601                          python-transaction
python-click                              python-jupyter_core                       python-pyjwt                              python-trio
python-click-log                          python-jupytext                           python-pylama                             python-trustme
python-commonmark-py                      python-kiwi                               python-pylint                             python-twisted
python-configobj                          python-kombu                              python-pymeeus                            python-uritemplate
python-contextlib2                        python-lark                               python-pynacl                             python-urllib3
python-convertdate                        python-latexcodec                         python-pyopenssl                          python-validators
python-coveragepy                         python-lazy-object-proxy                  python-pyrad                              python-vine
python-coveralls                          python-libevdev                           python-pyrsistent                         python-virtualenv
python-cppy                               python-linkify-it-py                      python-pyscss                             python-waitress
python-cssselect2                         python-lockfile                           python-pytest                             python-wcwidth
python-cython                             python-logbook                            python-pytest-cov                         python-webcolors
python-dateutil                           python-lxml                               python-pytest-regressions                 python-webencodings
python-decorator                          python-lz4                                python-pytest-runner                      python-webob
python-deprecated                         python-m2r                                python-pytest-trio                        python-websocket-client
python-dictdiffer                         python-mako                               python-pytest-xprocess                    python-websockets
python-dnspython                          python-markupsafe                         python-python-sphinx-contribspelling      python-webtest
python-dulwich                            python-mdit-py-plugins                    python-pyudev                             python-werkzeug
python-elasticsearch-py                   python-metaextract                        python-pyxattr                            python-wheel
python-elementpath                        python-mistune                            python-pyxdg                              python-Whoosh
python-entrypoints                        python-mock                               python-requests                           python-wrapt
python-evdev                              python-more-itertools                     python-requests-mock                      python-WSGIProxy2
python-eventlet                           python-mpi4py                             python-requests_toolbelt                  python-wsproto
python-execnet                            python-msgpack                            python-rfc3986                            python-xmlschema
python-factory-boy                        python-multidict                          python-rich                               python-yamlloader
python-faker                              python-multipledispatch                   python-rsa                                python-yarl
python-fields                             python-mypy                               python-rst.linker                         python-zconfig
python-filelock                           python-myst-parser                        python-scons                              python-zeroconf
python-flake8                             python-nbclient                           python-scripttest                         python-zipp
python-flask                              python-nbformat                           python-selenium                           python-zope-event
python-flask-login                        python-netaddr                            python-semantic-version                   python-zope-exceptions
willmcgugan commented 3 years ago

Again I'm none-the-wiser as to what problem the warnings are creating for you. Do the warnings prevent you from creating these man pages?

kloczek commented 3 years ago

Maybe it is not clear that I'v opened that ticket because I have problem. I'm just reporing warnings and I know that in many cases because some warnings some parts of the documentation are skipped. If you don't care than I have nothing more to say .. I'm just a messanger and I have no comnnection with that issue.