diff --git a/.readthedocs.yml b/.readthedocs.yml index 23bcdbc7..23c1c1ad 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -7,15 +7,20 @@ version: 2 # Set the version of Python and other tools you might need build: - os: ubuntu-20.04 + os: ubuntu-24.04 tools: - python: "3.11" + python: "3.13" + jobs: + post_install: + # We just need to pass -config-settings, others are what RTD does by default. + - python -m pip install -upgrade-strategy only-if-needed --no-cache-dir -config-settings=setup-args="-Dbuild_extensions=false" . # Install the package. python: install: - method: pip - path: . + # Can't use path, want to disable meson building extensions. + # path: . - requirements: docs-requirements.txt # Build documentation in the docs/ directory with Sphinx diff --git a/meson.build b/meson.build index 9b84453a..2e983171 100644 --- a/meson.build +++ b/meson.build @@ -10,17 +10,7 @@ fs = import('fs') py = import('python').find_installation(pure: false) dep_py = py.dependency() -build_extensions = get_option('build_extensions') -summary({'option': build_extensions}, section: 'Build C Extensions') - -# Can't check environment variables directly, need to launch Python. -res = run_command(py, '-c', 'import os; print("READTHEDOCS" in os.environ)', check: true) -if res.returncode() == 0 and 'True' in res.stdout() - build_extensions = false -endif -summary({'stdout': res.stdout(), 'build': build_extensions}, section: 'Build C Extensions') - -if build_extensions +if get_option('build_extensions') # Build quickhull. inc_quickhull = include_directories('src' / 'quickhull') lib_quickhull = static_library( diff --git a/src/srctools/meson.build b/src/srctools/meson.build index 62a31171..48bf780e 100644 --- a/src/srctools/meson.build +++ b/src/srctools/meson.build @@ -44,7 +44,7 @@ py.install_sources(pure_python, subdir: 'srctools') subdir('_pyinstaller') subdir('scripts') -if build_extensions +if get_option('build_extensions') py.extension_module( '_math', files(