Skip to content

Conversation

@loriab
Copy link
Collaborator

@loriab loriab commented Oct 4, 2025

Description

Note this needs pydantic 2.12.0b1 to work for python 3.14

top-level import clean

python -c "import qcelemental"
python -c "import qcelemental.models"

qcschema v1 module or class import warns

python -c "import qcelemental.models.v1"
#> FutureWarning: qcelemental.models.v1 is active but incompatible with Python 3.14+ (pydantic.v1 is not available). Imports will provide non-functional placeholders; instantiating any v1 model will raise a RuntimeError. Please migrate to qcelemental.models.v2 or run on Python < 3.14. See docs/MIGRATION.md
python -c "from qcelemental.models.v1 import Molecule"
#> FutureWarning: qcelemental.models.v1 is active but incompatible with Python 3.14+ (pydantic.v1 is not available). Imports will provide non-functional placeholders; instantiating any v1 model will raise a RuntimeError. Please migrate to qcelemental.models.v2 or run on Python < 3.14. See docs/MIGRATION.md

qcschema v1 instantiation errors for python 3.14 (n/c for <=3.13)

python -c "from qcelemental.models.v1 import Molecule; Molecule()"
#> Traceback (most recent call last):
#>   File "<string>", line 1, in <module>
#>     from qcelemental.models.v1 import Molecule; Molecule()
#>                                                ~~~~~~~~^^
#>  File "/Users/loriab/linux/QCElemental_temp/qcelemental/models/v1/__init__.py", line 42, in __init__
#>    raise RuntimeError(
#>    ...<3 lines>...
#>   )
#> RuntimeError: QCSchema v1 model 'Molecule' cannot be instantiated in this environment. Reason: pydantic.v1 is unavailable on Python 3.14+. Use qcelemental.models.v2 or run Python <3.14. See docs/MIGRATION.md

Changelog description

Status

  • Code base linted
  • Ready to go

@codecov
Copy link

codecov bot commented Oct 4, 2025

Codecov Report

❌ Patch coverage is 7.27273% with 255 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (next2025@ced0474). Learn more about missing BASE report.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@loriab
Copy link
Collaborator Author

loriab commented Oct 8, 2025

Ultimately, this is going to address both the pydantic v2 (#374) and python v314 (#375) problems. But it's going to take both this PR (into next2025) and a PR of next2025 into master to reach that happy state of v0.50.

Below is a timeline of key versions for pinning. Pydantic is rather forcing our hand by not providing pydantic.v1 for py314. Roughly, it'll be “v2 preview available” and "v1 available in namespace" at v0.50, “v2 finalized” at v0.60, “qcel.models switches to v2” at v0.70, and “v1 dropped” at v1.0.

Downstream testing so far:

  • Psi4 built against this qcel branch with py313 passes all tests with no code change
  • @jaclark5 looking into OpenForceField
‎qcschema_timeline_Oct2025 ‎001

@jaclark5
Copy link
Contributor

jaclark5 commented Oct 8, 2025

@loriab I tried the full-stack CI in our status repo but I'm failing to install this branch because it's a development of qcelemental 0.27 instead of 0.28 so it's incompatible with qcmanybody:
qcmanybody 0.5.1 requires qcelemental<0.70.0,>=0.28.0, but you have qcelemental 0.27.2.dev47+g116e11be4 which is incompatible.
It looks like I'll have to go back to qcmanybody v0.3.0 to avoid the qcelemental pinning. Do you have advice on how I should resolve this?

@loriab
Copy link
Collaborator Author

loriab commented Oct 8, 2025

@jaclark5 Whoops, give it another try, please. I was behind on pushing tags to my fork, so I think that's why it looked like it was off the 0.27 instead of the v0.50a1. My git describe on the py314 branch yields v0.50a1-14-g116e11b.

@jaclark5
Copy link
Contributor

jaclark5 commented Oct 9, 2025

@loriab Great I think it installed correctly. Should I pin a certain version of qcarchivetesting (using 0.63)? I'm getting the following error in our CI:

  File "/Users/runner/micromamba/envs/full-stack-tests/lib/python3.12/site-packages/qcarchivetesting/helpers.py", line 16, in <module>
    from qcelemental.models.results import WavefunctionProperties
ImportError: cannot import name 'WavefunctionProperties' from 'qcelemental.models.results' (/Users/runner/micromamba/envs/full-stack-tests/lib/python3.12/site-packages/qcelemental/models/results.py)

@jaclark5
Copy link
Contributor

jaclark5 commented Oct 9, 2025

@loriab New error:

  from . import v1, v2
/Users/runner/micromamba/envs/full-stack-tests/lib/python3.11/site-packages/_pytest/config/__init__.py:331: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: helpconfig, Hook: pytest_cmdline_parse
ImportError: cannot import name 'Provenance' from 'qcelemental.models.results' (/Users/runner/micromamba/envs/full-stack-tests/lib/python3.11/site-packages/qcelemental/models/results.py)

@loriab
Copy link
Collaborator Author

loriab commented Oct 9, 2025

Thanks @jaclark5, I just did another commit that at least gets pytest qcarchivetesting running the tests. (They're timing out, but this is an odd local setup. I've alerted Ben.)

@jaclark5
Copy link
Contributor

@loriab the qcarchive-testing passed and on to the next stage of our CI! I’m getting the Wavefunction error again but for our interchange CI:

ERROR - ImportError: cannot import name 'WavefunctionProtocolEnum' from 'qcelemental.models.results' (/Users/runner/micromamba/envs/full-stack-tests/lib/python3.12/site-packages/qcelemental/models/results.py)

@loriab
Copy link
Collaborator Author

loriab commented Oct 10, 2025

@jaclark5 It seems I underestimated the variety of imports. I just added the last of the ones that look plausible to me. Hopefully can avoid the remainder:

  • really old: Result, ResultInput, ResultProtocols, ResultProperties, AutodocBaseSettings
  • helper: NonnegativeInt, BondOrderFloat, TypedArray, ArrayMeta
  • indirect imports

@jaclark5
Copy link
Contributor

@loriab they're all completed successfully! CI Link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants