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

Replace instances of #!/usr/bin/env python with #!/usr/bin/env python2 #2676

Merged
merged 1 commit into from
Jun 4, 2018

Conversation

ahuang11
Copy link
Contributor

@ahuang11 ahuang11 commented May 22, 2018

Method:

grep -rl "/usr/bin/env python" * -R | xargs sed -i 's#/usr/bin/env python#/usr/bin/env python2#g'

followed by this command

grep -rl "/usr/bin/env python22" * -R | xargs sed -i 's#/usr/bin/env python22#/usr/bin/env python2#g'

to clean up any existing python2 -> python22 -> python 2.

Referencing from this http://tarunlinux.blogspot.com/2014/02/linux-replace-string-in-multiple-files.html and that https://stackoverflow.com/questions/16790793/how-to-replace-strings-containing-slashes-with-sed

@hjoliver
Copy link
Member

hjoliver commented May 22, 2018

Thanks @ahuang11

This change appears to be consistent with the advice in PEP 394.

I guess we just need to be confident that our major users do all have a python2 symlink on their systems. Hopefully this is standard. I'll await comment from @cylc/core on this.

(Note also, port to Python 3 should be on the agenda next year).

@hjoliver hjoliver added this to the soon milestone May 22, 2018
@matthewrmshin matthewrmshin modified the milestones: soon, next release May 24, 2018
@matthewrmshin
Copy link
Contributor

Looks harmless.

Just to echo on @hjoliver - We have a clear roadmap to migrate to Python 3. The main blockers are the GUIs which are based on GTK2. We'll migrate the GUIs to be based on a newer technology first and then we'll move the remaining code base to Python 3. Hopefully, by the time we are able to do the migration, it will just be a straightforward style change exercise.

See also discussions on #1873 #1874.

@matthewrmshin matthewrmshin merged commit 1919c28 into cylc:master Jun 4, 2018
@matthewrmshin
Copy link
Contributor

I have moved forward the milestone of this PR. Although it is a big change, it should be harmless and is consistent with Python's advice.

@hjoliver
Copy link
Member

Agreed.

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