diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 524a11f..3edd960 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,7 +33,6 @@ jobs: build-wheel: name: Build on ${{ matrix.os }} runs-on: ${{ matrix.os }} - environment: pypi-deployment strategy: matrix: os: [macos-13, ubuntu-latest, windows-latest] diff --git a/.github/workflows/sphinx.yaml b/.github/workflows/sphinx.yaml index d28bff5..b60984a 100644 --- a/.github/workflows/sphinx.yaml +++ b/.github/workflows/sphinx.yaml @@ -1,7 +1,9 @@ name: "Sphinx: Render docs" -on: push - +on: + push: + branches: + - main jobs: build: runs-on: ubuntu-latest @@ -14,10 +16,10 @@ jobs: - name: Get MOPAC shared library run: | - curl -OL https://github.com/openmopac/mopac/releases/download/v23.1.2/mopac-23.1.2-linux.tar.gz - tar -xvzf mopac-23.1.2-linux.tar.gz + curl -OL https://github.com/openmopac/mopac/releases/download/v23.2/mopac-23.2-linux.tar.gz + tar -xvzf mopac-23.2-linux.tar.gz mkdir src/mopactools/lib - cp mopac-23.1.2-linux/lib/* src/mopactools/lib + cp mopac-23.2-linux/lib/* src/mopactools/lib - name: Build HTML uses: ammaraskar/sphinx-action@master diff --git a/pyproject.toml b/pyproject.toml index 4551d2b..9eab6f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "mopactools" -version = "0.1.0" +version = "0.1.1" authors = [ { name="Jonathan Moussa", email="jemoussa@vt.edu" }, ] @@ -23,6 +23,7 @@ license = { text="Apache-2.0" } dependencies = [ "numpy", "scipy", + "packaging", ] [project.urls] diff --git a/src/mopactools/api.py b/src/mopactools/api.py index e7c927b..84934db 100644 --- a/src/mopactools/api.py +++ b/src/mopactools/api.py @@ -19,6 +19,7 @@ import ctypes import numpy as np import scipy +from packaging.version import Version, InvalidVersion from . import binding class MopacSystem: @@ -646,4 +647,9 @@ def from_file(input_path): binding.libmopac.get_mopac_version(buffer) #: Semantic version number of the MOPAC shared library VERSION = buffer.value.decode('utf-8') -# In the future, it might make sense to put a minimum version test here +MIN_VERSION = "23.2" +try: + if Version(VERSION) < Version(MIN_VERSION): + raise ValueError(f"MOPAC shared library version ({VERSION}) is older than the minimum required version ({MIN_VERSION}).") +except InvalidVersion: + print(f"WARNING: MOPAC shared library has a non-standard version ({VERSION}) and might not be compatible with mopactools.")