Skip to content

pkgs/sagemath-doc-{html,pdf} #36730

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

Draft
wants to merge 51 commits into
base: develop
Choose a base branch
from
Draft

Conversation

mkoeppe
Copy link
Contributor

@mkoeppe mkoeppe commented Nov 17, 2023

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".

For synergy with #34630, we use meson-python - with a trivial pkgs/sagemath-doc-html/meson.build file that just runs make with the existing Makefile.
The actual build happens using ninja.

In the current implementation:

  • if SAGE_EDITABLE is set to yes (default), this uses pip install -e, which does the incremental docbuild (in pkgs/sagemath-doc-*/build) and creates symlinks in $SAGE_LOCAL/share/doc/sage/ that point there.
  • if SAGE_WHEELS is set to yes, this builds a wheel from scratch, which contains the HTML documentation as non-package data files. If SAGE_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:

  • On release tags, the workflow dist.yml
    The workflow (run on release tags) builds the sdists and uploads them to PyPI, along with the other pip-installable packages.
  • On release tags, 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 and make sagemath_doc_pdf should continue to work
  • make SAGE_WHEELS=yes sagemath_doc_html and make SAGE_WHEELS=yes sagemath_doc_pdf should both work and create (architecture-independent) wheels in prefix/var/lib/sage/wheels/
  • make sagemath_doc_html-sdist and make sagemath_doc_pdf-sdist should both create .tar.gz files in upstream/
  • these sdists declare the Sage library as a build dependency and should be buildable when disabling build isolation in a virtual environment with an installed Sage library, for example by unpacking the sdist and then using ./sage -sh -c 'python3 -m build --no-isolation --skip-dependency-check --wheel .'
  • This should still work if you move away SAGE_ROOT/src/doc; and building should not touch prefix/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:

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

⌛ Dependencies

Copy link
Contributor

@tobiasdiez tobiasdiez left a 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.

@kwankyu
Copy link
Collaborator

kwankyu commented Nov 22, 2023

 export SAGE_WHEELS=yes
./bootstrap && ./configure && make -j4 

successfully finished, though

[sagemath_doc_html-10.2.rc3] [10976/10976] /Users/kwankyu/GitHub/sage-dev/pkgs/sagemath-doc-html/.mesonpy-zdxa0nog/html/tr/a_tour_of_sage/_static/styles/furo.css.map
[sagemath_doc_html-10.2.rc3] Successfully built sagemath_doc_html-10.2rc3-py3-none-any.whl
[sagemath_doc_html-10.2.rc3] WARNING: Skipping sagemath_doc_html as it is not installed.
[sagemath_doc_html-10.2.rc3] Using pip 23.3.1 from /Users/kwankyu/GitHub/sage-dev/local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/pip (python 3.11)
[sagemath_doc_html-10.2.rc3] Looking in links: /Users/kwankyu/GitHub/sage-dev/local/var/lib/sage/wheels
[sagemath_doc_html-10.2.rc3] Processing /Users/kwankyu/GitHub/sage-dev/local/var/lib/sage/wheels/sagemath_doc_html-10.2rc3-py3-none-any.whl
[sagemath_doc_html-10.2.rc3] Installing collected packages: sagemath-doc-html
[sagemath_doc_html-10.2.rc3] Successfully installed sagemath-doc-html-10.2rc3

This is rc4. Why is it sagemath_doc_html-10.2.rc3?

Then I ran make sagemath_doc_pdf. I got

[sagemath_doc_pdf-10.2.rc3] The Meson build system
[sagemath_doc_pdf-10.2.rc3] Version: 1.2.1
[sagemath_doc_pdf-10.2.rc3] Source dir: /Users/kwankyu/GitHub/sage-dev/pkgs/sagemath-doc-pdf
[sagemath_doc_pdf-10.2.rc3] Build dir: /Users/kwankyu/GitHub/sage-dev/pkgs/sagemath-doc-pdf/.mesonpy-aid6czcw
[sagemath_doc_pdf-10.2.rc3] Build type: native build
[sagemath_doc_pdf-10.2.rc3] 
[sagemath_doc_pdf-10.2.rc3] ../meson.build:12:58: ERROR: Expecting rbracket got rparen.
[sagemath_doc_pdf-10.2.rc3]   command: [meson.current_source_dir() / 'doc' / 'make.sh'),
[sagemath_doc_pdf-10.2.rc3]            ^______________________________________________^
[sagemath_doc_pdf-10.2.rc3] 
[sagemath_doc_pdf-10.2.rc3] A full log can be found at /Users/kwankyu/GitHub/sage-dev/pkgs/sagemath-doc-pdf/.mesonpy-aid6czcw/meson-logs/meson-log.txt
[sagemath_doc_pdf-10.2.rc3] 
[sagemath_doc_pdf-10.2.rc3] ERROR Backend subprocess exited when trying to invoke build_wheel
[sagemath_doc_pdf-10.2.rc3] ********************************************************************************
[sagemath_doc_pdf-10.2.rc3] Failure building wheel
[sagemath_doc_pdf-10.2.rc3] ********************************************************************************

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 22, 2023

This is rc4. Why is it sagemath_doc_html-10.2.rc3?

Version numbers of packages are hardcoded in pkgs/*/VERSION.txt and are update by a commit done by the release manager

@kiwifb
Copy link
Member

kiwifb commented Nov 23, 2023

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 cd doc && make doc-html command but I tried with python -m build to see.

fbissey@tarazed ~/sandbox/sagemath_doc_html-10.2rc3 $ python -m build -n -x -w
* Building wheel...
+ meson setup /home/fbissey/sandbox/sagemath_doc_html-10.2rc3 /home/fbissey/sandbox/sagemath_doc_html-10.2rc3/.mesonpy-qfdw7fkf -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/home/fbissey/sandbox/sagemath_doc_html-10.2rc3/.mesonpy-qfdw7fkf/meson-python-native-file.ini
The Meson build system
Version: 1.3.0
Source dir: /home/fbissey/sandbox/sagemath_doc_html-10.2rc3
Build dir: /home/fbissey/sandbox/sagemath_doc_html-10.2rc3/.mesonpy-qfdw7fkf
Build type: native build
Project name: sagemath-doc-html
Project version: 10.2.rc3
Host machine cpu family: x86_64
Host machine cpu: x86_64
Build targets in project: 1

sagemath-doc-html 10.2.rc3

  User defined options
    Native files: /home/fbissey/sandbox/sagemath_doc_html-10.2rc3/.mesonpy-qfdw7fkf/meson-python-native-file.ini
    buildtype   : release
    b_ndebug    : if-release
    b_vscrt     : md

Found ninja-1.11.1 at /usr/bin/ninja
+ /usr/bin/ninja                                                                                                                    
[1/1] Generating HTML documentation with a custom command (wrapped by meson to set env)
FAILED: index.html 
env SAGE_DOC=/home/fbissey/sandbox/sagemath_doc_html-10.2rc3/.mesonpy-qfdw7fkf /home/fbissey/sandbox/sagemath_doc_html-10.2rc3/doc/make.sh -C /home/fbissey/sandbox/sagemath_doc_html-10.2rc3/doc doc-html
/home/fbissey/sandbox/sagemath_doc_html-10.2rc3/doc/make.sh: line 12: exec: -C: invalid option
exec: usage: exec [-cl] [-a name] [command [argument ...]] [redirection ...]
ninja: build stopped: subcommand failed.

ERROR Backend subprocess exited when trying to invoke build_wheel

@kwankyu
Copy link
Collaborator

kwankyu commented Nov 23, 2023

This also failed

$ pip install upstream/sagemath_doc_pdf-10.2rc3.tar.gz 
WARNING: Skipping /usr/local/lib/python3.11/site-packages/numpy-1.26.1-py3.11.egg-info due to invalid metadata entry 'name'
WARNING: Skipping /usr/local/lib/python3.11/site-packages/packaging-23.2.dist-info due to invalid metadata entry 'name'
WARNING: Skipping /usr/local/lib/python3.11/site-packages/numpy-1.26.1-py3.11.egg-info due to invalid metadata entry 'name'
WARNING: Skipping /usr/local/lib/python3.11/site-packages/packaging-23.2.dist-info due to invalid metadata entry 'name'
Processing ./upstream/sagemath_doc_pdf-10.2rc3.tar.gz
  Installing build dependencies ... error
  error: subprocess-exited-with-error
  
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [89 lines of output]
      WARNING: Skipping /usr/local/lib/python3.11/site-packages/numpy-1.26.1-py3.11.egg-info due to invalid metadata entry 'name'
      WARNING: Skipping /usr/local/lib/python3.11/site-packages/packaging-23.2.dist-info due to invalid metadata entry 'name'
      Collecting meson-python
        Downloading meson_python-0.15.0-py3-none-any.whl (25 kB)
      Collecting sage-docbuild~=10.2rc4
        Downloading sage-docbuild-10.2rc4.tar.gz (71 kB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 71.3/71.3 kB 2.8 MB/s eta 0:00:00
        Preparing metadata (setup.py): started
        Preparing metadata (setup.py): finished with status 'done'
      Collecting sphinx<8,>=5.2
        Using cached sphinx-7.2.6-py3-none-any.whl (3.2 MB)
      Collecting sphinx-copybutton
        Downloading sphinx_copybutton-0.5.2-py3-none-any.whl (13 kB)
      Collecting furo
        Downloading furo-2023.9.10-py3-none-any.whl (324 kB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 324.4/324.4 kB 6.8 MB/s eta 0:00:00
      Collecting jupyter-sphinx
        Downloading jupyter_sphinx-0.4.0-py3-none-any.whl (21 kB)
      Collecting sagemath-standard~=10.2rc4
        Downloading sagemath-standard-10.2rc4.tar.gz (19.4 MB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 19.4/19.4 MB 8.1 MB/s eta 0:00:00
        Installing build dependencies: started
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: still running...
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'error'
        error: subprocess-exited-with-error
      
        × Getting requirements to build wheel did not run successfully.
        │ exit code: 1
        ╰─> [20 lines of output]
            Error in sitecustomize; set PYTHONVERBOSE for traceback:
            AssertionError:
            Traceback (most recent call last):
              File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
                main()
              File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
                json_out['return_val'] = hook(**hook_input['kwargs'])
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 118, in get_requires_for_build_wheel
                return hook(config_settings)
                       ^^^^^^^^^^^^^^^^^^^^^
              File "/usr/local/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
                return self._get_build_requires(config_settings, requirements=['wheel'])
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              File "/usr/local/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
                self.run_setup()
              File "/usr/local/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/build_meta.py", line 335, in run_setup
                exec(code, locals())
              File "<string>", line 42, in <module>
            ModuleNotFoundError: No module named 'sage_setup'
            [end of output]
      
        note: This error originates from a subprocess, and is likely not a problem with pip.
      error: subprocess-exited-with-error
      
      × Getting requirements to build wheel did not run successfully.
      │ exit code: 1
      ╰─> See above for output.
      
      note: This error originates from a subprocess, and is likely not a problem with pip.
      WARNING: Skipping /usr/local/lib/python3.11/site-packages/numpy-1.26.1-py3.11.egg-info due to invalid metadata entry 'name'
      WARNING: Skipping /usr/local/lib/python3.11/site-packages/packaging-23.2.dist-info due to invalid metadata entry 'name'
      WARNING: Skipping /usr/local/lib/python3.11/site-packages/numpy-1.26.1-py3.11.egg-info due to invalid metadata entry 'name'
      WARNING: Skipping /usr/local/lib/python3.11/site-packages/packaging-23.2.dist-info due to invalid metadata entry 'name'
      WARNING: There was an error checking the latest version of pip.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
WARNING: Skipping /usr/local/lib/python3.11/site-packages/numpy-1.26.1-py3.11.egg-info due to invalid metadata entry 'name'
WARNING: Skipping /usr/local/lib/python3.11/site-packages/packaging-23.2.dist-info due to invalid metadata entry 'name'
WARNING: Skipping /usr/local/lib/python3.11/site-packages/numpy-1.26.1-py3.11.egg-info due to invalid metadata entry 'name'
WARNING: Skipping /usr/local/lib/python3.11/site-packages/packaging-23.2.dist-info due to invalid metadata entry 'name'
WARNING: There was an error checking the latest version of pip.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 23, 2023

env SAGE_DOC=/home/fbissey/sandbox/sagemath_doc_html-10.2rc3/.mesonpy-qfdw7fkf /home/fbissey/sandbox/sagemath_doc_html-10.2rc3/doc/make.sh -C /home/fbissey/sandbox/sagemath_doc_html-10.2rc3/doc doc-html
/home/fbissey/sandbox/sagemath_doc_html-10.2rc3/doc/make.sh: line 12: exec: -C: invalid option
exec: usage: exec [-cl] [-a name] [command [argument ...]] [redirection ...]
ninja: build stopped: subcommand failed.

Thanks for testing! This one should be fixed by 12264c0

@kiwifb
Copy link
Member

kiwifb commented Nov 23, 2023

Makes perfect sense (no pun intended), I should have thought it was the case.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 23, 2023

This also failed

$ pip install upstream/sagemath_doc_pdf-10.2rc3.tar.gz 
WARNING: Skipping /usr/local/lib/python3.11/site-packages/numpy-1.26.1-py3.11.egg-info due to invalid metadata entry 'name'

@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 pip install -v -v -v "sagemath-standard~=10.2rc4" works

@kiwifb
Copy link
Member

kiwifb commented Nov 23, 2023

I am just looking at sage-doc-html right now, but I am guessing it will be the same with pdf, the sdist includes pyproject.toml.m4 which we do not want. It would be nice to remove it but that's definitely not a top priority.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 23, 2023

Should be fixed in 62b706c (not tested)

@kiwifb
Copy link
Member

kiwifb commented Nov 23, 2023

Should be fixed in 62b706c (not tested)

Appears to have done the job, thanks. Building sage-doc-html, single threaded... started 20mn ago.

@kwankyu
Copy link
Collaborator

kwankyu commented Nov 23, 2023

pip install -v -v -v "sagemath-standard~=10.2rc4"

Failed with same error

  WARNING: Skipping /usr/local/lib/python3.11/site-packages/packaging-23.2.dist-info due to invalid metadata entry 'name'
  WARNING: There was an error checking the latest version of pip.
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  Error in sitecustomize; set PYTHONVERBOSE for traceback:
  AssertionError:
  Traceback (most recent call last):
    File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
      main()
    File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
             ^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
      self.run_setup()
    File "/usr/local/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/build_meta.py", line 335, in run_setup
      exec(code, locals())
    File "<string>", line 42, in <module>
  ModuleNotFoundError: No module named 'sage_setup'
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.

Full log:
log.txt

@kiwifb
Copy link
Member

kiwifb commented Nov 23, 2023

@kwankyu is sage_setup installed under /usr/local/lib/python3.11/site-package or otherwise in the python path?

@kwankyu
Copy link
Collaborator

kwankyu commented Nov 23, 2023

/usr/local/lib/python3.11/site-package

sage_setup is not there.

In /usr/local/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages, there is no sage_setup either.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 23, 2023

@kiwifb
Copy link
Member

kiwifb commented Nov 23, 2023

It should work for me in sage-on-gentoo though. I will try.

@kiwifb
Copy link
Member

kiwifb commented Nov 23, 2023

Should be fixed in 62b706c (not tested)

Appears to have done the job, thanks. Building sage-doc-html, single threaded... started 20mn ago.

I have now successfully build a sage-doc-html wheel with python -m build from the sdist.

fbissey@tarazed ~/sandbox/sagemath_doc_html-10.2rc3 $ ll dist/
total 436M
drwxr-xr-x 2 fbissey fbissey 4.0K Nov 23 16:51 .
drwxr-xr-x 4 fbissey fbissey 4.0K Nov 23 16:51 ..
-rw-r--r-- 1 fbissey fbissey 436M Nov 23 16:51 sagemath_doc_html-10.2rc3-py3-none-any.whl

@kwankyu
Copy link
Collaborator

kwankyu commented Nov 27, 2023

This PR works for me except sdist. It seems my system is exceptional. I leave review decision to others.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 27, 2023

Does the sdist work if you install it from within sage -sh?

@kwankyu
Copy link
Collaborator

kwankyu commented Nov 28, 2023

I get

(sage-sh) kwankyu@Hera:sagemath_doc_html-10.2rc3$ python -m build .
* Creating venv isolated environment...
* Installing packages in isolated environment... (furo, jupyter-sphinx, meson-python, sage-docbuild ~= 10.2rc4, sagemath-standard ~= 10.2rc4, sphinx >=5.2, <8, sphinx-copybutton)
Collecting furo (from -r /var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-reqs-_j0tv9mc.txt (line 1))
  Using cached furo-2023.9.10-py3-none-any.whl.metadata (5.9 kB)
Collecting sage-docbuild~=10.2rc4 (from -r /var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-reqs-_j0tv9mc.txt (line 2))
  Using cached sage-docbuild-10.2rc4.tar.gz (71 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting meson-python (from -r /var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-reqs-_j0tv9mc.txt (line 3))
  Using cached meson_python-0.15.0-py3-none-any.whl.metadata (4.1 kB)
Collecting sphinx-copybutton (from -r /var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-reqs-_j0tv9mc.txt (line 4))
  Using cached sphinx_copybutton-0.5.2-py3-none-any.whl (13 kB)
Collecting sagemath-standard~=10.2rc4 (from -r /var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-reqs-_j0tv9mc.txt (line 5))
  Using cached sagemath-standard-10.2rc4.tar.gz (19.4 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
ERROR: Exception:
Traceback (most recent call last):
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_internal/cli/base_command.py", line 180, in exc_logging_wrapper
    status = run_func(*args)
             ^^^^^^^^^^^^^^^
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_internal/cli/req_command.py", line 245, in wrapper
    return func(self, options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_internal/commands/install.py", line 377, in run
    requirement_set = resolver.resolve(
                      ^^^^^^^^^^^^^^^^^
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 95, in resolve
    result = self._result = resolver.resolve(
                            ^^^^^^^^^^^^^^^^^
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_vendor/resolvelib/resolvers.py", line 397, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_vendor/resolvelib/resolvers.py", line 173, in _add_to_criteria
    if not criterion.candidates:
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_vendor/resolvelib/structs.py", line 156, in __bool__
    return bool(self._sequence)
           ^^^^^^^^^^^^^^^^^^^^
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 155, in __bool__
    return any(self)
           ^^^^^^^^^
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 143, in <genexpr>
    return (c for c in iterator if id(c) not in self._incompatible_ids)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 47, in _iter_built
    candidate = func()
                ^^^^^^
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 211, in _make_candidate_from_link
    self._link_candidate_cache[link] = LinkCandidate(
                                       ^^^^^^^^^^^^^^
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 293, in __init__
    super().__init__(
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 156, in __init__
    self.dist = self._prepare()
                ^^^^^^^^^^^^^^^
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 225, in _prepare
    dist = self._prepare_distribution()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 304, in _prepare_distribution
    return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_internal/operations/prepare.py", line 525, in prepare_linked_requirement
    return self._prepare_linked_requirement(req, parallel_builds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_internal/operations/prepare.py", line 640, in _prepare_linked_requirement
    dist = _get_prepared_distribution(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_internal/operations/prepare.py", line 71, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_internal/distributions/sdist.py", line 54, in prepare_distribution_metadata
    self._install_build_reqs(finder)
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_internal/distributions/sdist.py", line 124, in _install_build_reqs
    build_reqs = self._get_build_requires_wheel()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_internal/distributions/sdist.py", line 101, in _get_build_requires_wheel
    return backend.get_requires_for_build_wheel()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_internal/utils/misc.py", line 751, in get_requires_for_build_wheel
    return super().get_requires_for_build_wheel(config_settings=cs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_impl.py", line 166, in get_requires_for_build_wheel
    return self._call_hook('get_requires_for_build_wheel', {
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_impl.py", line 321, in _call_hook
    raise BackendUnavailable(data.get('traceback', ''))
pip._vendor.pyproject_hooks._impl.BackendUnavailable: Traceback (most recent call last):
  File "/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 77, in _build_backend
    obj = import_module(mod_path)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'setuptools'


Traceback (most recent call last):
  File "/Users/kwankyu/GitHub/sage-dev/local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/build/__main__.py", line 388, in main
    built = build_call(
            ^^^^^^^^^^^
  File "/Users/kwankyu/GitHub/sage-dev/local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/build/__main__.py", line 239, in build_package_via_sdist
    sdist = _build(isolation, srcdir, outdir, 'sdist', config_settings, skip_dependency_check)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kwankyu/GitHub/sage-dev/local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/build/__main__.py", line 147, in _build
    return _build_in_isolated_env(srcdir, outdir, distribution, config_settings)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kwankyu/GitHub/sage-dev/local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/build/__main__.py", line 113, in _build_in_isolated_env
    env.install(builder.build_system_requires)
  File "/Users/kwankyu/GitHub/sage-dev/local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/build/env.py", line 143, in install
    _subprocess(cmd)
  File "/Users/kwankyu/GitHub/sage-dev/local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/build/env.py", line 64, in _subprocess
    subprocess.run(cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
  File "/usr/local/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/bin/python', '-Im', 'pip', 'install', '--use-pep517', '--no-warn-script-location', '-r', '/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-reqs-_j0tv9mc.txt']' returned non-zero exit status 2.

ERROR Command '['/private/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-env-ax6r733_/bin/python', '-Im', 'pip', 'install', '--use-pep517', '--no-warn-script-location', '-r', '/var/folders/td/fw1q9ljs311ggyph77rs53_40000gn/T/build-reqs-_j0tv9mc.txt']' returned non-zero exit status 2.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 28, 2023

How about python -m build --no-isolation .

@kwankyu
Copy link
Collaborator

kwankyu commented Nov 28, 2023

(sage-sh) kwankyu@Hera:sagemath_doc_html-10.2rc3$ python -m build --no-isolation .
* Getting build dependencies for sdist...

ERROR Missing dependencies:
	meson-python
	meson>=0.63.3

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 28, 2023

Add --skip-dependency-check

@kwankyu
Copy link
Collaborator

kwankyu commented Nov 28, 2023

(sage-sh) kwankyu@Hera:sagemath_doc_html-10.2rc3$ python -m build --no-isolation --skip-dependency-check .
* Building sdist...
+ meson setup /Users/kwankyu/test/sagemath_doc_html-10.2rc3 /Users/kwankyu/test/sagemath_doc_html-10.2rc3/.mesonpy-6is7awgq -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/Users/kwankyu/test/sagemath_doc_html-10.2rc3/.mesonpy-6is7awgq/meson-python-native-file.ini
The Meson build system
Version: 1.3.0
Source dir: /Users/kwankyu/test/sagemath_doc_html-10.2rc3
Build dir: /Users/kwankyu/test/sagemath_doc_html-10.2rc3/.mesonpy-6is7awgq
Build type: native build
Project name: sagemath-doc-html
Project version: 10.2.rc3
Host machine cpu family: x86_64
Host machine cpu: x86_64
Build targets in project: 1

sagemath-doc-html 10.2.rc3

  User defined options
    Native files: /Users/kwankyu/test/sagemath_doc_html-10.2rc3/.mesonpy-6is7awgq/meson-python-native-file.ini
    buildtype   : release
    b_ndebug    : if-release
    b_vscrt     : md

Found ninja-1.11.1 at /usr/local/bin/ninja
+ meson dist --allow-dirty --no-tests --formats gztar                                                                                      
Dist currently only works with Git or Mercurial repos

ERROR Backend subprocess exited when trying to invoke build_sdist

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 28, 2023

One more switch: --wheel

@kwankyu
Copy link
Collaborator

kwankyu commented Nov 28, 2023

It seems working. Now pending at

(sage-sh) kwankyu@Hera:sagemath_doc_html-10.2rc3$ python -m build --no-isolation --skip-dependency-check --wheel .
* Building wheel...
+ meson setup /Users/kwankyu/test/sagemath_doc_html-10.2rc3 /Users/kwankyu/test/sagemath_doc_html-10.2rc3/.mesonpy-rrb8smqe -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/Users/kwankyu/test/sagemath_doc_html-10.2rc3/.mesonpy-rrb8smqe/meson-python-native-file.ini
The Meson build system
Version: 1.3.0
Source dir: /Users/kwankyu/test/sagemath_doc_html-10.2rc3
Build dir: /Users/kwankyu/test/sagemath_doc_html-10.2rc3/.mesonpy-rrb8smqe
Build type: native build
Project name: sagemath-doc-html
Project version: 10.2.rc3
Host machine cpu family: x86_64
Host machine cpu: x86_64
Build targets in project: 1

sagemath-doc-html 10.2.rc3

  User defined options
    Native files: /Users/kwankyu/test/sagemath_doc_html-10.2rc3/.mesonpy-rrb8smqe/meson-python-native-file.ini
    buildtype   : release
    b_ndebug    : if-release
    b_vscrt     : md

Found ninja-1.11.1 at /usr/local/bin/ninja
+ /usr/local/bin/ninja                                                                                                                     
[0/1] Generating HTML documentation with a custom command (wrapped by meson to set env

@kwankyu
Copy link
Collaborator

kwankyu commented Nov 28, 2023

For html doc, I got

[10934/10976] /Users/kwankyu/test/sagemath_doc_html-10.2rc3/.mesonpy-rrb8smqe/html/tr/a_tour_of_sage/_static/_sphinx_javascript_frameworks_[10976/10976] /Users/kwankyu/test/sagemath_doc_html-10.2rc3/.mesonpy-rrb8smqe/html/tr/a_tour_of_sage/_static/styles/furo.css.map
Successfully built sagemath_doc_html-10.2rc3-py3-none-any.whl
(sage-sh) kwankyu@Hera:sagemath_doc_html-10.2rc3$ 

but for pdf doc, I got

[reference] dumping search index in English (code: en)... done
[reference] The HTML pages are in ../.mesonpy-3dddtiun/html/en/reference.
Error building the documentation.
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/kwankyu/GitHub/sage/src/sage_docbuild/__main__.py", line 503, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/kwankyu/GitHub/sage/src/sage_docbuild/__main__.py", line 499, in main
    builder()
  File "/Users/kwankyu/GitHub/sage/src/sage_docbuild/builders.py", line 645, in pdf
    getattr(get_builder('reference_top'), 'html')()
  File "/Users/kwankyu/GitHub/sage/src/sage_docbuild/builders.py", line 162, in f
    runsphinx()
  File "/Users/kwankyu/GitHub/sage/src/sage_docbuild/sphinxbuild.py", line 327, in runsphinx
    sys.stderr.raise_errors()
  File "/Users/kwankyu/GitHub/sage/src/sage_docbuild/sphinxbuild.py", line 263, in raise_errors
    raise OSError(self._error)
OSError: WARNING: Unable to fetch /Users/kwankyu/test2/sagemath_doc_pdf-10.2rc3/.mesonpy-3dddtiun/html/en/reference/algebras/searchindex.js 

    Note: incremental documentation builds sometimes cause spurious
    error messages. To be certain that these are real errors, run
    "make doc-clean doc-uninstall" first and try again.
make[1]: *** [doc-pdf--reference_top] Error 1
make: *** [doc-pdf-reference] Error 2
ninja: build stopped: subcommand failed.

ERROR Backend subprocess exited when trying to invoke build_wheel
(sage-sh) kwankyu@Hera:sagemath_doc_pdf-10.2rc3$

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 28, 2023

Hmm... that's not good

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 28, 2023

Can't reproduce this failure. Do you have any environment variables set that influence the docbuild?

@kwankyu
Copy link
Collaborator

kwankyu commented Nov 28, 2023

No. Like what?

I will try again, since I was running doc_html and doc_pdf builds together.

Matthias Koeppe added 30 commits October 21, 2024 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants