Michael J Gruber venit, vidit, dixit 2026-06-18 15:46:42:
> Am Do., 18. Juni 2026 um 15:20 Uhr schrieb Miro Hrončok <[email protected]>:
> >
> > On 18. 06. 26 15:00, Michael J Gruber wrote:
> > > Hi there
> > >
> > > Even after reading our packaging doc I'm wondering what's the proper
> > > way to handle sphinx doc autogenerated from built sources.
> > >
> > > The issue is that %build is the section where all building should be
> > > done, followed by %install and %check. Building the documentation
> > > (e.g. using sphinx autodoc) is clearly a build step, but often
> > > requires the build products, and often *installed* build products.
> > >
> > > [I came across an upstream which even calls "pip install" from
> > > sphinx's docs/conf.py ... ]
> > >
> > > So, what do you guys do? Build docs in %install and point py/sphinx to
> > > the installed sources? Build docs after the wheel and point py to
> > > %{pyproject_whichone_please}? I somehow cannot find a solution without
> > > failed imports being reported by sphinx.
> >
> > I usually try to do PYTHONPATH=%{buildroot}%{_pyproject_wheeldir}/...whl -- 
> > it
> > should work. If we need to make %{_pyproject_wheeldir} a public macro, we 
> > can.
> 
> Cool, I didn't know that one can put a wheel on PYTHONPATH. Works!
> [FTR: %{_pyproject_wheeldir} contains %{buildroot} already.]
> 
> I'm still wondering how "bad" (policy, side-effects) building doc in
> %install would be, but I don't need to in this case any more.
> 

Update: Works as reported for pure python wheels.

Now, with a wheel that has swig bindings and some so in it (_capi.abi3.so
for notmuch2), there's a problem:

ImportError: cannot import name '_capi' from partially initialized module 
'notmuch2' (most likely due to a circular import)

No, it's not circular. Oh well. But things are a bit messy for that
mixed package anyways.

Michael
-- 
_______________________________________________
devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it: 
https://forge.fedoraproject.org/infra/tickets/issues/new

Reply via email to