Explicitly export values on factory namespace
Now that factory-boy exports its types, mypy will fail in strict mode
if using the factory namespace. Specifically, --no-implicit-reexport
flags references to factory.Factory (and other similar values) as
being implicitly exported:
$ mypy --strict test.py
test.py:1:1: error: Module "factory" does not explicitly export attribute "Factory" [attr-defined]
from factory import Factory
^
We can instead explicitly export these objects. As a benefit, anybody
who uses the ill-advised from factory import * will now at least no
longer have __author__ and such pollute their namespace.
https://mypy.readthedocs.io/en/stable/config_file.html#confval-implicit_reexport
Just a mild bump that this feels like a useful thing to get in 🙇
@rbarrois - any thoughts about this proposed change?
@rbarrois can we have it merged? Everyone was using namespaces as factory...
This would be really nice to get merged. It seems like a fairly low risk change since it only updates the __all__ of the top level factory module but it will take care of a lot of false positive import errors from type checkers.