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

[Bug]: non-required dependency typing_extensions is imported by default #3836

Closed
arjxn-py opened this issue Feb 24, 2024 · 5 comments · Fixed by #3848
Closed

[Bug]: non-required dependency typing_extensions is imported by default #3836

arjxn-py opened this issue Feb 24, 2024 · 5 comments · Fixed by #3848
Assignees
Labels
bug Something isn't working priority: high To be resolved as soon as possible

Comments

@arjxn-py
Copy link
Member

PyBaMM Version

24.1

Python Version

3.8-3.12

Describe the bug

There might be some instance in #3578 where non required dependency has been imported by default, which is causing failure, related build logs.

Steps to Reproduce

  • try installing latest built wheels on develop
  • do import pybamm

Relevant log output

No response

@arjxn-py arjxn-py added bug Something isn't working priority: high To be resolved as soon as possible labels Feb 24, 2024
@arjxn-py arjxn-py self-assigned this Feb 24, 2024
@arjxn-py arjxn-py changed the title [Bug]: import pybamm is breaking [Bug]: non-required dependency typing_extensions is imported by default Feb 24, 2024
@agriyakhetarpal
Copy link
Member

Note: this happens with sympy as well

@agriyakhetarpal
Copy link
Member

Also, it's weird that the tests for have_optional_dependency in test_util.py didn't catch typing-extensions and sympy – is this because we are not mocking all of the optional dependencies inside that test case? IMO, we should mock all of the optional dependencies to ensure that this problem doesn't get repeated in the future.

@arjxn-py
Copy link
Member Author

I tried importing typing-extensions as an optional dependency but it is being imported outside a function in unit/type_definitions.py and then those types in type_definitions.py are then being imported and used as args at several instances, which is making have_optional_dependency unable to resolve the issue.

@arjxn-py
Copy link
Member Author

How about we consider making typing-extensions a required dependency?

@agriyakhetarpal
Copy link
Member

I see, making typing-extensions a required dependency should be okay (please update the table in the docs too, of course). Will sympy still remain optional?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: high To be resolved as soon as possible
Projects
None yet
2 participants