Skip to content

Migrate to use Python 3 #378

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

Merged
merged 1 commit into from
Apr 14, 2022
Merged

Migrate to use Python 3 #378

merged 1 commit into from
Apr 14, 2022

Conversation

dduan
Copy link
Contributor

@dduan dduan commented Mar 30, 2022

Migrate Python code to Python 3 by:

  1. update scripts' shebang
  2. migrate syntax in Python modules
  3. delete unnecessary imports

@dduan dduan requested a review from ahoppen as a code owner March 30, 2022 22:51
@dduan
Copy link
Contributor Author

dduan commented Mar 30, 2022

@swift-ci test

@dduan
Copy link
Contributor Author

dduan commented Mar 31, 2022

Ah, I see this one is mutually dependent with apple/swift....

@ahoppen
Copy link
Member

ahoppen commented Apr 4, 2022

Thanks for tackling this 🙏

Yes, you would also need to update the files in apple/swift/utils/gyb_syntax_support to Python 3 because we import those from apple/swift-syntax

@dduan
Copy link
Contributor Author

dduan commented Apr 5, 2022

@ahoppen Everything in apple/swift should be Python 3 compatible. If I'm not mistaken, the problem is when a script is invoked as an executable as opposed to a Python module, the OS chooses according to its shabang. In our case, utils/gyb has python, and I'm updating it to python3 in apple/swift. But that PR won't fully pass CI because it's running tests in this repo, which has the same shebang problems addressed in this PR.

@ahoppen
Copy link
Member

ahoppen commented Apr 5, 2022

That sounds like you need to invoke cross-repo PR testing by mentioning the PR you want to test in conjunction with this one. Let’s see if it works.

swiftlang/swift#42086
@swift-ci Please test

@dduan dduan closed this Apr 6, 2022
@dduan dduan reopened this Apr 6, 2022
@dduan dduan changed the title Update shebang to use Python 3 explicitly Migrate to use Python 3 Apr 6, 2022
Migrate Python code to Python 3 by:

* update scripts' shebang
* migrate syntax in Python modules
* delete unnecessary imports
@dduan dduan closed this Apr 6, 2022
@dduan dduan reopened this Apr 6, 2022
@ahoppen
Copy link
Member

ahoppen commented Apr 6, 2022

swiftlang/swift#42086
@swift-ci Please test Linux

@dduan
Copy link
Contributor Author

dduan commented Apr 6, 2022

swiftlang/swift#42086
@swift-ci test

@dduan
Copy link
Contributor Author

dduan commented Apr 6, 2022

Alright. All green in both repos now.

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woohoo. This is great 🥳 Thanks for tackling this. It was long overdue

@dduan
Copy link
Contributor Author

dduan commented Apr 13, 2022

I merged the PR in apple/swift. I imagine PRs here will start failing unless we merge this.

@rintaro rintaro merged commit e3d3a83 into swiftlang:main Apr 14, 2022
@rintaro
Copy link
Member

rintaro commented Apr 14, 2022

Merged to unblock the ci

@dduan dduan deleted the dd/py3 branch April 14, 2022 02:37
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.

3 participants