From ceea653af08af8b3133e254b94e307ca80e67360 Mon Sep 17 00:00:00 2001 From: Nicholas Lubbers <56895592+lubbersnick@users.noreply.github.com> Date: Tue, 23 Jan 2024 11:28:44 -0700 Subject: [PATCH] Update minimum python version to 3.9 (#56) * update setup.py and propagate hippynn versions to sphinx * Update doc builder GitHub Actions 1. ammaraskar/sphinx-action only supports Python 3.8, switch to actions/setup-python@v5 to use Python 3.9 2. Bump actions/checkout to v4 3. Bump actions/upload-artifact to v4 * Update version in docs (#57) * removed no longer used package imports * Update Python version requirement to >=3.9 --------- Co-authored-by: Nicholas Lubbers Co-authored-by: Xinyang Li Co-authored-by: Emily Shinkle --- .github/workflows/auto_doc_build.yml | 24 ++++++++++++++---------- docs/source/conf.py | 4 ++-- docs/source/installation.rst | 2 +- hippynn/__init__.py | 6 ++++++ hippynn/layers/pairs/dispatch.py | 2 -- setup.py | 2 +- 6 files changed, 24 insertions(+), 16 deletions(-) diff --git a/.github/workflows/auto_doc_build.yml b/.github/workflows/auto_doc_build.yml index 736d96c2..7a3466e1 100644 --- a/.github/workflows/auto_doc_build.yml +++ b/.github/workflows/auto_doc_build.yml @@ -12,18 +12,22 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - # Standard drop-in approach that should work for most people. - - uses: ammaraskar/sphinx-action@master + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: - # FIXME: how to build with mocking torch? - # use CPU only torch as this action will be likely for doc building only - pre-build-command: "pip3 install -U sphinx sphinx_rtd_theme graphviz ase torch --extra-index-url https://download.pytorch.org/whl/cpu && pip install ." - docs-folder: "docs/" - # a new target that always builds api_doc first - build-command: "make html_all" + python-version: "3.9" + + - name: Install dependencies and package + run: >- + pip3 install -U sphinx sphinx_rtd_theme graphviz ase torch --extra-index-url https://download.pytorch.org/whl/cpu && pip install . + + - name: Build docs + run: | + cd docs + make html_all + # Create an artifact of the html output. - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 with: name: DocumentationHTML path: docs/build/html/ diff --git a/docs/source/conf.py b/docs/source/conf.py index f58120d6..9a71efed 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -22,8 +22,8 @@ author = "Nicholas Lubbers" # The full version, including alpha/beta/rc tags -release = "0.0.1" - +import hippynn +release = hippynn.__version__ # -- General configuration --------------------------------------------------- diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 6b8f7fcd..dea3ae1d 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -7,7 +7,7 @@ Requirements ^^^^^^^^^^^^ Requirements: - * Python_ >= 3.7 + * Python_ >= 3.9 * pytorch_ >= 1.9 * numpy_ Optional Dependencies: diff --git a/hippynn/__init__.py b/hippynn/__init__.py index 65039813..8540cd93 100644 --- a/hippynn/__init__.py +++ b/hippynn/__init__.py @@ -3,9 +3,15 @@ The hippynn python package. """ + +from ._version import get_versions +__version__ = get_versions()['version'] +del get_versions + # Configurational settings from ._settings_setup import settings + # Pytorch modules from . import layers from . import networks diff --git a/hippynn/layers/pairs/dispatch.py b/hippynn/layers/pairs/dispatch.py index 55ddc187..ea5a5f43 100644 --- a/hippynn/layers/pairs/dispatch.py +++ b/hippynn/layers/pairs/dispatch.py @@ -6,8 +6,6 @@ import numpy as np from scipy.spatial import KDTree import torch -import os -from datetime import datetime from .open import PairMemory diff --git a/setup.py b/setup.py index e7defd78..3f0100a4 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ version=versioneer.get_version(), author="Nicholas Lubbers et al", author_email="hippynn@lanl.gov", - python_requires=">3.7", + python_requires=">=3.9", install_requires=[ "numpy", "torch",