sphinx-doc / sphinx

The Sphinx documentation generator
https://www.sphinx-doc.org/
Other
6.41k stars 2.09k forks source link

4.0.2: problem with setuptools `build_sphinx` command and DSO modules #9378

Closed kloczek closed 2 years ago

kloczek commented 3 years ago

Describe the bug I'm trying to build documentation argon2-cffi module (https://github.com/hynek/argon2-cffi) using setuptools build_sphinx command.

$ /usr/bin/python3 setup.py build_sphinx -b man --build-dir build/sphinx

Problem is that this module in build builds DSO modules and to generate documentation build_sphinx needs the access to those mopdule. python3 setup.py build stores all resources in build/lib-<os>.<arch> and in such case IMO build_sphinx should automatically add that path to python syst.path

[tkloczko@barrel argon2-cffi-20.1.0]$ strace -fe trace=file /usr/bin/python3 setup.py build_sphinx -b man --build-dir build/sphinx 2>&1 | grep -w build
execve("/usr/bin/python3", ["/usr/bin/python3", "setup.py", "build_sphinx", "-b", "man", "--build-dir", "build/sphinx"], 0x7ffc5c1c5b30 /* 33 vars */) = 0
newfstatat(AT_FDCWD, "/usr/lib64/python3.8/distutils/command/build.py", {st_mode=S_IFREG|0644, st_size=5767, ...}, 0) = 0
newfstatat(AT_FDCWD, "/usr/lib64/python3.8/distutils/command/build.py", {st_mode=S_IFREG|0644, st_size=5767, ...}, 0) = 0
openat(AT_FDCWD, "/usr/lib64/python3.8/distutils/command/__pycache__/build.cpython-38.pyc", O_RDONLY|O_CLOEXEC) = 3
newfstatat(AT_FDCWD, "/usr/lib/python3.8/site-packages/build-0.4.0-py3.8.egg-info", {st_mode=S_IFDIR|0755, st_size=160, ...}, 0) = 0
openat(AT_FDCWD, "/usr/lib/python3.8/site-packages/build-0.4.0-py3.8.egg-info", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
newfstatat(AT_FDCWD, "/usr/lib/python3.8/site-packages/build-0.4.0-py3.8.egg-info/PKG-INFO", {st_mode=S_IFREG|0644, st_size=2935, ...}, 0) = 0
openat(AT_FDCWD, "/usr/lib/python3.8/site-packages/build-0.4.0-py3.8.egg-info/PKG-INFO", O_RDONLY|O_CLOEXEC) = 3
newfstatat(AT_FDCWD, "/usr/lib/python3.8/site-packages/build-0.4.0-py3.8.egg-info/namespace_packages.txt", 0x7ffcf814d200, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/lib/python3.8/site-packages/build-0.4.0-py3.8.egg-info", {st_mode=S_IFDIR|0755, st_size=160, ...}, 0) = 0
openat(AT_FDCWD, "/usr/lib/python3.8/site-packages/build-0.4.0-py3.8.egg-info", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
newfstatat(AT_FDCWD, "/usr/lib/python3.8/site-packages/build-0.4.0-py3.8.egg-info/PKG-INFO", {st_mode=S_IFREG|0644, st_size=2935, ...}, 0) = 0
openat(AT_FDCWD, "/usr/lib/python3.8/site-packages/build-0.4.0-py3.8.egg-info/PKG-INFO", O_RDONLY|O_CLOEXEC) = 3
newfstatat(AT_FDCWD, "/usr/lib/python3.8/site-packages/build-0.4.0-py3.8.egg-info/entry_points.txt", {st_mode=S_IFREG|0644, st_size=109, ...}, 0) = 0
openat(AT_FDCWD, "/usr/lib/python3.8/site-packages/build-0.4.0-py3.8.egg-info/entry_points.txt", O_RDONLY|O_CLOEXEC) = 3
newfstatat(AT_FDCWD, "/usr/lib64/python3.8/distutils/command/build.py", {st_mode=S_IFREG|0644, st_size=5767, ...}, 0) = 0
newfstatat(AT_FDCWD, "/usr/lib64/python3.8/distutils/command/build.py", {st_mode=S_IFREG|0644, st_size=5767, ...}, AT_SYMLINK_NOFOLLOW) = 0
newfstatat(AT_FDCWD, "/usr/lib/python3.8/site-packages/sphinx/cmd/build.py", {st_mode=S_IFREG|0644, st_size=12497, ...}, 0) = 0
newfstatat(AT_FDCWD, "/usr/lib/python3.8/site-packages/sphinx/cmd/build.py", {st_mode=S_IFREG|0644, st_size=12497, ...}, 0) = 0
openat(AT_FDCWD, "/usr/lib/python3.8/site-packages/sphinx/cmd/__pycache__/build.cpython-38.pyc", O_RDONLY|O_CLOEXEC) = 3
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/man", {st_mode=S_IFDIR|0755, st_size=26, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/man", {st_mode=S_IFDIR|0755, st_size=26, ...}, 0) = 0
newfstatat(AT_FDCWD, "build/sphinx/man", {st_mode=S_IFDIR|0755, st_size=26, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx", {st_mode=S_IFDIR|0755, st_size=22, ...}, 0) = 0
mkdir("/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees", 0777) = -1 EEXIST (File exists)
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees", {st_mode=S_IFDIR|0755, st_size=396, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/environment.pickle", {st_mode=S_IFREG|0644, st_size=1719965, ...}, 0) = 0
loading pickled environment... openat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/environment.pickle", O_RDONLY|O_CLOEXEC) = 3
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/contributing.doctree", {st_mode=S_IFREG|0644, st_size=42630, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/faq.doctree", {st_mode=S_IFREG|0644, st_size=9797, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/index.doctree", {st_mode=S_IFREG|0644, st_size=9348, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/installation.doctree", {st_mode=S_IFREG|0644, st_size=16951, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/parameters.doctree", {st_mode=S_IFREG|0644, st_size=17323, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/license.doctree", {st_mode=S_IFREG|0644, st_size=15666, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/api.doctree", {st_mode=S_IFREG|0644, st_size=136822, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/cli.doctree", {st_mode=S_IFREG|0644, st_size=4324, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/changelog.doctree", {st_mode=S_IFREG|0644, st_size=64037, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/backward-compatibility.doctree", {st_mode=S_IFREG|0644, st_size=5968, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/argon2.doctree", {st_mode=S_IFREG|0644, st_size=16390, ...}, 0) = 0
argon2-cffi.3 { openat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/index.doctree", O_RDONLY|O_CLOEXEC) = 3
argon2 openat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/argon2.doctree", O_RDONLY|O_CLOEXEC) = 3
installation openat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/installation.doctree", O_RDONLY|O_CLOEXEC) = 3
api openat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/api.doctree", O_RDONLY|O_CLOEXEC) = 3
parameters openat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/parameters.doctree", O_RDONLY|O_CLOEXEC) = 3
cli openat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/cli.doctree", O_RDONLY|O_CLOEXEC) = 3
faq openat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/faq.doctree", O_RDONLY|O_CLOEXEC) = 3
backward-compatibility openat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/backward-compatibility.doctree", O_RDONLY|O_CLOEXEC) = 3
contributing openat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/contributing.doctree", O_RDONLY|O_CLOEXEC) = 3
changelog openat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/changelog.doctree", O_RDONLY|O_CLOEXEC) = 3
license openat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/doctrees/license.doctree", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/argon2-cffi-20.1.0/build/sphinx/man/argon2-cffi.3", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 3

This output shows that build_sphinx is not trying to access to build/lib-<os>.<arch>

To Reproduce

Your project https://github.com/hynek/argon2-cffi//archive/20.1.0/argon2-cffi-20.1.0.tar.gz

Screenshots In case of argon2-cffi prints warnings about missing functions which are provided by DSO.

+ /usr/bin/python3 setup.py build_sphinx -b man --build-dir build/sphinx
running build_sphinx
Running Sphinx v4.0.2
making output directory... done
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 11 added, 0 changed, 0 removed
reading sources... [100%] parameters
WARNING: autodoc: failed to import class 'PasswordHasher' from module 'argon2'; the following exception was raised:
No module named 'argon2'
WARNING: autodoc: failed to import exception 'exceptions.VerificationError' from module 'argon2'; the following exception was raised:
No module named 'argon2'
WARNING: autodoc: failed to import exception 'exceptions.VerifyMismatchError' from module 'argon2'; the following exception was raised:
No module named 'argon2'
WARNING: autodoc: failed to import exception 'exceptions.HashingError' from module 'argon2'; the following exception was raised:
No module named 'argon2'
WARNING: autodoc: failed to import exception 'exceptions.InvalidHash' from module 'argon2'; the following exception was raised:
No module named 'argon2'
WARNING: autodoc: failed to import function 'extract_parameters' from module 'argon2'; the following exception was raised:
No module named 'argon2'
WARNING: autodoc: failed to import class 'Parameters' from module 'argon2'; the following exception was raised:
No module named 'argon2'
WARNING: autodoc: failed to import module 'low_level' from module 'argon2'; the following exception was raised:
No module named 'argon2'
WARNING: autodoc: failed to import class 'Type' from module 'argon2'; the following exception was raised:
No module named 'argon2'
WARNING: autodoc: failed to import data 'ARGON2_VERSION' from module 'argon2'; the following exception was raised:
No module named 'argon2'
WARNING: autodoc: failed to import function 'hash_secret' from module 'argon2'; the following exception was raised:
No module named 'argon2'
WARNING: autodoc: failed to import function 'verify_secret' from module 'argon2'; the following exception was raised:
No module named 'argon2'
WARNING: autodoc: failed to import function 'hash_secret_raw' from module 'argon2'; the following exception was raised:
No module named 'argon2'
WARNING: autodoc: failed to import function 'core' from module 'argon2'; the following exception was raised:
No module named 'argon2'
WARNING: autodoc: failed to import function 'error_to_str' from module 'argon2'; the following exception was raised:
No module named 'argon2'
WARNING: autodoc: failed to import function 'hash_password' from module 'argon2'; the following exception was raised:
No module named 'argon2'
WARNING: autodoc: failed to import function 'hash_password_raw' from module 'argon2'; the following exception was raised:
No module named 'argon2'
WARNING: autodoc: failed to import function 'verify_password' from module 'argon2'; the following exception was raised:
No module named 'argon2'
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... argon2-cffi.3 { argon2 installation api parameters cli faq backward-compatibility contributing changelog license } done
build succeeded, 18 warnings.

Environment info

Additional context N/A

tk0miya commented 3 years ago

I'm not good at the rule of search paths. So I don't know why Sphinx should refer libraries on build/lib or build/lib-<os>.<arch> automatically. Could you let me know the pointer of the rule (like PEP). Thanks,

kloczek commented 3 years ago

I'no sure is it anywhere in any PEP mentioned that (probably not).

What I'm trying to propose goes probably beyond what up to now was proposed. However it is only logical rule which could be applied when build_sphinx would need access to those DSOa like it is in https://github.com/hynek/argon2-cffi/issues/93. If build_sphinx wold requre build/lib-<os>.<arch> logical is that it should use build/lib as well.

If you are thinking that any currently implemented functionalities of build_sphinx could fbe used to fix build documentation of modules which produces DSOs pleas let me know.

tk0miya commented 3 years ago

I'd like to know who (or what library) determines the rule for the name of build directories.

If you are thinking that any currently implemented functionalities of build_sphinx could fbe used to fix build documentation of modules which produces DSOs pleas let me know.

How about using python setup.py develop or python setup.py install before building the document? Alternatively, you can add the build directory into your conf.py

sys.path.insert(0, os.path.abspath('build/lib-<os>.<arch>'))
kloczek commented 3 years ago

I'd like to know who (or what library) determines the rule for the name of build directories.

Thant is another question. IMO use sometimes `build/lib-.' or 'build/lib' is a bit strange :)

If you are thinking that any currently implemented functionalities of build_sphinx could fbe used to fix build documentation of modules which produces DSOs pleas let me know.

How about using python setup.py develop or python setup.py install before building the document? Alternatively, you can add the build directory into your conf.py

That would impact any existing packages build procedures like building rpm or publishing Solaris IPS packages. Typical order of doing some stages are:

From that point of view it would be necessary to build documentation in install. Which would look like dirty hack. IMO the best would be to have integrated build_sphinx as part of the build and have build_sphinx to execute separatelly. However it may be to big change of current seruptools semantica. From my point of fiew (someone who is packaginf suff) enough would be if build_sphinx would only be trying blindly use resources from build/lib-<os>.<arch> or build/lib.

sys.path.insert(0, os.path.abspath('build/lib-<os>.<arch>'))

I have no idea where exactly it is but setuptools know is it used build/lib-<os>.<arch> or build/lib and exactly that path IMO should be added upfront to the sys.path of the build_sphinx command.

shimizukawa commented 3 years ago

I think it is relatively easy to create a setup.py command and bundle multiple subcommands to run it. So I guess you can prepare this command in your project, do the build before the sphinx_build command, and adjust the sys.path to achieve this.

Please refer to the following source: https://github.com/pypa/distutils/blob/main/distutils/command/build.py

kloczek commented 3 years ago

I think it is relatively easy to create a setup.py command and bundle multiple subcommands to run it. So I guess you can prepare this command in your project, do the build before the sphinx_build command, and adjust the sys.path to achieve this.

Issue is that that fixing that centrally in setuptools sphinx extension would allow to not spread such changes to every possible module which produces DSOs. IMO adjusting in setuptools sphinx extension centrally could solve as well the case when for example module code is relocated to for example src/ directory like it is done now in case of many modules. In other words altering sys.path could solve as well https://github.com/sphinx-doc/sphinx/issues/9517.

In other words it is now more than one reason alter sys.path by setuptools sphinx extension ad assume that build_sphinx will be allways executed after build (build_sphinx could warn that there is no build/lib* or even instead print such warning automatically execute build).

tk0miya commented 3 years ago

I overlooked @shimizukawa's comment. Thank you for your wisdom.

Please refer to the following source: https://github.com/pypa/distutils/blob/main/distutils/command/build.py

This is what I want. It seems distutils.build::build.build_lib is the directory that contains the final form of the distribution (library). So it would be nice if we can obtain the value from the command, and insert it to the sys.path.

I think it's reasonable change.

tk0miya commented 3 years ago

I just posted #9520. Could you try this please?

kloczek commented 3 years ago

I just posted #9520. Could you try this please?

Just started working on package zope-component which to build documemntation needs build/lib/zope/component and source code is in src/zope/component so that module is perfect playground to test your PR. Fiirs I need to integrate that PR with my sphinx build as rpm package. Will back shortly with results.

kloczek commented 3 years ago

Looks like that PR does not work.

[tkloczko@barrel zope.component-5.0.1]$ ls  build/lib/zope/<tab><tab>
component/   __init__.py

[tkloczko@barrel zope.component-5.0.1]$ /usr/bin/python3 setup.py build_sphinx -b man --build-dir build/sphinx --pdb
running build_sphinx
Running Sphinx v4.1.2
Exception occurred while building, starting debugger:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/config.py", line 327, in eval_config_file
    exec(code, namespace)
  File "/home/tkloczko/rpmbuild/BUILD/zope.component-5.0.1/docs/conf.py", line 34, in <module>
    rqmt = pkg_resources.require('zope.component')[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 'zope.component' distribution was not found and is required by the application

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

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/setup_command.py", line 171, in run
    app = Sphinx(self.source_dir, self.config_dir,
  File "/usr/lib/python3.8/site-packages/sphinx/application.py", line 216, in __init__
    self.config = Config.read(self.confdir, confoverrides or {}, self.tags)
  File "/usr/lib/python3.8/site-packages/sphinx/config.py", line 172, in read
    namespace = eval_config_file(filename, tags)
  File "/usr/lib/python3.8/site-packages/sphinx/config.py", line 340, in eval_config_file
    raise ConfigError(msg % traceback.format_exc()) from exc
sphinx.errors.ConfigError: 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 327, in eval_config_file
    exec(code, namespace)
  File "/home/tkloczko/rpmbuild/BUILD/zope.component-5.0.1/docs/conf.py", line 34, in <module>
    rqmt = pkg_resources.require('zope.component')[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 'zope.component' distribution was not found and is required by the application

> /usr/lib/python3.8/site-packages/sphinx/config.py(340)eval_config_file()
-> raise ConfigError(msg % traceback.format_exc()) from exc
(Pdb)

Do you know how can I display in pdb prompt sys.path?

kloczek commented 3 years ago

I've started noticing that with sphonx with https://github.com/sphinx-doc/sphinx/pull/9520 on building documentation of some modules which on build are writing files to build/lib setuptools build_sphinx started working so I've read a bit about pdb and looks like that patch do not changes sys.path because sys is not imported.

[tkloczko@barrel zope.component-5.0.1]$ /usr/bin/python3 setup.py build_sphinx -b man --build-dir build/sphinx --pdb
running build_sphinx
Running Sphinx v4.1.2
Exception occurred while building, starting debugger:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/config.py", line 327, in eval_config_file
    exec(code, namespace)
  File "/home/tkloczko/rpmbuild/BUILD/zope.component-5.0.1/docs/conf.py", line 34, in <module>
    rqmt = pkg_resources.require('zope.component')[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 'zope.component' distribution was not found and is required by the application

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

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/setup_command.py", line 171, in run
    app = Sphinx(self.source_dir, self.config_dir,
  File "/usr/lib/python3.8/site-packages/sphinx/application.py", line 216, in __init__
    self.config = Config.read(self.confdir, confoverrides or {}, self.tags)
  File "/usr/lib/python3.8/site-packages/sphinx/config.py", line 172, in read
    namespace = eval_config_file(filename, tags)
  File "/usr/lib/python3.8/site-packages/sphinx/config.py", line 340, in eval_config_file
    raise ConfigError(msg % traceback.format_exc()) from exc
sphinx.errors.ConfigError: 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 327, in eval_config_file
    exec(code, namespace)
  File "/home/tkloczko/rpmbuild/BUILD/zope.component-5.0.1/docs/conf.py", line 34, in <module>
    rqmt = pkg_resources.require('zope.component')[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 'zope.component' distribution was not found and is required by the application

> /usr/lib/python3.8/site-packages/sphinx/config.py(340)eval_config_file()
-> raise ConfigError(msg % traceback.format_exc()) from exc
(Pdb) sys.path
*** NameError: name 'sys' is not defined
(Pdb) import sys
(Pdb) sys.path
['/home/tkloczko/rpmbuild/BUILD/zope.component-5.0.1', '/usr/lib64/python38.zip', '/usr/lib64/python3.8', '/usr/lib64/python3.8/lib-dynload', '/usr/lib64/python3.8/site-packages', '/usr/lib/python3.8/site-packages', '/home/tkloczko/rpmbuild/BUILD/zope.component-5.0.1/src']
(Pdb)

So to be honest because that partial improvement, no impoted sys.path and false example of the zope.component I'm not 100% sure how that patch suppose to alter build_sphinx behaviour ..

Also another test with uvloop module which actually produces in build DSOs:

[tkloczko@barrel uvloop-0.16.0]$ /usr/bin/python3 setup.py build_sphinx -b man --build-dir build/sphinx --pdb
running build_sphinx
Running Sphinx v4.1.2
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: 0 added, 1 changed, 0 removed
reading sources... [100%] api/index
WARNING: autodoc: failed to import class 'EventLoopPolicy' from module 'uvloop'; the following exception was raised:
No module named 'uvloop.loop'
WARNING: autodoc: failed to import function 'new_event_loop' from module 'uvloop'; the following exception was raised:
No module named 'uvloop.loop'
WARNING: autodoc: failed to import class 'Loop' from module 'uvloop'; the following exception was raised:
No module named 'uvloop.loop'
looking for now-outdated files... none found
pickling environment... done
checking consistency... /home/tkloczko/rpmbuild/BUILD/uvloop-0.16.0/docs/api/index.rst: WARNING: document isn't included in any toctree
done
writing... python-uvloop.3 { user/index dev/index } done
build succeeded, 4 warnings.

The manual pages are in build/sphinx/man.

However in this case even if I'm changeing $PYTONPATH manually it still does not work

[tkloczko@barrel uvloop-0.16.0]$ PYTHONPATH=$PWD/build/lib.linux-x86_64-3.8 /usr/bin/python3 setup.py build_sphinx -b man --build-dir build/sphinx --pdb
running build_sphinx
Running Sphinx v4.1.2
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: 0 added, 1 changed, 0 removed
reading sources... [100%] api/index
WARNING: autodoc: failed to import class 'EventLoopPolicy' from module 'uvloop'; the following exception was raised:
No module named 'uvloop.loop'
WARNING: autodoc: failed to import function 'new_event_loop' from module 'uvloop'; the following exception was raised:
No module named 'uvloop.loop'
WARNING: autodoc: failed to import class 'Loop' from module 'uvloop'; the following exception was raised:
No module named 'uvloop.loop'
looking for now-outdated files... none found
pickling environment... done
checking consistency... /home/tkloczko/rpmbuild/BUILD/uvloop-0.16.0/docs/api/index.rst: WARNING: document isn't included in any toctree
done
writing... python-uvloop.3 { user/index dev/index } done
build succeeded, 4 warnings.

The manual pages are in build/sphinx/man.

[tkloczko@barrel uvloop-0.16.0]$ ls $PWD/build/lib.linux-x86_64-3.8/uvloop/
cbhandles.pxd  errors.pyx  __init__.py                          loop.pxd  lru.pyx         py.typed     server.pxd    sslproto.pyx
cbhandles.pyx  handles     loop.c                               loop.pyi  _noop.py        request.pxd  server.pyx    _testbase.py
dns.pyx        includes    loop.cpython-38-x86_64-linux-gnu.so  loop.pyx  pseudosock.pyx  request.pyx  sslproto.pxd  _version.py

so to be honest I'm a bit confused by results of those checks. Can someone explan above?

kloczek commented 3 years ago

Yet another observation. looks like in case of just released uvloop 0.16.0 even pytest is not able to laod DSOs from $PYTHONPATH

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILD/uvloop-0.16.0/build/lib.linux-x86_64-3.8
+ /usr/bin/pytest -ra --pdb --deselect tests/test_cython.py::TestCythonIntegration::test_cython_coro_is_coroutine --deselect tests/test_dealloc.py::TestDealloc::test_dealloc_1 --deselect tests/test_signals.py::Test_AIO_Signals::test_signals_and_custom_handler_1 --deselect tests/test_signals.py::Test_AIO_Signals::test_signals_sigint_and_custom_handler --deselect tests/test_signals.py::Test_AIO_Signals::test_signals_sigint_pycode_continue --deselect tests/test_signals.py::Test_AIO_Signals::test_signals_sigint_pycode_stop --deselect tests/test_signals.py::Test_AIO_Signals::test_signals_sigint_uvcode --deselect tests/test_signals.py::Test_AIO_Signals::test_signals_sigint_uvcode_two_loop_runs --deselect tests/test_signals.py::Test_AIO_Signals::test_wakeup_fd_unchanged --deselect tests/test_signals.py::Test_UV_Signals::test_signals_and_custom_handler_1 --deselect tests/test_signals.py::Test_UV_Signals::test_signals_sigint_and_custom_handler --deselect tests/test_signals.py::Test_UV_Signals::test_signals_sigint_pycode_continue --deselect tests/test_signals.py::Test_UV_Signals::test_signals_sigint_pycode_stop --deselect tests/test_signals.py::Test_UV_Signals::test_signals_sigint_uvcode --deselect tests/test_signals.py::Test_UV_Signals::test_signals_sigint_uvcode_two_loop_runs --deselect tests/test_signals.py::Test_UV_Signals::test_wakeup_fd_unchanged --deselect tests/test_sourcecode.py::TestSourceCode::test_flake8
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.11, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /home/tkloczko/rpmbuild/BUILD/uvloop-0.16.0, configfile: pytest.ini, testpaths: tests
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, aspectlib-1.5.2, toolbox-0.5, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, flaky-3.7.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, datadir-1.3.1, regressions-2.2.0, cases-3.6.3, xprocess-0.18.1, black-0.3.12, checkdocs-2.7.1, anyio-3.3.0, Faker-8.11.0, asyncio-0.15.1, trio-0.7.0, httpbin-1.0.0, subtests-0.5.0, isort-2.0.0, hypothesis-6.14.6, mock-3.6.1, profiling-1.7.0
collecting ...
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> traceback >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/uvloop-0.16.0/tests/test_aiohttp.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_aiohttp.py:13: in <module>
    from uvloop import _testbase as tb
uvloop/__init__.py:7: in <module>
    from .loop import Loop as __BaseLoop  # NOQA
E   ModuleNotFoundError: No module named 'uvloop.loop'
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> entering PDB >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PDB post_mortem >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> /usr/lib/python3.8/site-packages/_pytest/python.py(603)_importtestmodule()
-> raise self.CollectError(
(Pdb) sys.path
['/home/tkloczko/rpmbuild/BUILD/uvloop-0.16.0', '/usr/bin', '/home/tkloczko/rpmbuild/BUILD/uvloop-0.16.0/build/lib.linux-x86_64-3.8', '/usr/lib64/python38.zip', '/usr/lib64/python3.8', '/usr/lib64/python3.8/lib-dynload', '/usr/lib64/python3.8/site-packages', '/usr/lib/python3.8/site-packages']
(Pdb)

Is it any general mechanism in python which prevents loading DSOs from $PYTHONPATH??

tk0miya commented 3 years ago

I confirmed my change works fine with this Dockefile:

FROM python:3.9-slim

RUN apt update; apt install -y build-essential curl git unzip vim
RUN pip3 install Sphinx
RUN git clone https://github.com/tk0miya/sphinx -b 9378_setup_build_lib_path
WORKDIR /sphinx
RUN echo "\nimport sys\nprint(sys.path)" >> doc/conf.py
RUN python setup.py build build_sphinx

It shows sys.path as following:

(snip)
#10 1.263 running build_sphinx
#10 1.265 Running Sphinx v4.2.0+/1809874b3
#10 1.715 ['/sphinx', '/usr/local/lib/python39.zip', '/usr/local/lib/python3.9', '/usr/local/lib/python3.9/lib-dynload', '/usr/local/lib/python3.9/site-packages', 'build/lib']
#10 1.715 making output directory... done
(snip)

I don't know why it does not work in your environment. Indeed, it seems sys.path is not changed on case of zope.component.

kloczek commented 3 years ago

Can you try with uvloop? I've added printing sys.path like you in copy.py and in my case I see:

[tkloczko@barrel uvloop-0.16.0]$ /usr/bin/python3 setup.py build_sphinx -b man --build-dir build/sphinx --pdb
running build_sphinx
Running Sphinx v4.1.2
['/home/tkloczko/rpmbuild/BUILD/uvloop-0.16.0', '/usr/lib64/python38.zip', '/usr/lib64/python3.8', '/usr/lib64/python3.8/lib-dynload', '/usr/lib64/python3.8/site-packages', '/usr/lib/python3.8/site-packages']
making output directory... done
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 4 added, 0 changed, 0 removed
reading sources... [100%] user/index
WARNING: autodoc: failed to import class 'EventLoopPolicy' from module 'uvloop'; the following exception was raised:
No module named 'uvloop.loop'
WARNING: autodoc: failed to import function 'new_event_loop' from module 'uvloop'; the following exception was raised:
No module named 'uvloop.loop'
WARNING: autodoc: failed to import class 'Loop' from module 'uvloop'; the following exception was raised:
No module named 'uvloop.loop'
looking for now-outdated files... none found
pickling environment... done
checking consistency... /home/tkloczko/rpmbuild/BUILD/uvloop-0.16.0/docs/api/index.rst: WARNING: document isn't included in any toctree
done
writing... python-uvloop.3 { user/index dev/index } done
build succeeded, 4 warnings.

The manual pages are in build/sphinx/man.
tk0miya commented 3 years ago

This is a Dockerfile for the uvloop package:

FROM python:3.9-slim

RUN apt update; apt install -y build-essential curl git unzip vim
RUN apt install -y libtool
RUN git clone https://github.com/MagicStack/uvloop
WORKDIR /uvloop
RUN git submodule init; git submodule update
RUN echo "\nimport sys\nprint(sys.path)" >> docs/conf.py
RUN pip3 install git+https://github.com/tk0miya/sphinx@9378_setup_build_lib_path
RUN python setup.py build build_sphinx

It seems sys.path was updated expectedly. But it failed to import uvloop.

Running Sphinx v4.2.0+
['/uvloop', '/uvloop', '/usr/local/lib/python39.zip', '/usr/local/lib/python3.9', '/usr/local/lib/python3.9/lib-dynload', '/usr/local/lib/python3.9/site-packages', 'build/lib.linux-x86_64-3.9']
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 0 source files that are out of date
updating environment: 0 added, 1 changed, 0 removed
reading sources... [100%] api/index
WARNING: autodoc: failed to import class 'EventLoopPolicy' from module 'uvloop'; the following exception was raised:
No module named 'uvloop.loop'
WARNING: autodoc: failed to import function 'new_event_loop' from module 'uvloop'; the following exception was raised:
No module named 'uvloop.loop'
WARNING: autodoc: failed to import class 'Loop' from module 'uvloop'; the following exception was raised:
No module named 'uvloop.loop'
looking for now-outdated files... none found

I got the following error when I tried to import it manually. I don't know why it failed.

root@f2772743913c:/uvloop# PYTHONPATH=/uvloop/build/lib.linux-x86_64-3.9 python -c 'import uvloop'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/uvloop/uvloop/__init__.py", line 7, in <module>
    from .loop import Loop as __BaseLoop  # NOQA
ModuleNotFoundError: No module named 'uvloop.loop'

FYI: I can do build_sphinx successfully if I installed the package via pip install -e .

kloczek commented 3 years ago

I think that I found the cause why that PR does not work but I don't know how correct code should look like. I've modified slightly you addition routine setup_syspath() to add some diagnostics over print(): Here is modified code:

    def setup_syspath(self) -> None:
        """Set up sys.path to import target modules from the build directory."""
        build = self.distribution.command_obj.get('build')  # type: ignore
        build_lib = getattr(build, 'build_lib', None)
        print("build_lib = ", build_lib)
        if build_lib and os.path.exists(build_lib) and build_lib not in sys.path:
            sys.path.append(build_lib)
            print("sys.path modified = ", sys.path)
        print("sys.path = ", sys.path)

and than I've tested that on selenium module. Here is beginning of the output:

[tkloczko@barrel py]$ /usr/bin/python3 setup.py build_sphinx -b man --build-dir build/sphinx --pdb
running build_sphinx
build_lib =  None
sys.path =  ['/home/tkloczko/rpmbuild/BUILD/selenium-selenium-3.141.59/py', '/usr/lib64/python38.zip', '/usr/lib64/python3.8', '/usr/lib64/python3.8/lib-dynload', '/usr/lib64/python3.8/site-packages', '/usr/lib/python3.8/site-packages']
Running Sphinx v4.1.2

As you see because build_lib is None altering sys.path is not done. Key point to add proper modification is location where setuptools keeps that 'build/lib or 'build/lib-.' path which is used to store results of the setuptools build command.

Just in case I'm using setuptools 57.4.0. This may be important detail this is code which pugs into actual setuptools code.

kloczek commented 3 years ago

FYI: I can do build_sphinx successfully if I installed the package via pip install -e .

But in this case module will be not installed in build/lib-<os>.<arch> and it will be used current path which is always present in sys.path.

tk0miya commented 3 years ago

Even if build_sphinx adds the builddir to the sys.path correctly, it would not work well as I tried (and as you did via $PYTHONPATH). So I gave up to implement this way.

kloczek commented 3 years ago

Even if build_sphinx adds the builddir to the sys.path correctly, it would not work well as I tried (and as you did via $PYTHONPATH). So I gave up to implement this way.

Using $PYTHONPATH was only dirty hack to check that that bit is missing.🙄 So how it could/should be implemented?🤔

tk0miya commented 3 years ago

Sorry, I don't know. As I commented, I failed to load the target module even if adding the build dir to sys.path or $PYTHONPATH. I can't find the way to load it without installing it.

kloczek commented 3 years ago

Someone can help?🤔

I just found another module (lz4) which has sphinx documentation and has DSO. What is a bit odd that I don't see that python even is trying to load module.

[tkloczko@barrel python-lz4-3.1.3]$ find /home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/ -type f
/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8/lz4/__init__.py
/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8/lz4/version.py
/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8/lz4/block/__init__.py
/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8/lz4/block/_block.cpython-38-x86_64-linux-gnu.so
/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8/lz4/frame/__init__.py
/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8/lz4/frame/_frame.cpython-38-x86_64-linux-gnu.so
/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8/lz4/stream/__init__.py
/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8/lz4/stream/_stream.cpython-38-x86_64-linux-gnu.so
/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8/lz4/_version.cpython-38-x86_64-linux-gnu.so
/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/temp.linux-x86_64-3.8/lz4/_version.o
/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/temp.linux-x86_64-3.8/lz4/block/_block.o
/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/temp.linux-x86_64-3.8/lz4/frame/_frame.o
/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/temp.linux-x86_64-3.8/lz4/stream/_stream.o

[tkloczko@barrel python-lz4-3.1.3]$ SETUPTOOLS_SCM_PRETEND_VERSION=3.1.3 PYTHONPATH=/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8 strace -fe trace=file /usr/bin/python3 setup.py build_sphinx -b man --build-dir build/sphinx 2>&1  | grep /build/
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
openat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, AT_SYMLINK_NOFOLLOW) = 0
openat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
openat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "./build/__init__.py", 0x7ffe9bbcf3d0, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/sphinx/man", 0x7ffe9bbced00, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/tkloczko/rpmbuild/BUILD/python-lz4-3.1.3/build/lib.linux-x86_64-3.8", {st_mode=S_IFDIR|0755, st_size=6, ...}, 0) = 0

Someone knows why in this simple case python is not even trying to load module?🤔

kloczek commented 3 years ago

OK I found a solution and cause but I don't know how that should be done correctly. Totally by accident building at the same time package with another module I've noticed that setuptools build command executed egg_info command and that module had no problem with building documentation. So I've decided to add in setuptool build additional egg_info command

/usr/bin/python3 setup.py build '--executable=/usr/bin/python3 -s' egg_info

And than after that I was able to build man page even without altering $PYTHONPATH!!

+ PBR_VERSION=3.1.3
+ SETUPTOOLS_SCM_PRETEND_VERSION=3.1.3
+ SPHINXOPTS=-j48
+ /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
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 11 added, 0 changed, 0 removed
reading sources... [100%] userguide
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-lz4.3 { intro install quickstart userguide lz4 lz4.frame lz4.block lz4.stream contributors license } done
build succeeded.

So looks like missing bit in such cases is module metadata generated by egg_info. I've asked on setuptools discussion forum about what is causing that some module during the build executes egg_info and some are not doing that https://github.com/pypa/setuptools/discussions/2756 because I cannot find in the setuptools documentation what is causing that (maybe I'm blind ..)

If in case of lz4 it will be possible to build the documentation without proposed sphinx PR (which I'm using now) it will mean that sphinx<>setuptools is perfectly fine and all what is actually missing are some missing bits in some modules setup.{py,cfg}/project.toml files. Will try to test lz4 tomorrow or next day with sphinx without RP.

If someone knows what is going hereon and why missing metadata are crucial in some cases or what is causing that in case of come modules setuptools build command do not execute egg_info please let me know. For me for now conclusion is that I still don't know enough about setuptools and if someone can point on some parts of available documentation please let me know what I must read to fill gaps in my knowledge in python build tooling.

Good example where build produces as well egg_info: https://github.com/boto/botocore/ and bad one https://github.com/python-lz4/python-lz4/.

kloczek commented 3 years ago

OK I just finished cleaning all my pythom modules to use common procedure to build and install python modules documentation as man pages. sphins patched with https://github.com/sphinx-doc/sphinx/pull/9520 WORKS. I've tested that with +300 modules.

[tkloczko@barrel SPECS]$ grep py3_build_sphinx_man python-*| wc -l
313

Here is full list of my spec files with which I;ve tested that PR:

[tkloczko@barrel SPECS]$ grep py3_build_sphinx_man python-*
python-amqp.spec:%py3_build_sphinx_man
python-anyio.spec:#py3_build_sphinx_man
python-anytree.spec:%py3_build_sphinx_man
python-argcomplete.spec:%py3_build_sphinx_man
python-argh.spec:%py3_build_sphinx_man
python-argon2-cffi.spec:%py3_build_sphinx_man
python-arrow.spec:%py3_build_sphinx_man
python-asgiref.spec:%py3_build_sphinx_man
python-astroid.spec:%py3_build_sphinx_man
python-async-generator.spec:%py3_build_sphinx_man
python-atomicwrites.spec:%py3_build_sphinx_man
python-attrs.spec:%py3_build_sphinx_man
python-augeas.spec:%py3_build_sphinx_man
python-autoapi.spec:%py3_build_sphinx_man
python-autodocsumm.spec:%py3_build_sphinx_man
python-Automat.spec:%py3_build_sphinx_man
python-babel.spec:%py3_build_sphinx_man
python-backcall.spec:%py3_build_sphinx_man
python-backports.entry-points-selectable.spec:%py3_build_sphinx_man
python-beautifulsoup4.spec:%py3_build_sphinx_man
python-betamax.spec:%py3_build_sphinx_man
python-black.spec:%py3_build_sphinx_man
python-bleach.spec:%py3_build_sphinx_man
python-blinker.spec:%py3_build_sphinx_man
python-boto3.spec:%py3_build_sphinx_man
python-botocore.spec:%py3_build_sphinx_man
python-bottle.spec:%py3_build_sphinx_man
python-breathe.spec:%py3_build_sphinx_man
python-build.spec:%py3_build_sphinx_man
python-cachecontrol.spec:%py3_build_sphinx_man
python-cachetools.spec:%py3_build_sphinx_man
python-cbor2.spec:%py3_build_sphinx_man
python-celery.spec:%py3_build_sphinx_man
python-cffi.spec:%py3_build_sphinx_man
python-chai.spec:%py3_build_sphinx_man
python-characteristic.spec:%py3_build_sphinx_man
python-chardet.spec:%py3_build_sphinx_man
python-charset-normalizer.spec:%py3_build_sphinx_man
python-cheroot.spec:%py3_build_sphinx_man
python-cherrypy.spec:%py3_build_sphinx_man
python-click-log.spec:%py3_build_sphinx_man
python-click.spec:%py3_build_sphinx_man
python-colorspacious.spec:#py3_build_sphinx_man
python-CommonMark.spec:%py3_build_sphinx_man
python-contextlib2.spec:%py3_build_sphinx_man
python-convertdate.spec:%py3_build_sphinx_man
python-coveralls.spec:%py3_build_sphinx_man
python-cppy.spec:%py3_build_sphinx_man
python-cssselect.spec:%py3_build_sphinx_man
python-curio.spec:#py3_build_sphinx_man
python-cycler.spec:%py3_build_sphinx_man}
python-cython.spec:%py3_build_sphinx_man
python-dasbus.spec:%py3_build_sphinx_man
python-dateutil.spec:%py3_build_sphinx_man
python-ddt.spec:%py3_build_sphinx_man
python-decorator.spec:%py3_build_sphinx_man
python-dictdiffer.spec:%py3_build_sphinx_man
python-dns.spec:%py3_build_sphinx_man
python-dpkt.spec:#py3_build_sphinx_man
python-dropbox.spec:%py3_build_sphinx_man
python-dulwich.spec:%py3_build_sphinx_man
python-elasticsearch.spec:%py3_build_sphinx_man
python-elementpath.spec:%py3_build_sphinx_man
python-entrypoints.spec:%py3_build_sphinx_man
python-evdev.spec:%py3_build_sphinx_man
python-eventlet.spec:%py3_build_sphinx_man
python-execnet.spec:%py3_build_sphinx_man
python-factory-boy.spec:%py3_build_sphinx_man
python-faker.spec:%py3_build_sphinx_man
python-fastjsonschema.spec:%py3_build_sphinx_man
python-fields.spec:%py3_build_sphinx_man
python-flake8.spec:%py3_build_sphinx_man
python-flask.spec:%py3_build_sphinx_man
python-flask-sqlalchemy.spec:%py3_build_sphinx_man
python-flexmock.spec:%py3_build_sphinx_man
python-gcovr.spec:%py3_build_sphinx_man
python-gitdb.spec:%py3_build_sphinx_man
python-gitlab.spec:%py3_build_sphinx_man
python-GitPython.spec:%py3_build_sphinx_man
python-graphviz.spec:%py3_build_sphinx_man
python-greenlet.spec:%py3_build_sphinx_man
python-h11.spec:%py3_build_sphinx_man
python-h2.spec:%py3_build_sphinx_man
python-hacking.spec:%py3_build_sphinx_man
python-hamcrest.spec:%py3_build_sphinx_man
python-hijri-converter.spec:%py3_build_sphinx_man
python-hpack.spec:%py3_build_sphinx_man
python-html5lib.spec:%py3_build_sphinx_man
python-httpcore.spec:%py3_build_sphinx_man
python-httplib2.spec:%py3_build_sphinx_man
python-hypercorn.spec:%py3_build_sphinx_man
python-hyperframe.spec:%py3_build_sphinx_man
python-hyperlink.spec:%py3_build_sphinx_man
python-hypothesis.spec:%py3_build_sphinx_man
python-ifaddr.spec:%py3_build_sphinx_man
python-importlib-metadata.spec:%py3_build_sphinx_man
python-inflect.spec:%py3_build_sphinx_man
python-ipykernel.spec:%py3_build_sphinx_man
python-ipyparallel.spec:%py3_build_sphinx_man
python-ipython.spec:%py3_build_sphinx_man}
python-ipywidgets.spec:%py3_build_sphinx_man}
python-iso8601.spec:%py3_build_sphinx_man
python-itsdangerous.spec:%py3_build_sphinx_man
python-jaraco-classes.spec:%py3_build_sphinx_man
python-jaraco-collections.spec:%py3_build_sphinx_man
python-jaraco-envs.spec:%py3_build_sphinx_man
python-jaraco-functools.spec:%py3_build_sphinx_man
python-jaraco.itertools.spec:%py3_build_sphinx_man
python-jaraco-packaging.spec:%py3_build_sphinx_man
python-jaraco-path.spec:%py3_build_sphinx_man
python-jaraco-text.spec:%py3_build_sphinx_man
python-jedi.spec:%py3_build_sphinx_man
python-jinja2_pluralize.spec:%py3_build_sphinx_man
python-jinja2.spec:%py3_build_sphinx_man
python-jmespath.spec:%py3_build_sphinx_man
python-joblib.spec:%py3_build_sphinx_man}
python-jsonschema.spec:%py3_build_sphinx_man
python-jupyter-client.spec:%py3_build_sphinx_man}
python-jupyter-core.spec:%py3_build_sphinx_man
python-jupyter-sphinx.spec:%py3_build_sphinx_man}
python-jupytext.spec:%py3_build_sphinx_man
python-kiwisolver.spec:%py3_build_sphinx_man
python-kombu.spec:%py3_build_sphinx_man
python-lark-parser.spec:%py3_build_sphinx_man
python-latexcodec.spec:%py3_build_sphinx_man
python-lazy-object-proxy.spec:%py3_build_sphinx_man
python-libcst.spec:#py3_build_sphinx_man
python-libevdev.spec:%py3_build_sphinx_man
python-linkify-it-py.spec:%py3_build_sphinx_man}
python-lmdb.spec:%py3_build_sphinx_man
python-logbook.spec:%py3_build_sphinx_man
python-lxml.spec:%py3_build_sphinx_man
python-lz4.spec:%py3_build_sphinx_man
python-m2r.spec:%py3_build_sphinx_man
python-mako.spec:%py3_build_sphinx_man
python-markdown-it-py.spec:%py3_build_sphinx_man}
python-markupsafe.spec:%py3_build_sphinx_man
python-mdit-py-plugins.spec:%py3_build_sphinx_man}
python-metaextract.spec:%py3_build_sphinx_man
python-mistune.spec:%py3_build_sphinx_man
python-mock.spec:%py3_build_sphinx_man
python-more-itertools.spec:%py3_build_sphinx_man
python-mpi4py.spec:%py3_build_sphinx_man
python-msgpack.spec:%py3_build_sphinx_man
python-multidict.spec:%py3_build_sphinx_man
python-multipledispatch.spec:%py3_build_sphinx_man
python-mypy.spec:%py3_build_sphinx_man
python-myst-parser.spec:%py3_build_sphinx_man
python-nbclient.spec:%py3_build_sphinx_man
python-nbconvert.spec:#py3_build_sphinx_man
python-nbformat.spec:%py3_build_sphinx_man
python-nbsphinx.spec:%py3_build_sphinx_man}
python-netaddr.spec:%py3_build_sphinx_man
python-notebook.spec:%py3_build_sphinx_man
python-olefile.spec:%py3_build_sphinx_man
python-openstackdocstheme.spec:%py3_build_sphinx_man
python-outcome.spec:%py3_build_sphinx_man
python-packaging.spec:%py3_build_sphinx_man
python-paramiko.spec:%py3_build_sphinx_man
python-parso.spec:%py3_build_sphinx_man
python-parver.spec:%py3_build_sphinx_man
python-paste-deploy.spec:%py3_build_sphinx_man
python-path.spec:%py3_build_sphinx_man
python-pathspec.spec:%py3_build_sphinx_man
python-pbr.spec:%py3_build_sphinx_man
python-pebble.spec:%py3_build_sphinx_man
python-pep517.spec:%py3_build_sphinx_man
python-pillow.spec:%py3_build_sphinx_man
python-pip.spec:%py3_build_sphinx_man
python-pkginfo.spec:%py3_build_sphinx_man
python-platformdirs.spec:%py3_build_sphinx_man
python-pluggy.spec:%py3_build_sphinx_man
python-polib.spec:%py3_build_sphinx_man
python-portend.spec:%py3_build_sphinx_man
python-priority.spec:%py3_build_sphinx_man
python-productmd.spec:%py3_build_sphinx_man
python-prompt-toolkit.spec:%py3_build_sphinx_man
python-psutil.spec:%py3_build_sphinx_man
python-ptyprocess.spec:%py3_build_sphinx_man
python-purl.spec:%py3_build_sphinx_man
python-py2pack.spec:%py3_build_sphinx_man
python-pyasn1.spec:%py3_build_sphinx_man
python-pybtex-docutils.spec:%py3_build_sphinx_man
python-pybtex.spec:%py3_build_sphinx_man
python-pycares.spec:%py3_build_sphinx_man
python-pycodestyle.spec:%py3_build_sphinx_man
python-pydeps.spec:%py3_build_sphinx_man
python-pydocstyle.spec:%py3_build_sphinx_man
python-pyfakefs.spec:%py3_build_sphinx_man
python-pyftpdlib.spec:%py3_build_sphinx_man
python-pygments.spec:%py3_build_sphinx_man
python-pylama.spec:%py3_build_sphinx_man
python-pylint.spec:%py3_build_sphinx_man
python-pymeeus.spec:%py3_build_sphinx_man
python-pynacl.spec:%py3_build_sphinx_man
python-pyOpenSSL.spec:%py3_build_sphinx_man
python-pyparsing.spec:%py3_build_sphinx_man
python-PyQt-builder.spec:%py3_build_sphinx_man
python-pyrad.spec:%py3_build_sphinx_man
python-pyrsistent.spec:%py3_build_sphinx_man
python-py.spec:%py3_build_sphinx_man
python-pytest-benchmark.spec:%py3_build_sphinx_man
python-pytest-checkdocs.spec:%py3_build_sphinx_man
python-pytest-cov.spec:%py3_build_sphinx_man
python-pytest-ordering.spec:%py3_build_sphinx_man
python-pytest-regressions.spec:%py3_build_sphinx_man
python-pytest-relaxed.spec:#py3_build_sphinx_man
python-pytest-runner.spec:%py3_build_sphinx_man
python-pytest.spec:%py3_build_sphinx_man
python-pytest-trio.spec:%py3_build_sphinx_man
python-pytest-xprocess.spec:%py3_build_sphinx_man
python-pyudev.spec:%py3_build_sphinx_man
python-pyxattr.spec:%py3_build_sphinx_man
python-pyxdg.spec:%py3_build_sphinx_man
python-rdflib.spec:#py3_build_sphinx_man
python-releases.spec:#py3_build_sphinx_man
python-reno.spec:#py3_build_sphinx_man
python-repoze-tm2.spec:%py3_build_sphinx_man
python-repoze-who.spec:%py3_build_sphinx_man
python-requests-mock.spec:%py3_build_sphinx_man
python-requests.spec:%py3_build_sphinx_man
python-requests-toolbelt.spec:%py3_build_sphinx_man
python-rfc3986.spec:%py3_build_sphinx_man
python-rich.spec:%py3_build_sphinx_man
python-riemann_client.spec:%py3_build_sphinx_man
python-rsa.spec:%py3_build_sphinx_man
python-rst-linker.spec:%py3_build_sphinx_man
python-scons.spec:%py3_build_sphinx_man
python-scripttest.spec:%py3_build_sphinx_man
python-scss.spec:%py3_build_sphinx_man
python-selenium.spec:%py3_build_sphinx_man
python-semantic-version.spec:%py3_build_sphinx_man
python-service-identity.spec:%py3_build_sphinx_man
python-setuptools.spec:%py3_build_sphinx_man
python-simpleline.spec:%py3_build_sphinx_man
python-six.spec:%py3_build_sphinx_man
python-smartypants.spec:%py3_build_sphinx_man
python-smmap.spec:%py3_build_sphinx_man
python-sniffio.spec:%py3_build_sphinx_man
python-sphinx-argparse.spec:%py3_build_sphinx_man
python-sphinx-autoapi.spec:%py3_build_sphinx_man
python-sphinx-click.spec:%py3_build_sphinx_man
python-sphinxcontrib-asyncio.spec:%py3_build_sphinx_man
python-sphinxcontrib-autoprogram.spec:%py3_build_sphinx_man
python-sphinxcontrib-bibtex.spec:%py3_build_sphinx_man
python-sphinxcontrib-httpdomain.spec:%py3_build_sphinx_man
python-sphinxcontrib-openapi.spec:%py3_build_sphinx_man
python-sphinxcontrib-programoutput.spec:%py3_build_sphinx_man
python-sphinxcontrib-spelling.spec:%py3_build_sphinx_man
python-sphinxcontrib-trio.spec:%py3_build_sphinx_man
python-sphinx-copybutton.spec:%py3_build_sphinx_man
python-sphinxext-opengraph.spec:%py3_build_sphinx_man}
python-sphinx-gallery.spec:%py3_build_sphinx_man}
python-sphinx-hoverxref.spec:%py3_build_sphinx_man
python-sphinx-readable-theme.spec:%py3_build_sphinx_man
python-sphinx-removed-in.spec:%py3_build_sphinx_man
python-sphinx_rtd_theme.spec:%py3_build_sphinx_man
python-sphinx-tabs.spec:%py3_build_sphinx_man
python-sphinx-theme-alabaster.spec:#py3_build_sphinx_man
python-sphinx-typlog-theme.spec:%py3_build_sphinx_man
python-sphobjinv.spec:%py3_build_sphinx_man
python-sqlalchemy.spec:%py3_build_sphinx_man
python-sqlparse.spec:%py3_build_sphinx_man
python-stdlib-list.spec:%py3_build_sphinx_man
python-stem.spec:%py3_build_sphinx_man
python-sure.spec:%py3_build_sphinx_man
python-sybil.spec:%py3_build_sphinx_man
python-systemd.spec:%py3_build_sphinx_man
python-tempora.spec:%py3_build_sphinx_man
python-terminado.spec:%py3_build_sphinx_man
python-testpath.spec:%py3_build_sphinx_man
python-testrepository.spec:%py3_build_sphinx_man
python-test-server.spec:%py3_build_sphinx_man
python-testtools.spec:%py3_build_sphinx_man
python-tidy.spec:%py3_build_sphinx_man
python-tinycss2.spec:%py3_build_sphinx_man
python-toolz.spec:%py3_build_sphinx_man
python-tornado.spec:%py3_build_sphinx_man
python-tox.spec:%py3_build_sphinx_man
python-traitlets.spec:%py3_build_sphinx_man
python-transaction.spec:%py3_build_sphinx_man}
python-trio.spec:%py3_build_sphinx_man
python-trustme.spec:%py3_build_sphinx_man
python-twisted.spec:%py3_build_sphinx_man
python-uritemplate.spec:%py3_build_sphinx_man
python-urllib3.spec:%py3_build_sphinx_man
python-utils.spec:%py3_build_sphinx_man
python-uvloop.spec:#py3_build_sphinx_man
python-validators.spec:%py3_build_sphinx_man
python-vine.spec:%py3_build_sphinx_man
python-virtualenv.spec:%py3_build_sphinx_man
python-waitress.spec:%py3_build_sphinx_man
python-wcwidth.spec:%py3_build_sphinx_man
python-webcolors.spec:%py3_build_sphinx_man
python-webencodings.spec:%py3_build_sphinx_man
python-webob.spec:%py3_build_sphinx_man
python-websocket-client.spec:%py3_build_sphinx_man
python-webtest.spec:%py3_build_sphinx_man
python-werkzeug.spec:%py3_build_sphinx_man
python-wheel.spec:%py3_build_sphinx_man
python-whoosh.spec:%py3_build_sphinx_man
python-wrapt.spec:%py3_build_sphinx_man
python-WSGIProxy2.spec:%py3_build_sphinx_man
python-wsproto.spec:%py3_build_sphinx_man
python-xmlschema.spec:%py3_build_sphinx_man
python-yagot.spec:%py3_build_sphinx_man
python-yamlloader.spec:%py3_build_sphinx_man
python-yarl.spec:%py3_build_sphinx_man
python-zeroconf.spec:%py3_build_sphinx_man
python-zipp.spec:%py3_build_sphinx_man
python-zmq.spec:#py3_build_sphinx_man
python-zope-event.spec:%py3_build_sphinx_man
python-zope-interface.spec:%py3_build_sphinx_man

That %py3_build_sphinx_man looks like below:

[tkloczko@barrel SPECS]$ rpm -E %py3_build_sphinx_man
\
        PBR_VERSION=%{version} \
        SETUPTOOLS_SCM_PRETEND_VERSION=%{version} \
        /usr/bin/python3 setup.py build_sphinx -b man --build-dir build/sphinx

I'm passing my --build-dir because in case some modules build-dir is changed in setup.cfg so thi si only to have independent procedure from those settings.

With that PR I was able to remove all $PYTHONPATH injections on build_sphinx execution so generally that PR aloows simplify build procedure :)

That procedure in many cases needs module metadata however I'v alreadyu opened thiscket for that https://github.com/pypa/setuptools/issues/2761. If seruptools build will ewxecute egg_info like i it in install and test generating documentation from random locations of copy files and have results in fixed path will be working correctly.

kloczek commented 3 years ago

Hmm I found that https://github.com/sphinx-doc/sphinx/pull/9520 have been closed .. why?? :(

tk0miya commented 2 years ago

Sorry for late response. I'm a bit confused. Can #9520 resolve your case? If so, I'll reopen it and merge soon.

tk0miya commented 2 years ago

We determined to deprecate the build_sphinx subcommand since Sphinx-5.0 (refs: #9595). So I'm closing this now.