Hello. Is the Hamilton documentation in a PDF file...
# general
d
Hello. Is the Hamilton documentation in a PDF file I can download for offline reading?
s
We haven't set up something formal. I have a script somewhere for it
We use sphinx so it's a matter of using the appropriate plugin...
Is this a blocker for you? Or? (actually I think I emailed you a version a while back?)
d
I don't recall getting a PDF via email. I apologize if you did and I've forgotten. I work with systems that are air-gapped. Having the documentation easily transportable would help me use it on those systems.
At time I work with ETL pipelines. It would be nice to use Hamilton for some of that work. It would make documentation easier and encourage us to keep the documentation up to date.
s
All good. Is it possible for you to clone the repo and build the PDF if I can give you the instructions? That way you’d be able to always pull and generate the latest?
d
yes, please. I just cloned.
sphinx-build -b dirhtml -W -E -T -a docs /tmp/mydocs - this command did build the HTML documentation.
s
Yeah to create a pdf we need to add some more sphinx dependencies. Let me verify my old script still works.
Or maybe self hosting the html would work with the simple http server python comes with?
d
i want to move the pdf file to an air-gapped server.
i tried to a bit of research but I keep seeing some variant of "builder pdf not registered or available"
s
Yeah zip the html and run python? Yeah I managed to get it working with simplepdf at one point.
I'll try my script in a few and then send you a branch
Okay I believe I got it working — only thing to double check is whether there’s anything new that needs to be added to the python dependencies — I don’t think so.
so if you fetch the repo, and then switch to
add_pdf_instructions
and then:
pip install sphinx-simplepdf
into the environment with all the docs requirements then
sphinx-build -b simplepdf -W -E -T -a docs /tmp/mydocs
the pdf should turn up under
/tmp/mydocs
d
This is not a hamilton issue, but I am seeing this: OSError: cannot load library 'pango-1.0-0': pango-1.0-0: cannot open shared object file: No such file or directory. Additionally, ctypes.util.find_library() did not manage to locate a library called 'pango-1.0-0' Trying to debug it now. The error is coming from weasyprint. But that pango library is installed.
locate libpango-1.0.so <-- this command finds 45(!) copies of the library.
s
Wow. Let me do a pip freeze and send that
Since I also haven't updated all my dependencies in a while
d
i've tried adding various symbolic links. Other people are having this issue. So far, following their recommendations has not helped. I'm using ubuntu which is a fairly common distribution.
s
I'm on Mac
d
would it be difficult for me to change from pip to conda? I can convert your pip freeze output. That might isolate the issue. Or I can use a docker container. Would this be helpful to the project if I spend time to track this down? Especially if I do it inside a container so anyone can re-use?
s
I do a pip install -e . for the hamilton repo FYI:
These are the docs requirements - https://github.com/DAGWorks-Inc/hamilton/blob/main/pyproject.toml#L50 + the
sphinx-simplepdf
addition. I haven’t tried pip to conda before. Oh and I’m on
python 3.10
Here’s what I was able to create off of main on the
add_pdf_instructions
branch
Otherwise in short — any documentation to help get this running would be worthwhile. We have other folks working with Hamilton in air gapped environments. Can add it to the README-DOCS.md .
otherwise yeah pango isn’t a top level pip dependency
but I do see that pango is referenced in `simplepdf`’s instructions — https://sphinx-simplepdf.readthedocs.io/en/latest/installation.html
🤔 I guess we could think about adding it to the read the docs build so it’s a static PDF people could link to
d
Thanks for taking the time to consider that.
s
@David Medinets Okay problem solved! read the docs has a one line change to make a PDF So go to https://hamilton.dagworks.io/en/latest/ then hit this in the bottom right — and then it should expand to show “downloads” and a PDF option.
there’s some metadata we’re missing in the created PDF but at least there’s a PDF
👍 1
d
Changing to a conda environment is challenging. All of the dependencies don't play well. And some have different names. Now that I've tried, I don't recommend it. Too much chance for subtle bugs to be introduced.
👍 1
s
Otherwise is the produced PDF hosted on docs that you can download sufficient? I haven’t actually checked all of it.