sybrenstuvel / python-rsa

Python-RSA is a pure-Python RSA implementation.
https://stuvel.eu/rsa
Other
483 stars 112 forks source link

4.8: sphinx warnings `reference target not found` #199

Closed kloczek closed 2 years ago

kloczek commented 2 years ago

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 doc build/sphinx/man
Running Sphinx v4.5.0
loading translations [en]... done
making output directory... done
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 9 added, 0 changed, 0 removed
reading sources... [100%] usage
/home/tkloczko/rpmbuild/BUILD/python-rsa-version-4.8/doc/cli.rst:16: ERROR: Malformed table.

+-------------------------+--------------------------------------------------+-----------------------------------------+
| Command                 | Usage                                            | Core function                           |
+=========================+==================================================+=========================================+
| pyrsa-keygen            | Generates a new RSA key pair in PEM or DER format | :py:func:`rsa.newkeys`                  |
+-------------------------+--------------------------------------------------+-----------------------------------------+
| pyrsa-encrypt           | Encrypts a file. The file must be shorter than   | :py:func:`rsa.encrypt`                  |
|                         | the key length in order to be encrypted.         |                                         |
+-------------------------+--------------------------------------------------+-----------------------------------------+
| pyrsa-decrypt           | Decrypts a file.                                 | :py:func:`rsa.decrypt`                  |
+-------------------------+--------------------------------------------------+-----------------------------------------+
| pyrsa-sign              | Signs a file, outputs the signature.             | :py:func:`rsa.sign`                     |
+-------------------------+--------------------------------------------------+-----------------------------------------+
| pyrsa-verify            | Verifies a signature. The result is written to   | :py:func:`rsa.verify`                   |
|                         | the console as well as returned in the exit      |                                         |
|                         | status code.                                     |                                         |
+-------------------------+--------------------------------------------------+-----------------------------------------+
| pyrsa-priv2pub          | Reads a private key and outputs the              | \-                                      |
|                         | corresponding public key.                        |                                         |
+-------------------------+--------------------------------------------------+-----------------------------------------+
| *pyrsa-encrypt-bigfile* | *Encrypts a file to an encrypted VARBLOCK file.  | *Deprecated in Python-RSA 3.4 and       |
|                         | The file can be larger than the key length, but  | removed from version 4.0.*              |
|                         | the output file is only compatible with          |                                         |
|                         | Python-RSA.*                                     |                                         |
+-------------------------+--------------------------------------------------+-----------------------------------------+
| *pyrsa-decrypt-bigfile* | *Decrypts an encrypted VARBLOCK file.*           | *Deprecated in Python-RSA 3.4 and       |
|                         |                                                  | removed from version 4.0.*              |
+-------------------------+--------------------------------------------------+-----------------------------------------+
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-rsa.3 { intro installation upgrading licence usage cli compatibility reference } /home/tkloczko/rpmbuild/BUILD/python-rsa-version-4.8/doc/usage.rst:180: WARNING: py:func reference target not found: rsa.compute_hash
/home/tkloczko/rpmbuild/BUILD/python-rsa-version-4.8/doc/usage.rst:180: WARNING: py:func reference target not found: rsa.sign_hash
/home/tkloczko/rpmbuild/BUILD/python-rsa-version-4.8/doc/usage.rst:216: WARNING: py:class reference target not found: file
/home/tkloczko/rpmbuild/BUILD/python-rsa-version-4.8/rsa/key.py:docstring of rsa.key.AbstractKey.load_pkcs1:: WARNING: py:class reference target not found: rsa.key.AbstractKey
/home/tkloczko/rpmbuild/BUILD/python-rsa-version-4.8/rsa/key.py:docstring of rsa.key.AbstractKey.load_pkcs1:: WARNING: py:class reference target not found: AbstractKey
/home/tkloczko/rpmbuild/BUILD/python-rsa-version-4.8/rsa/key.py:docstring of rsa.key.AbstractKey.load_pkcs1:: WARNING: py:class reference target not found: rsa.key.AbstractKey
/home/tkloczko/rpmbuild/BUILD/python-rsa-version-4.8/rsa/key.py:docstring of rsa.key.AbstractKey.load_pkcs1:: WARNING: py:class reference target not found: AbstractKey
done
build succeeded, 8 warnings.
kloczek commented 2 years ago

Tested and looks better now however I see one reff warning and that one about table.

+ /usr/bin/sphinx-build -n -T -b man doc build/sphinx/man
Running Sphinx v5.0.2
making output directory... done
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 9 added, 0 changed, 0 removed
reading sources... [100%] usage
/home/tkloczko/rpmbuild/BUILD/python-rsa-version-4.8/doc/cli.rst:16: ERROR: Malformed table.

+-------------------------+--------------------------------------------------+-----------------------------------------+
| Command                 | Usage                                            | Core function                           |
+=========================+==================================================+=========================================+
| pyrsa-keygen            | Generates a new RSA key pair in PEM or DER format | :py:func:`rsa.newkeys`                  |
+-------------------------+--------------------------------------------------+-----------------------------------------+
| pyrsa-encrypt           | Encrypts a file. The file must be shorter than   | :py:func:`rsa.encrypt`                  |
|                         | the key length in order to be encrypted.         |                                         |
+-------------------------+--------------------------------------------------+-----------------------------------------+
| pyrsa-decrypt           | Decrypts a file.                                 | :py:func:`rsa.decrypt`                  |
+-------------------------+--------------------------------------------------+-----------------------------------------+
| pyrsa-sign              | Signs a file, outputs the signature.             | :py:func:`rsa.sign`                     |
+-------------------------+--------------------------------------------------+-----------------------------------------+
| pyrsa-verify            | Verifies a signature. The result is written to   | :py:func:`rsa.verify`                   |
|                         | the console as well as returned in the exit      |                                         |
|                         | status code.                                     |                                         |
+-------------------------+--------------------------------------------------+-----------------------------------------+
| pyrsa-priv2pub          | Reads a private key and outputs the              | \-                                      |
|                         | corresponding public key.                        |                                         |
+-------------------------+--------------------------------------------------+-----------------------------------------+
| *pyrsa-encrypt-bigfile* | *Encrypts a file to an encrypted VARBLOCK file.  | *Deprecated in Python-RSA 3.4 and       |
|                         | The file can be larger than the key length, but  | removed from version 4.0.*              |
|                         | the output file is only compatible with          |                                         |
|                         | Python-RSA.*                                     |                                         |
+-------------------------+--------------------------------------------------+-----------------------------------------+
| *pyrsa-decrypt-bigfile* | *Decrypts an encrypted VARBLOCK file.*           | *Deprecated in Python-RSA 3.4 and       |
|                         |                                                  | removed from version 4.0.*              |
+-------------------------+--------------------------------------------------+-----------------------------------------+
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-rsa.3 { intro installation upgrading licence usage cli compatibility reference } /home/tkloczko/rpmbuild/BUILD/python-rsa-version-4.8/rsa/pkcs1.py:docstring of rsa.pkcs1.compute_hash:: WARNING: py:obj reference target not found: typing.BinaryIO
done
build succeeded, 2 warnings.

I forgot to mention that I'm using patch which allows build documentation without have installed module (straight from source tree only. Here it is

--- a/doc/conf.py
+++ b/doc/conf.py
@@ -9,14 +9,15 @@
 # All configuration values have a default; values that are commented out
 # serve to show the default.

-# import sys
-# import os
-import rsa
-
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 # sys.path.insert(0, os.path.abspath('.'))
+import sys
+import os
+sys.path.insert(0, os.path.abspath(".."))
+
+import rsa

 # -- General configuration -----------------------------------------------------