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
Make the project installable as a pytest plugin #1
Conversation
pytest_aioboto3/__init__.py
Outdated
from .aioboto3_fixtures import moto_patch_session, aioboto3_s3_client | ||
from .moto_fixtures import moto_services | ||
|
||
__all__ = ["moto_pathc_session", "aioboto3_s3_client", "moto_services"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
__all__ = ["moto_pathc_session", "aioboto3_s3_client", "moto_services"] | |
__all__ = ["moto_patch_session", "aioboto3_s3_client", "moto_services"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, this looks pretty good! Looking forward to have this available on Pypi :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really awesome stuff! Thanks so much for contributing!!!
The only opinionated and "breaking" change is to name the package pytest-aioboto3 instead of aioboto3-testing. This is to follow the standard naming of pytest plugins, and to make it easier to discover by users. The actual test file test_s3.py is kept in the tests directory to separate it from the main code.
I agree, great improvement. I went ahead and changed the name of the repo.
You know, I hadn't really planned on putting this on PyPi but I guess I didn't realize how close this was! Thanks for cleaning this up and I will try to get this up on PyPi in the next week or so!
aioboto3 = "^9.5.0" | ||
moto = {extras = ["s3", "server"], version = "^3.1.6"} | ||
types-aiobotocore = {extras = ["s3"], version = "^2.2.0"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually not all that sure about how type dependencies should be distributed. Most of the examples I've seen put them in dev-dependencies but - I guess if they are being used as type annotations you need to distribute them as transitive dependencies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, there is an explicit import of types_aiobotocore_s3
here, so the package NEEDS to be installed or there will be an import error.
The way I see it, dev dependencies are those that are only needed to run the tests or set up the project locally, while the main dependencies are those required to install and run the main package.
Co-authored-by: Phillip Verheyden <pverheyden@gmail.com>
Co-authored-by: Phillip Verheyden <pverheyden@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff, thanks for contributing!
By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.
Description
Main purpose is to make this project installable as a python package and discoverable by pytest's plugin system, instead of asking users to copy the files into their projects.
The only opinionated and "breaking" change is to name the package pytest-aioboto3 instead of aioboto3-testing. This is to follow the standard naming of pytest plugins, and to make it easier to discover by users. The actual test file
test_s3.py
is kept in the tests directory to separate it from the main code.I also added support for python 3.7+, because the only 3.9 feature that was being used was the typed
Popen
, but that is easily fixed withfrom __future__ import annotations
.Testing
Checklist
master