Skip to content
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

Merged
merged 3 commits into from
Oct 4, 2021
Merged

Remove dependency on use_2to3 #661

merged 3 commits into from
Oct 4, 2021

Conversation

jaraco
Copy link
Contributor

@jaraco jaraco commented Sep 20, 2021

  • Apply lib2to3 to the python code
  • Restore Python 2 compatibility.
  • Remove dependency on 2to3 and unpin Setuptools.

@jaraco
Copy link
Contributor Author

jaraco commented Sep 20, 2021

Fixes #655 and Fixes #653 using a more permanent solution rather than a workaround.

I have not tested this code. Please test on Python 2 and 3 before releasing.

@hithwen
Copy link

hithwen commented Sep 27, 2021

When can we expect a release with this change?

@amukherjee28
Copy link
Member

I am working on the new release.
Will make the release very soon with these changes.

Thanks

@ofek
Copy link

ofek commented Sep 29, 2021

@amukherjee28 Hello! We have a big release on Monday, do you think this would be shipped by then?

@amukherjee28
Copy link
Member

Yes will release it by Friday.

@amukherjee28
Copy link
Member

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.
I tested the change in setup.py with python3 (3.9) and other changes were not required. I did not test for python2 though.

Just going through the code made me realize that the other changes looks to be for python2 support.
Is my understanding correct here.

Thanks

@jaraco
Copy link
Contributor Author

jaraco commented Sep 30, 2021

The changes in the file ibm_db_dbi.py and testfunctions.py, is it in order to support the backward compatibility for PYTHON2.

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 lib2to3 during setup (the goal of this effort).

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.

@amukherjee28
Copy link
Member

Hi @jaraco
Thanks for the confirmation.

One last confirmation with these changes do you thing we still need the pyproject.toml file ?

@jaraco
Copy link
Contributor Author

jaraco commented Oct 1, 2021 via email

@ofek
Copy link

ofek commented Oct 1, 2021

@amukherjee28 This sounds reasonable to me as well.

@amukherjee28
Copy link
Member

With python3 the changes work fine. But with python2 there are issue when running test cases.
I have to look into the changes a bit more to understand the impact on both python3 and python2 else will have to release only with the first commit and ignoring the other two commits.

@jaraco
Copy link
Contributor Author

jaraco commented Oct 4, 2021

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).

@jaraco
Copy link
Contributor Author

jaraco commented Oct 4, 2021

The changes in #656 should have been enough to prevent the issue for users using pip or another PEP 518-compatible builder, although I see in that PR that the fix seems not to have worked for some users. Note that without the MANIFEST.in change, the sdist that's produced for the release needs to be built using a late version of Setuptools (43 or later).

@jaraco jaraco mentioned this pull request Oct 4, 2021
@amukherjee28 amukherjee28 merged commit 98ae759 into ibmdb:master Oct 4, 2021
@amukherjee28
Copy link
Member

Thanks a lot for the help @jaraco.
New version 3.1.0 released with the changes.

Support for the new setuptools working fine.

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