Open kloczek opened 2 years ago
The project should be installed into the environment before running sphinx-build
. This will be better than the path hack, because we want to make sure setuptools_scm
runs to get the version number right. The official build is on ReadTheDocs and it succeeds without any of these warnings (see a recent build), so I'm not totally sure why you're seeing all this!
We could make a tox env for building the docs, but that's not a high priority for me.
The project should be installed into the environment before running
sphinx-build
.
1) As I wrote that 3 lines patch allows to do generate documentation without that requirement. 2) That patch was only intrpoduction to core issue. Are you going to ingnore that in html outpu (I'm not affected by this issue because I'm interested roff output) all refferences are highlited only and are without links?
In executes command python -m sphinx -T -E -W --keep-going -b dirhtml -d _build/doctrees -D language=en . _build/html
there isn no -h
option which exposet reported issue.
As I wrote that 3 lines patch allows to do generate documentation without that requirement.
Right, and as I explained above, it doesn't work as expected and you'll get the wrong version number!
Right, and as I explained above, it doesn't work as expected and you'll get the wrong version number!
Nope that is not true. Here is the prove:
That's because you previously ran an install. If you do a fresh checkout and run your patched version, it won't work, I promise!
That is as well not true. Here is my build procedure:
%build
%pyproject_wheel
%sphinx_build_man
[tkloczko@pers-jacek SPECS]$ rpm -E %pyproject_wheel
\
CFLAGS="-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none";
CXXFLAGS="-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none";
FFLAGS="-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -I/usr/lib64/gfortran/modules";
FCFLAGS="-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -I/usr/lib64/gfortran/modules";
LDFLAGS="-Wl,--as-needed -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,--build-id=sha1";
CC="/usr/bin/gcc"; CXX="/usr/bin/g++"; FC="/usr/bin/gfortran";
AR="/usr/bin/gcc-ar"; NM="/usr/bin/gcc-nm"; RANLIB="/usr/bin/gcc-ranlib";
export CFLAGS CXXFLAGS FFLAGS FCFLAGS LDFLAGS CC CXX FC AR NM RANLIB;
\
PBR_VERSION=%{version} \
PDM_PEP517_SCM_VERSION=%{version} \
SETUPTOOLS_SCM_PRETEND_VERSION=%{version} \
/usr/bin/python3 -sBm build -w --no-isolation
[tkloczko@pers-jacek SRPMS]$ rpm -E %sphinx_build_man
\
PBR_VERSION=%{version} \
PDM_PEP517_SCM_VERSION=%{version} \
SETUPTOOLS_SCM_PRETEND_VERSION=%{version} \
/usr/bin/sphinx-build -j48 -n -T -b man docs build/sphinx/man
In https://github.com/dfm/emcee/issues/440 you have precise list of python modules installed in that build env.
Really .. please make short test with that pach instread assuming how it works.
Right, you're running build
first, not install
, my bad!
👍 If you don't lika that patch just ignoire it. I'll keep it in my build procedure 😄 As I wrote core of the issiue is related to sphinx warnimgs 😋
IMO that patch has some +value because as I wrote it guarantees that documentation will be always generated out of the code in source tree and not against installed module (which may be in different version). However as I wrote that is only side note .. so if you don't like it just please skip that part 😄
Good - sorry for the quick close! Re-opening wrt to the main issue reported here.
Apologies accepted. Don't worry 😄
First of all currently it is not possible to use straight
sphinx-build
command to build documentation out of source treeThis can be fixed by patch like below:
This patch fixes what is in the comment and that can of fix is suggested in sphinx example copy.py https://www.sphinx-doc.org/en/master/usage/configuration.html#example-of-configuration-file
Than .. on building my packages I'm using
sphinx-build
command with-n
switch which shows warmings about missing references. These are not critical issues.You can peak on fixes that kind of issues in other projects https://github.com/latchset/jwcrypto/pull/289 https://github.com/click-contrib/sphinx-click/commit/abc31069 https://github.com/latchset/jwcrypto/pull/289 https://github.com/RDFLib/rdflib-sqlalchemy/issues/95 https://github.com/sissaschool/elementpath/commit/bf869d9e https://github.com/jaraco/cssutils/issues/21 https://github.com/pywbem/pywbem/pull/2895 https://github.com/sissaschool/xmlschema/commit/42ea98f2 https://github.com/RDFLib/rdflib/pull/2036 https://github.com/frostming/unearth/issues/14 https://github.com/pypa/distlib/commit/98b9b89f