-
Notifications
You must be signed in to change notification settings - Fork 4
Test support for PyMongo 4.0 #46
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
Conversation
.github/workflows/test.yml
Outdated
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} |
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.
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} | |
key: ${{ runner.os }}-${{ matrix.python-version}}-pip-${{ hashFiles('**/setup.py') }} |
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.
The wheels will be different for each version of python
.github/workflows/test.yml
Outdated
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- |
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.
${{ runner.os }}-pip- | |
${{ runner.os }}-${{ matrix.python-version}}-pip- |
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.
Done.
@@ -9,6 +9,11 @@ jobs: | |||
matrix: | |||
python-version: ["3.5", "3.6", "3.7", "3.8", "pypy-3.7"] | |||
mongodb-version: ["4.4"] | |||
pymongo-version: ["v3.11", "v4.0"] | |||
# pymongo 4.0 does not support python 3.5 |
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.
Can you file a new issue to drop support for 3.5 if one doesn't exist already?
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.
Done.
path: ~/.cache/pip | ||
key: ${{ runner.os }}-${{ matrix.python-version}}-pip-${{ hashFiles('**/setup.py') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.python-version}}-pip- |
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.
Is this needed? How much time are we saving? IIRC these tests run very fast already.
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.
The tests do already run fast. I mainly added this in because Steve suggested it and I thought it would be an easy way to make it run a bit faster.
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.
Okay and what is the impact of this change?
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.
It is a general thing that we add to the Jupyter repos to save time and bandwidth to pypi.org. If we don't want it here that's fine too.
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.
Yeah I get that, I just want to know how much time was actully saved in our case. How slow were the old tests and how much quicker are they now?
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.
In this case I see about 40s -> 30s on the Python 3.8 builds.
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.
Thanks SGTM!
.github/workflows/test.yml
Outdated
@@ -9,6 +9,11 @@ jobs: | |||
matrix: | |||
python-version: ["3.5", "3.6", "3.7", "3.8", "pypy-3.7"] | |||
mongodb-version: ["4.4"] | |||
pymongo-version: ["v3.11", "v4.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.
Please remove the v's
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.
Good catch. Fixed.
.github/workflows/test.yml
Outdated
# pymongo 4.0 does not support python 3.5 | ||
exclude: | ||
- python-version: "3.5" | ||
pymongo-version: "v4.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.
Remove the v here too.
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.
Done.
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.
So the way I see it, this change so far does ensure that we're now compatible with pymongo 4.0 but is there's still work that needs to be done in the API (new parameters added in 3.12/4.0)?
One issue here is that we're using the v3.11 era CRUD spec tests. With v4.0 we'd ideally want to use the 4.0 era CRUD tests which happen to be in the unified format.
path: ~/.cache/pip | ||
key: ${{ runner.os }}-${{ matrix.python-version}}-pip-${{ hashFiles('**/setup.py') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.python-version}}-pip- |
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.
Okay and what is the impact of this change?
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.
LGTM, please open a follow up issue for updating the spec tests themselves. We don't have to work on that ticket now but it would be good to track it. Also it would be good to confirm that there aren't any methods or parameters that need to be updated. I'm not seeing anything notable in the changelog: https://pymongo.readthedocs.io/en/3.12.0/changelog.html
path: ~/.cache/pip | ||
key: ${{ runner.os }}-${{ matrix.python-version}}-pip-${{ hashFiles('**/setup.py') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.python-version}}-pip- |
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.
Thanks SGTM!
@ShaneHarvey I created an issue to track updating the spec tests. https://jira.mongodb.org/browse/PYTHON-3039 |
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.
LGTM!
self.run_operations(sessions, collection, test['operations']) | ||
if not hasattr(self, "command_logger"): | ||
raise Exception("You forgot to add in the bits of code that make " | ||
"utils_spec_runner.py test pymongoexplain!") |
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.
Neat!
No description provided.