-
Notifications
You must be signed in to change notification settings - Fork 196
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 dependency on use_2to3 #661
Conversation
jaraco
commented
Sep 20, 2021
- Apply lib2to3 to the python code
- Restore Python 2 compatibility.
- Remove dependency on 2to3 and unpin Setuptools.
When can we expect a release with this change? |
I am working on the new release. Thanks |
@amukherjee28 Hello! We have a big release on Monday, do you think this would be shipped by then? |
Yes will release it by Friday. |
Hi @jaraco I was going through the changes suggested in the PR. I have few question regarding the same. The changes in the file ibm_db_dbi.py and testfunctions.py, is it in order to support the backward compatibility for PYTHON2. Just going through the code made me realize that the other changes looks to be for python2 support. Thanks |
Yes. There are three commits. In the first, I run lib2to3 on the code, effectively achieving what would have happened during a build on Python 3 before. That converted the code to Python 3 only code. In the next commit, I went back and manually restored support for Python 2 by reading through the previous change and restoring whatever expectation would have been present, but only for Python 2. This change was mainly to restore support for strings and ints having two forms on Python 2, but only one on Python 3. It's quite possible some of these changes aren't necessary in practice, but for safety, I applied them to be maximally compatible. If you no longer need support for Python 2, you can omit or revert that commit. In the final commit, I clean up the I'd recommend to test on Python 2, although I'm fairly confident in the changes and if the tests are passing on Python 3, I'd feel pretty good about Python 2, but you may wish to be prepared to make another release if Python 2 users somehow report unexpected problems. |
Hi @jaraco One last confirmation with these changes do you thing we still need the pyproject.toml file ? |
With these changes , you don’t need the pyproject.toml file, although including it is good practice. The presence of the file will enable PEP 517 isolated builds and make the project more future-proof, rather than relying on legacy compatibility behaviors. Your call.
|
@amukherjee28 This sounds reasonable to me as well. |
With python3 the changes work fine. But with python2 there are issue when running test cases. |
The project isn’t stable after the first commit. It will still have 2to3 enabled and won’t run on python 2. If you wish to release a Python 3 only release, I could help prepare a PR that does that. How important is it for this project to continue to support Python 2? If Python 2 users can rely only on preexisting releases, that’s the route I’d recommend (#669). If not, I’d suggest instead releasing a workaround to pin Setuptools until the issues with Python 2 in this PR can be worked out (#656). |
The changes in #656 should have been enough to prevent the issue for users using |
Thanks a lot for the help @jaraco. Support for the new setuptools working fine. |