-
Notifications
You must be signed in to change notification settings - Fork 197
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
Purge workaround for docs build #509
Comments
Always require dependencies to be installed. Resolved christiansandberg#509
Yes, I think this is a good change. |
Yes, please. With type annotation checks we'd need code something like this to circumvent the conditional: from typing import TYPE_CHECKING
try:
import can
from can import Listener
from can import CanError
except ImportError:
# Type checkers don't like this conditional logic, so it is only run when
# not type checking
if not TYPE_CHECKING:
# Do not fail if python-can is not installed
can = None
CanError = Exception
class Listener:
""" Dummy listener """ |
I'd like to go back to the basics of this issue. How exactly is this related to the documentation build? Could it have merit for other use cases? Sorry, I just haven't fully grasped what this passage is meant to do in the first place. |
The except clause was historically added and changed with these commits (new to old): When these workarounds were added, there was no
No; the code is completely broken if the imports fail; |
Ah, thanks for the explanation @erlend-aasland. That's what I wanted to know, and especially it seems there was no special funky use-case that required this. |
No sweat, it's always good to be reminded about Chesterton's Fence :) |
canopen/network.py
contains the following docs build workaround:canopen/canopen/network.py
Lines 8 to 17 in 3aa509d
I suggest to purge this hack from
network.py
; the RTD config already installscanopen
as a package, which implicitly installscan
. Moreover, purging this workaround will make it easier to add type annotations fornetwork.py
.The text was updated successfully, but these errors were encountered: