Skip to content

Refactor deprecated unittest aliases for Python 3.11 compatibility.#1112

Merged
absurdfarce merged 1 commit intoapache:masterfrom
tirkarthi:fix-assert
Mar 9, 2023
Merged

Refactor deprecated unittest aliases for Python 3.11 compatibility.#1112
absurdfarce merged 1 commit intoapache:masterfrom
tirkarthi:fix-assert

Conversation

@tirkarthi
Copy link
Copy Markdown
Contributor

The deprecated aliases were removed in Python 3.11 in python/cpython#28268 .

@absurdfarce absurdfarce self-requested a review October 18, 2021 16:47
@absurdfarce
Copy link
Copy Markdown
Contributor

Thanks for the pull request @tirkarthi ! I've been a bit swamped recently but I'll try to get this reviewed as soon as I can.

Have you signed the Contributor License Agreement for contributions to DataStax open source projects? If not you can find it at https://cla.datastax.com. Thanks!

@absurdfarce
Copy link
Copy Markdown
Contributor

@tirkarthi I'm inclined to wait on this until 3.11 has had some more time to develop. What do you think?

@tirkarthi
Copy link
Copy Markdown
Contributor Author

I am fine with the wait since Python 3.11 is in alpha phase release and final release will be around October 2022.

https://www.python.org/dev/peps/pep-0664/

@stefanor
Copy link
Copy Markdown
Contributor

stefanor commented Nov 18, 2022

That cleanup was later reverted, but this patch is still a good idea (the deprecated functions are still deprecated)

@tirkarthi
Copy link
Copy Markdown
Contributor Author

The deprecations will be removed in Python 3.12. I will try to fix the merge conflict.

https://docs.python.org/dev/whatsnew/3.12.html#removed

@absurdfarce
Copy link
Copy Markdown
Contributor

Fair point @stefanor, we don't have to wait for a new release to remove these features in order to address them.

According to the underlying Python issue (https://bugs.python.org/issue45162 by way of python/cpython#28268):

Most features were deprecated in 3.2, "fail*" methods in 3.1, assertNotRegexpMatches in 3.5. They were kept 
mostly for compatibility with 2.7 (although some of them were new in Python 3 and not compatible with 2.7).

The most recent version of the Python driver supports Python 3.5 through 3.8 so clearly we're dealing with deprecated methods for the supported versions. With that in mind I'm okay with getting this in sooner than originally discussed.

There are still a couple things we need to sort out before we do so however. We're working on some internal changes which have borked our CI infrastructure temporarily; I'd like to get those sorted out before I commit this. I also need to make sure we're okay on the CLA front before moving forward. @tirkarthi can you confirm that you've signed this agreement?

@biegelmeyer
Copy link
Copy Markdown

biegelmeyer commented Feb 10, 2023

Is there any news about this PR?

@absurdfarce
Copy link
Copy Markdown
Contributor

There were two outstanding issues on this PR when last I looked into it @biegelmeyer. They were:

  • Issue with the internal CI infrastructure used by this project
  • Confirmation of a signed CLA from the author (@tirkarthi)

I believe the CI infrastructure is fixed, or at least fixed enough that we can commit this change without too much concern. We need a CLA signature before we can do anything, though, and unfortunately that's out of my hands. @tirkarthi have you signed the CLA or will you be able to do so soon?

@tirkarthi
Copy link
Copy Markdown
Contributor Author

I have just signed the CLA now. Please check.

@biegelmeyer
Copy link
Copy Markdown

I have just signed the CLA now. Please check.

nice

@absurdfarce
Copy link
Copy Markdown
Contributor

Excellent, thank you @tirkarthi !

And with that done I believe we're ready to merge this change. Thanks everyone!

@absurdfarce absurdfarce merged commit 4da7001 into apache:master Mar 9, 2023
Lorak-mmk added a commit to Lorak-mmk/python-driver that referenced this pull request Mar 31, 2023
version 3.26.0

* tag '3.26.0' of https://github.com/datastax/python-driver: (22 commits)
  Release 3.26: changelog & version
  Going back to known good non-2.7 PyPy target.  PYTHON-1333 has more detail.
  Forgot to add complete extension
  Trying to get to a maximal working Pypy version.  Have to go back to 3.6 which isn't ideal...
  Update Travis config to only run versions that will be supported going forward
  Minor refactor of prior commit: now that we're dropping 2.7.x support we don't really need to leverage six for unit test functions.
  Remove references to unsupported Python versions from setup.py
  Refactor deprecated unittest aliases for Python 3.11 compatibility. (apache#1112)
  Merge pull request apache#1140 from python-driver/python-1327
  Merge pull request apache#1139 from python-driver/python-1328
  Merge pull request apache#1137 from python-driver/python-1329
  Merge pull request apache#1128 from python-driver/python-1304
  Fix jenkins builds (apache#1134)
  Minor refactor of prior commit
  Handle "log gone" case in the end of _run_loop (apache#1133)
  HostFilterPolicyInitTest fix for Python 3.11 (apache#1131)
  Groovy fixes
  Hey, let's actually update the right things, shall we?
  Smaller smoke test configuration to avoid explosion of test builds in AWS
  Fix to prior fix
  ...
Lorak-mmk added a commit to Lorak-mmk/python-driver that referenced this pull request Apr 12, 2023
version 3.26.0

* tag '3.26.0' of https://github.com/datastax/python-driver: (22 commits)
  Release 3.26: changelog & version
  Going back to known good non-2.7 PyPy target.  PYTHON-1333 has more detail.
  Forgot to add complete extension
  Trying to get to a maximal working Pypy version.  Have to go back to 3.6 which isn't ideal...
  Update Travis config to only run versions that will be supported going forward
  Minor refactor of prior commit: now that we're dropping 2.7.x support we don't really need to leverage six for unit test functions.
  Remove references to unsupported Python versions from setup.py
  Refactor deprecated unittest aliases for Python 3.11 compatibility. (apache#1112)
  Merge pull request apache#1140 from python-driver/python-1327
  Merge pull request apache#1139 from python-driver/python-1328
  Merge pull request apache#1137 from python-driver/python-1329
  Merge pull request apache#1128 from python-driver/python-1304
  Fix jenkins builds (apache#1134)
  Minor refactor of prior commit
  Handle "log gone" case in the end of _run_loop (apache#1133)
  HostFilterPolicyInitTest fix for Python 3.11 (apache#1131)
  Groovy fixes
  Hey, let's actually update the right things, shall we?
  Smaller smoke test configuration to avoid explosion of test builds in AWS
  Fix to prior fix
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants