-
-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkgs/sagemath-doc-{html,pdf}
#36730
base: develop
Are you sure you want to change the base?
pkgs/sagemath-doc-{html,pdf}
#36730
Conversation
a46bf5d
to
a559748
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments concerning the meson file.
387607f
to
9e06379
Compare
successfully finished, though
This is Then I ran
|
Version numbers of packages are hardcoded in pkgs/*/VERSION.txt and are update by a commit done by the release manager |
Interesting. I have wanted some of this for the documentation in sage-on-gentoo for some time. This branch lets me creates sdist for just the doc instead of having to checkout the whole tree or tarball. I guess I can figure out how to properly build from the sdist with just the
|
This also failed
|
Thanks for testing! This one should be fixed by 12264c0 |
Makes perfect sense (no pun intended), I should have thought it was the case. |
@kwankyu In this run, it is trying to install sagemath-standard from scratch, and that is failing somehow. Hard to see why without more output. Try if |
I am just looking at sage-doc-html right now, but I am guessing it will be the same with pdf, the sdist includes |
Should be fixed in 62b706c (not tested) |
Appears to have done the job, thanks. Building sage-doc-html, single threaded... started 20mn ago. |
Failed with same error
Full log: |
@kwankyu is sage_setup installed under |
In |
It should work for me in sage-on-gentoo though. I will try. |
I have now successfully build a sage-doc-html wheel with
|
…ing pypa/build for now
… create symlinks into build dir
… create symlinks into build dir (fixup)
f5d00ee
to
58e30fe
Compare
We create pip-installable packages that provide the Sage documentation. This is a step toward #29868, which has the full design.
We want to install the HTML documentation in
share/doc/sage/html
. So we need a build system that supports such "non-package data".wheel.shared-data
https://hatch.pypa.io/latest/plugins/builder/wheel/#configuration; example: https://github.com/jupyter/nbconvert/blob/main/pyproject.toml#L93C27-L93C44; dynamic data: How should one programmatically generated `shared-data`? pypa/hatch#528{datadir}
https://meson-python.readthedocs.io/en/latest/reference/limitations.html#non-package-data-files; status of editable wheels to be checked.For synergy with #34630, we use meson-python - with a trivial
pkgs/sagemath-doc-html/meson.build
file that just runsmake
with the existing Makefile.The actual build happens using ninja.
In the current implementation:
SAGE_EDITABLE
is set toyes
(default), this usespip install -e
, which does the incremental docbuild (inpkgs/sagemath-doc-*/build
) and creates symlinks in$SAGE_LOCAL/share/doc/sage/
that point there.SAGE_WHEELS
is set toyes
, this builds a wheel from scratch, which contains the HTML documentation as non-package data files. IfSAGE_EDITABLE
is not set, then it installs the wheel using--prefix=$SAGE_LOCAL
so that the HTML documentation appears in the familiar location.We do the same with PDF in sagemath-doc-pdf.
GH Actions workflows:
dist.yml
The workflow (run on release tags) builds the sdists and uploads them to PyPI, along with the other pip-installable packages.
doc-build.yml
builds the live doc (HTML + PDF) by going through the wheels and uploads to PyPI if the credentials are present.To test:
make sagemath_doc_html
andmake sagemath_doc_pdf
should continue to workmake SAGE_WHEELS=yes sagemath_doc_html
andmake SAGE_WHEELS=yes sagemath_doc_pdf
should both work and create (architecture-independent) wheels inprefix/var/lib/sage/wheels/
make sagemath_doc_html-sdist
andmake sagemath_doc_pdf-sdist
should both create.tar.gz
files inupstream/
./sage -sh -c 'python3 -m build --no-isolation --skip-dependency-check --wheel .'
SAGE_ROOT/src/doc
; and building should not touchprefix/share/doc
at all. The documentation source comes from the sdist, and building the wheel should only write to a temporary directory, from which it creates the wheel.In follow-up PRs:
_static
are in the HTML wheel (because wheels cannot store symlinks); this could be fixed by WSL: Chrome on Windows does not find the_static
style in built HTML doc #35538 (comment). Using compression (thanks to meson-python >= 0.15), we are at 85 MB.src/doc
. This duplication could be reduced by introducing more distributions as originally proposed in pip-installable packages sagemath-doc-src, sagemath-doc-inventory, sagemath-doc-html, sagemath-doc-pdf #29868.📝 Checklist
⌛ Dependencies
setup.py bdist_wheel
and direct uses ofpython3 -m build
#38201