-
Notifications
You must be signed in to change notification settings - Fork 86
Remove py2 support #130
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
Remove py2 support #130
Conversation
lease enter the commit message for your changes. Lines starting
|
@ChrisBarker-NOAA , hello. Could you pass all python files via pyupgrade or smth? |
|
Don't run any automated tools yet, please. It's easier to review manual changes first. |
| # named with underscore so as not to confuse pytest | ||
| class _TestData(BSONCoding): |
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.
bson/tests/test_objectid.py
Outdated
|
|
||
| def test_generation_time(self): | ||
| d1 = datetime.datetime.utcnow() | ||
| d1 = datetime.datetime.now(datetime.UTC) |
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.
Will it work in Py3.9?
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.
Darn -- nope.
Which is really annoying -- why depreciate when supported versions don't support the new way?
Good reason to get the CI going!
I don't have time to fix this right now, but I allowed maintainers to push to my branch, so you can do it -- or wait for me.
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.
Yep, and a PR for the CI/CD is already opened: #131
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.
OK -- fixed this
|
All looks good now -- passing on py 3.9 -- 3.13. There some more formatting cleanup to be done, but as suggested, I think a separate PR is called for there. |
|
Once #129 is merged, we'll probably want to dump the changes made here in the workflow. |
Already merged with other PRs, so when rebased, I'll look through as soon as possible. |
|
@ChrisBarker-NOAA , herllo. Are you ready to rebase the PR and we can go on with reviewing? |
This PR removes the six dependency, and all other Py2 compatibility code I could find.
Still a lot of
u"strings", but they do no harm.Also a few changes to remove deprecation warnings.
And a small change to make pytest a bit happier -- I really like pytest for running tests.
I haven't run coverage, so not completely sure if it's been fully tested, but I did make sure most of teh changes broke a test before I fixed it, so it's certainly mostly there.
I couldn't test without six installed, as it's needed by a dependency, but I did grep for "six", and I'm pretty sure I got it all.