This was probably fixed by 225d8b30a0 as it added an Env type hint to the env variable. Either way, the mypy check passes evenn with this removed now.
225d8b30a0