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

Tests: Use portable #! in python scripts (/usr/bin/env) #8270

Merged
merged 2 commits into from
Aug 15, 2016

Conversation

ChoHag
Copy link
Contributor

@ChoHag ChoHag commented Jun 26, 2016

These changes should also be backported to the stable releases so that they build and test on systems which don't install python to /usr

It also changes python scripts which are not related to tests because it was easier not to have grep discriminate.

@@ -1,4 +1,4 @@
#!/usr/bin/python2
#!/usr/bin/env python2
Copy link
Member

Choose a reason for hiding this comment

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

Couldn't this say #!/usr/bin/env python, since #7723?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, security-check works with python 3 too. The build system calls all these scripts by passing them to the python interpreter, so it doesn't care what is on the first line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made no attempt to check for portability of the python scripts between python releases, just a straight s/// on all *.py files

Copy link
Member

Choose a reason for hiding this comment

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

Can you remove the trailing 2's according to the pull request I linked above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are 5 files using python2, only security-check.py and symbol-check.py (notably not test-security-check.py) have been changed in #7723. Accordingly I've changed only the same two files.

contrib/devtools/security-check.py:#!/usr/bin/env python2
contrib/devtools/symbol-check.py:#!/usr/bin/env python2
contrib/devtools/test-security-check.py:#!/usr/bin/env python2
contrib/zmq/zmq_sub.py:#!/usr/bin/env python2
share/rpcuser/rpcuser.py:#!/usr/bin/env python2

I'm happy to abandon this PR in favour of incorporating the changes directly in #7723 if it simplifies things.

@@ -1,4 +1,4 @@
#!/usr/bin/python2
Copy link
Contributor

Choose a reason for hiding this comment

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

Did we actually test that this works on python3?

Copy link
Member

Choose a reason for hiding this comment

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

@petertodd
Copy link
Contributor

utACK 7b01ce2

@fanquake
Copy link
Member

fanquake commented Aug 8, 2016

utACK 7b01ce2

1 similar comment
@maflcko
Copy link
Member

maflcko commented Aug 8, 2016

utACK 7b01ce2

@maflcko maflcko merged commit 7b01ce2 into bitcoin:master Aug 15, 2016
maflcko pushed a commit that referenced this pull request Aug 15, 2016
7b01ce2 Favour python over python2 as per PR #7723 (Matthew King)
873e81f Use portable #! in python scripts (/usr/bin/env) (Matthew King)
codablock pushed a commit to codablock/dash that referenced this pull request Jan 8, 2018
…n/env)

7b01ce2 Favour python over python2 as per PR bitcoin#7723 (Matthew King)
873e81f Use portable #! in python scripts (/usr/bin/env) (Matthew King)
@str4d str4d mentioned this pull request Jun 5, 2018
zkbot added a commit to zcash/zcash that referenced this pull request Jun 7, 2018
Fix MacOS tests

Includes code cherry-picked from upstream PR bitcoin/bitcoin#8270.
zkbot added a commit to zcash/zcash that referenced this pull request Jun 18, 2018
Fix MacOS tests

Includes code cherry-picked from upstream PR bitcoin/bitcoin#8270.
zkbot added a commit to zcash/zcash that referenced this pull request Jun 19, 2018
Fix MacOS tests

Includes code cherry-picked from upstream PR bitcoin/bitcoin#8270.
andvgal pushed a commit to energicryptocurrency/gen2-energi that referenced this pull request Jan 6, 2019
…n/env)

7b01ce2 Favour python over python2 as per PR bitcoin#7723 (Matthew King)
873e81f Use portable #! in python scripts (/usr/bin/env) (Matthew King)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants