Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.6.4.0: sphinx warnings #332

Closed
kloczek opened this issue Apr 27, 2021 · 6 comments
Closed

3.6.4.0: sphinx warnings #332

kloczek opened this issue Apr 27, 2021 · 6 comments

Comments

@kloczek
Copy link

kloczek commented Apr 27, 2021

On generate man page sphinx reports some warnings:

+ sphinx-build -b man -d billiard Doc .
Running Sphinx v3.5.3
WARNING: Support for evaluating Python 2 syntax is deprecated and will be removed in Sphinx 4.0. Convert /home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/conf.py to Python 3 syntax.
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] 3 added, 0 changed, 0 removed
reading sources... [100%] library/multiprocessing
/home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:21: WARNING: Unknown interpreted text role "issue".
/home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:451: WARNING: Unknown directive type "doctest".

.. doctest::

    >>> import multiprocessing, time, signal
    >>> p = multiprocessing.Process(target=time.sleep, args=(1000,))
    >>> print(p, p.is_alive())
    <Process(Process-1, initial)> False
    >>> p.start()
    >>> print(p, p.is_alive())
    <Process(Process-1, started)> True
    >>> p.terminate()
    >>> time.sleep(0.1)
    >>> print(p, p.is_alive())
    <Process(Process-1, stopped[SIGTERM])> False
    >>> p.exitcode == -signal.SIGTERM
    True
/home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:838: WARNING: Unknown directive type "doctest".

.. doctest::

    >>> from multiprocessing import Pipe
    >>> a, b = Pipe()
    >>> a.send([1, 'hello', None])
    >>> b.recv()
    [1, 'hello', None]
    >>> b.send_bytes(b'thank you')
    >>> a.recv_bytes()
    b'thank you'
    >>> import array
    >>> arr1 = array.array('i', range(5))
    >>> arr2 = array.array('i', [0] * 10)
    >>> a.send_bytes(arr1)
    >>> count = b.recv_bytes_into(arr2)
    >>> assert count == len(arr1) * arr1.itemsize
    >>> arr2
    array('i', [0, 1, 2, 3, 4, 0, 0, 0, 0, 0])
/home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:1363: WARNING: Unknown directive type "doctest".

.. doctest::

   >>> manager = multiprocessing.Manager()
   >>> Global = manager.Namespace()
   >>> Global.x = 10
   >>> Global.y = 'hello'
   >>> Global._z = 12.3    # this is an attribute of the proxy
   >>> print(Global)
   Namespace(x=10, y='hello')
/home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:1475: WARNING: Unknown directive type "doctest".

.. doctest::

   >>> from multiprocessing import Manager
   >>> manager = Manager()
   >>> l = manager.list([i*i for i in range(10)])
   >>> print(l)
   [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
   >>> print(repr(l))
   <ListProxy object, typeid 'list' at 0x...>
   >>> l[4]
   16
   >>> l[2:5]
   [4, 9, 16]
/home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:1498: WARNING: Unknown directive type "doctest".

.. doctest::

   >>> a = manager.list()
   >>> b = manager.list()
   >>> a.append(b)         # referent of a now contains referent of b
   >>> print(a, b)
   [[]] []
   >>> b.append('hello')
   >>> print(a, b)
   [['hello']] ['hello']
/home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:1514: WARNING: Unknown directive type "doctest".

.. doctest::

    >>> manager.list([1,2,3]) == [1,2,3]
    False
/home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:1553: WARNING: Unknown directive type "doctest".

.. doctest::

   >>> l = manager.list(range(10))
   >>> l._callmethod('__len__')
   10
   >>> l._callmethod('__getslice__', (2, 7))   # equiv to `l[2:7]`
   [2, 3, 4, 5, 6]
   >>> l._callmethod('__getitem__', (20,))     # equiv to `l[20]`
   Traceback (most recent call last):
   ...
   IndexError: list index out of range
/home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:2305: WARNING: Unknown interpreted text role "issue".
/home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:2305: WARNING: Unknown interpreted text role "issue".
/home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:2305: WARNING: Unknown interpreted text role "issue".
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-billiard.3 { library/multiprocessing glossary } /home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:123: WARNING: undefined label: threaded-imports
done
build succeeded, 14 warnings.
@kloczek
Copy link
Author

kloczek commented Sep 5, 2021

Looks like setuptools<>sphinx integration is not finished. Here is the patch

--- a/setup.cfg~        2021-04-01 10:21:32.000000000 +0100
+++ b/setup.cfg 2021-09-05 13:35:26.899272873 +0100
@@ -12,3 +12,6 @@

 [metadata]
 license_file = LICENSE.txt
+
+[build_sphinx]
+source-dir = Doc

With that patch is possible to execute:

+ /usr/bin/python3 setup.py build_sphinx -b man --build-dir build/sphinx
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] 3 added, 0 changed, 0 removed
reading sources... [100%] library/multiprocessing
/home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:21: WARNING: Unknown interpreted text role "issue".
/home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:451: WARNING: Unknown directive type "doctest".

.. doctest::

    >>> import multiprocessing, time, signal
    >>> p = multiprocessing.Process(target=time.sleep, args=(1000,))
    >>> print(p, p.is_alive())
    <Process(Process-1, initial)> False
    >>> p.start()
    >>> print(p, p.is_alive())
    <Process(Process-1, started)> True
    >>> p.terminate()
    >>> time.sleep(0.1)
    >>> print(p, p.is_alive())
    <Process(Process-1, stopped[SIGTERM])> False
    >>> p.exitcode == -signal.SIGTERM
    True
/home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:838: WARNING: Unknown directive type "doctest".

.. doctest::

    >>> from multiprocessing import Pipe
    >>> a, b = Pipe()
    >>> a.send([1, 'hello', None])
    >>> b.recv()
    [1, 'hello', None]
    >>> b.send_bytes(b'thank you')
    >>> a.recv_bytes()
    b'thank you'
    >>> import array
    >>> arr1 = array.array('i', range(5))
    >>> arr2 = array.array('i', [0] * 10)
    >>> a.send_bytes(arr1)
    >>> count = b.recv_bytes_into(arr2)
    >>> assert count == len(arr1) * arr1.itemsize
    >>> arr2
    array('i', [0, 1, 2, 3, 4, 0, 0, 0, 0, 0])
/home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:1363: WARNING: Unknown directive type "doctest".

.. doctest::

   >>> manager = multiprocessing.Manager()
   >>> Global = manager.Namespace()
   >>> Global.x = 10
   >>> Global.y = 'hello'
   >>> Global._z = 12.3    # this is an attribute of the proxy
   >>> print(Global)
   Namespace(x=10, y='hello')
/home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:1475: WARNING: Unknown directive type "doctest".

.. doctest::

   >>> from multiprocessing import Manager
   >>> manager = Manager()
   >>> l = manager.list([i*i for i in range(10)])
   >>> print(l)
   [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
   >>> print(repr(l))
   <ListProxy object, typeid 'list' at 0x...>
   >>> l[4]
   16
   >>> l[2:5]
   [4, 9, 16]
/home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:1498: WARNING: Unknown directive type "doctest".

.. doctest::

   >>> a = manager.list()
   >>> b = manager.list()
   >>> a.append(b)         # referent of a now contains referent of b
   >>> print(a, b)
   [[]] []
   >>> b.append('hello')
   >>> print(a, b)
   [['hello']] ['hello']
/home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:1514: WARNING: Unknown directive type "doctest".

.. doctest::

    >>> manager.list([1,2,3]) == [1,2,3]
    False
/home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:1553: WARNING: Unknown directive type "doctest".

.. doctest::

   >>> l = manager.list(range(10))
   >>> l._callmethod('__len__')
   10
   >>> l._callmethod('__getslice__', (2, 7))   # equiv to `l[2:7]`
   [2, 3, 4, 5, 6]
   >>> l._callmethod('__getitem__', (20,))     # equiv to `l[20]`
   Traceback (most recent call last):
   ...
   IndexError: list index out of range
/home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:2305: WARNING: Unknown interpreted text role "issue".
/home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:2305: WARNING: Unknown interpreted text role "issue".
/home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:2305: WARNING: Unknown interpreted text role "issue".
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-billiard.3 { library/multiprocessing glossary } /home/tkloczko/rpmbuild/BUILD/billiard-3.6.4.0/Doc/library/multiprocessing.rst:123: WARNING: undefined label: threaded-imports
done
build succeeded, 13 warnings.

@auvipy
Copy link
Member

auvipy commented Nov 10, 2021

can you please send a PR?

@kloczek
Copy link
Author

kloczek commented Nov 10, 2021

Sorry but I'm busy working on other things ..

@kloczek
Copy link
Author

kloczek commented Nov 10, 2021

You may try to change that semi automatically using https://github.com/schollii/nose2pytest/

@auvipy
Copy link
Member

auvipy commented Nov 11, 2021

ok thanks for report & suggestions

@kloczek
Copy link
Author

kloczek commented Dec 14, 2022

As I've alredy presented fix to move 100% to pytest and sphinx warnings are submitted in #366 this ticket can be closed as duplicated 😄

@kloczek kloczek closed this as completed Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants