diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 2aaf0082..f6dad230 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -5,15 +5,24 @@ on: branches: - master pull_request: + branches: + - master + schedule: + - cron: "9 16 * * 1" jobs: test: - runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: ["3.7", "3.9", "3.11", "3.12"] pydantic-version: ["1", "2"] + runs-on: [ubuntu-latest, windows-latest] + exclude: + - runs-on: windows-latest + pydantic-version: "1" + name: "🐍 ${{ matrix.python-version }} • ${{ matrix.pydantic-version }} • ${{ matrix.runs-on }}" + runs-on: ${{ matrix.runs-on }} steps: - name: Set up Python ${{ matrix.python-version }} @@ -30,9 +39,9 @@ jobs: # ^ start of line, pydantic, optional spaces and > sign, capture the version, replace with ^{version} # Should avoid also replacing the autodoc-pydantic spec later on. - name: Sed replace pydantic on repo + if: matrix.pydantic-version == '1' run: | sed -i 's/^pydantic *= *">*= *\([0-9.]*\)"/pydantic = "^\1"/' pyproject.toml - if: matrix.pydantic-version == '1' - name: Install repo with poetry (full deps) if: matrix.python-version != '3.9' run: poetry install --no-interaction --no-ansi --all-extras @@ -62,7 +71,7 @@ jobs: - uses: actions/setup-python@v4 name: Set up Python with: - python-version: "3.7" + python-version: "3.10" - name: Install poetry run: pip install poetry # Force pydantic 1.0 by modifying poetry dep "pydantic" string with in-place sed (see above for details) diff --git a/docs/changelog.rst b/docs/changelog.rst index 789bb35b..b85044ab 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -20,7 +20,7 @@ Changelog .. +++++ -Unreleased +0.27.0 / 2023-10-DD (Unreleased) ------------------- Breaking Changes @@ -40,11 +40,15 @@ Bug Fixes - (:pr:`325`, :issue:`324`) Ensure ``util.measure_coordinates`` isn't returning NaN angles just because floating-point errors are outside arccos's ``[-1, 1]`` bounds. - (:pr:`315`) Stop resetting numpy print formatting. +- (:pr:`328`) Add workaround for only python v3.12.0 and psi4 (can be expanded) to handle + ``util.which`` on Windows when a cmd (non-executable) and a cmd. live + side-by-side. Otherwise see ``[WinError 193] %1 is not a valid Win32 application``. Misc. +++++ - (:pr:`320`) Reset ``black`` formatting to 2022. - (:pr:`327`) Enable Python v3.12 in poetry. +- (:pr:`328`) Start Windows testing and cron testing. 0.26.0 / 2023-07-31 diff --git a/qcelemental/tests/test_importing.py b/qcelemental/tests/test_importing.py index 7bfcda97..2caed79c 100644 --- a/qcelemental/tests/test_importing.py +++ b/qcelemental/tests/test_importing.py @@ -117,7 +117,7 @@ def test_which_import_f_raisemsg_submodule(): def test_which_t(): ans = qcel.util.which("ls") - assert ans.split(os.path.sep)[-1] == "ls" + assert ans.split(os.path.sep)[-1] in ["ls", "ls.EXE"] def test_which_t_bool(): diff --git a/qcelemental/util/importing.py b/qcelemental/util/importing.py index 8daaf264..009f6631 100644 --- a/qcelemental/util/importing.py +++ b/qcelemental/util/importing.py @@ -99,6 +99,11 @@ def which( lenv = {"PATH": os.pathsep.join([os.path.abspath(x) for x in env.split(os.pathsep) if x != ""])} lenv = {k: v for k, v in lenv.items() if v is not None} + if sys.platform == "win32" and sys.version_info >= (3, 12, 0) and sys.version_info < (3, 12, 1): + # https://github.com/python/cpython/issues/109590 + if command == "psi4": + command = "psi4.bat" + ans = shutil.which(command, mode=os.F_OK | os.X_OK, path=lenv["PATH"]) # secondary check, see https://github.com/MolSSI/QCEngine/issues/292