The forbidden module requests.api should read just requests, because requests is not one of the root packages so, assuming mypackage imports it somewhere, it will only appear in the graph as requests.
Prior to this commit, if mypackage.foo imported requests.api then this contract would pass. Now, Import Linter will error, saying "Invalid forbidden module requests.api: subpackages of external packages are not valid."
Suggested in https://github.com/seddonym/import-linter/issues/111.
The following contract has a nonobvious problem with it:
The forbidden module
requests.api
should read justrequests
, becauserequests
is not one of the root packages so, assuming mypackage imports it somewhere, it will only appear in the graph asrequests
.Prior to this commit, if
mypackage.foo
importedrequests.api
then this contract would pass. Now, Import Linter will error, saying "Invalid forbidden module requests.api: subpackages of external packages are not valid."