Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

further which patching for py312 #329

Merged
merged 3 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Changelog
=========

.. X.Y.0 / 2023-MM-DD
.. X.Y.0 / 2023-MM-DD (Unreleased)
.. -------------------
..
.. Breaking Changes
Expand All @@ -20,6 +20,15 @@ Changelog
.. +++++


0.27.1 / 2023-10-26 (Unreleased)
-------------------

Bug Fixes
+++++++++
- (:pr:`329`) Continues :pr:`328` adding ``util.which`` workaround for only python v3.12.0 and psi4
(can be expanded) to correctly select among cmd, cmd.bat, cmd.exe.


0.27.0 / 2023-10-24
-------------------

Expand Down
8 changes: 5 additions & 3 deletions qcelemental/util/importing.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,14 @@ 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}

ans = shutil.which(command, mode=os.F_OK | os.X_OK, path=lenv["PATH"])

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"])
ans = shutil.which("psi4.exe", mode=os.F_OK | os.X_OK, path=lenv["PATH"])
if ans is None:
ans = shutil.which("psi4.bat", mode=os.F_OK | os.X_OK, path=lenv["PATH"])

# secondary check, see https://github.com/MolSSI/QCEngine/issues/292
local_raise_msg = ""
Expand Down