-
-
Notifications
You must be signed in to change notification settings - Fork 558
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
Mock all the optional dependencies to testing for better coverage #3865
Comments
Even a separate job in the Cross-posting #3848 (review) where a solution is available for Python 3.10 and later. |
I'd be happy to work on this issue if possible 🙋♂️ |
Hello @lorenzofavaro, thanks – I can assign you to this issue. Just one job on Linux where no optional dependencies are installed with the dev session would be okay in this case. We can do this without altering |
Thanks @agriyakhetarpal. By using the nox dev session do we not also install optional dependencies? # noxfile.py
@nox.session(name="dev")
def set_dev(session):
# ...
if sys.platform == "linux":
# ...
session.run(
python,
"-m",
"pip",
"install",
"-e",
".[all,dev,jax,odes]",
external=True,
) Shouldn't we create a new function to install just session.run(
python,
"-m",
"pip",
"install",
"-e",
".[dev]",
external=True,
) Then we could configure a new job in the workflow |
We actually use the I was going to suggest that we can write these commands directly in a job for Python 3.11 (or 3.12) running on Linux in |
Alright, so running all the tests with the core PyBaMM gives us 68 errors, as expected. But how do we want to handle these errors for optional dependencies?
By the way, right now the |
I would say the second one "edit just the test_import_optional_dependency function" sounds better to me, it's a lot less work at the time in comparison to modifying all of the test cases (there are several places where changes would be required). Having a separate Python 3.11 job + running just this test with
That is right – I believe this was overlooked in #3475 and we didn't realise fixing this even in #3848 (cc: @arjxn-py). Could you resolve that? Perhaps #3848 (review) might be useful (but if there's a better API to parse optional dependencies then we should go ahead with that). |
Yes of course, I'll solve it in my next PR. |
Currently we run all the tests with
pybamm[all]
with all optional dependencies installed on CI but as we also maintainpybamm
without optional dependencies it is necessary to cover that in tests too.We might need to introduce a new step in the job matrix with
pybamm
without optional dependencies installed to run tests (a number ofModuleNotFound
failures are expected which should be refactored on the go)The text was updated successfully, but these errors were encountered: