-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix dependencies overhead #2346
Conversation
between rds/rds2 and cloudformation modules
Hello @slafs , if there is something I can do to help get this PR merged, I'm happy to help. |
What about a potential workaround to this be, on def mock_s3():
from . import s3
return s3.mock_s3() |
Hey @edisongustavo. Thanks for the offer. At this point I think I'd like some input from someone responsible for this codebase, so we get at least an initial acceptance for this work. I guess I'd like some help on keeping this PR fresh (i.e. rebasing on top of
Good idea! I'll try to incorporate this here. Then it should be easier to keep the PR up-to-date as well. |
This is the initial approach of fixing #1728 i.e. resolve the dependencies overhead and allow for installing minimal set of dependencies for a given service (e.g. when using only
s3
backend, install dependencies used bymoto.s3
module only).Currently this is backwards incompatible (!!!)
and probably fails on some tests.
Before I start any efforts on backwards compat, I'd like to get some guidance on how to progress with this, first.
In order to reduce required dependencies we need to change the way we're accessing mock decorators (in
moto/__init__.py
) and the way we import backends (inmoto/backends.py
).This might need an API change, so instead of doing
from moto import mock_s3
we'd need to go forfrom moto.s3 import mock_s3
.BTW This PR reduces the time needed for
import moto
from 3.5 seconds to 0.5s (on my machine).Things to discuss/decide:
_backends
variable or how we should avoid using it?botocore.awsrequest
andConnectionCls
fix inmoto/__init__.py
(why do we need it anyway)?extras_require
(insetup.py
)?install_requires
still, e.g. werkzeug or Jinja2)?