diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 21b8aac6b..b8d75f552 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -35,7 +35,7 @@ jobs: output-dir: wheelhouse config-file: "{package}/pyproject.toml" - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: path: ./wheelhouse/*.whl @@ -48,6 +48,6 @@ jobs: - name: Build sdist run: pipx run build --sdist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: path: dist/*.tar.gz \ No newline at end of file diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 275cc0938..ccbef0287 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -20,7 +20,6 @@ build: jobs: pre_build: - ford fortran_docs.md - - pip install pyshtools - DOC_BUILD=1 pip install . python: install: diff --git a/swiftest/shgrav.py b/swiftest/shgrav.py index 6664b3941..07019c04b 100644 --- a/swiftest/shgrav.py +++ b/swiftest/shgrav.py @@ -14,13 +14,20 @@ # from .constants import GC +import os -try: - import pyshtools as pysh +PYSHTOOLS_AVAILABLE = False + +if 'READTHEDOCS' in os.environ: + # Assume pyshtools is available when building on ReadTheDocs PYSHTOOLS_AVAILABLE = True -except ModuleNotFoundError: - PYSHTOOLS_AVAILABLE = False - print("pyshtools is not installed. Some features will be unavailable.") +else: + try: + import pyshtools as pysh + PYSHTOOLS_AVAILABLE = True + except ModuleNotFoundError: + print("pyshtools is not installed. Some features will be unavailable.") + if PYSHTOOLS_AVAILABLE: