From 7d48edb2f212005647c5767b57597973d4d0b209 Mon Sep 17 00:00:00 2001 From: David Minton Date: Fri, 1 Mar 2024 17:14:58 -0500 Subject: [PATCH 1/2] Updated the shgrav.py package so that it can be activated during documentation building --- .readthedocs.yaml | 1 - swiftest/shgrav.py | 17 ++++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) 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: From 91054d14ed3ba000bbe072c12295c45fcb9f2e87 Mon Sep 17 00:00:00 2001 From: David Minton Date: Fri, 1 Mar 2024 17:17:15 -0500 Subject: [PATCH 2/2] Updated the upload-artifact version from @3 to @4 because of the deprecation warning --- .github/workflows/build_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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