mypy caught some code that's treating File.extras as if it's unconditionally not None, when it actually can be None.
_rapids_dependency_file_generator.py:426: error: Argument "extras" to "make_dependency_file" has incompatible type "FileExtras | None"; expected "FileExtras" [arg-type]
This fixes that by correcting some types hints and explicitly raising an error if a None makes it to the part of make_dependency_file() where that extras field is nedeed.
Prior to this change, given a dependencies.yaml like this:
Contributes to #87.
mypy
caught some code that's treatingFile.extras
as if it's unconditionally notNone
, when it actually can beNone
.This fixes that by correcting some types hints and explicitly raising an error if a
None
makes it to the part ofmake_dependency_file()
where thatextras
field is nedeed.Prior to this change, given a
dependencies.yaml
like this:rapids-dependency-file-generator
would raise an error like this:As of this change, the error is more informative and requires less knowledge of the
rapids-dependency-file-generator
internals: