Skip to content

gh-85792: Remove the shebang of internal Tools to avoid confusion. #23581

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

Closed
wants to merge 3 commits into from

Conversation

shihai1991
Copy link
Member

@shihai1991 shihai1991 commented Dec 1, 2020

The following files' shebang now be removed:

  • Mac/BuildScript/build-installer.py
  • Modules/_sha3/cleanup.py
  • Objects/typeslots.py
  • Parser/asdl_c.py
  • Python/makeopcodetargets.py
  • Tools/clinic/clinic.py
  • Tools/peg_generator/pegen/main.py

@shihai1991 shihai1991 changed the title bpo41626: Remove the shebang of inner Tools. bpo-41626: Remove the shebang of inner Tools. Dec 1, 2020
@shihai1991 shihai1991 changed the title bpo-41626: Remove the shebang of inner Tools. bpo-41626: Remove the shebang of inner Tools to avoid confusion. Dec 1, 2020
@shihai1991
Copy link
Member Author

@merwok @ned-deily Hi, Eric, Ned. Can you take a look when you have free time? Thanks.

@merwok
Copy link
Member

merwok commented Dec 1, 2020

Does «inner Tools» mean «internal Tools» (used for CPython dev but not for regular people)?

@shihai1991
Copy link
Member Author

shihai1991 commented Dec 2, 2020

Does «inner Tools» mean «internal Tools» (used for CPython dev but not for regular people)?

Yes. I am not a native English speaker, so I don't there have the obvious difference between internal with inner. If internal will be more exact, I can update it :)

@shihai1991 shihai1991 changed the title bpo-41626: Remove the shebang of inner Tools to avoid confusion. bpo-41626: Remove the shebang of internal Tools to avoid confusion. Dec 2, 2020
@@ -1,5 +1,4 @@
#!/usr/bin/python
# Usage: typeslots.py < Include/typeslots.h typeslots.inc
# Usage: ./python typeslots.py < Include/typeslots.h typeslots.inc
Copy link
Member

Choose a reason for hiding this comment

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

This looks wrong; either you're in the directory with ./python or in Objects.
Same for _sha3/cleanup.py. Did you try these commands?

Copy link
Member Author

@shihai1991 shihai1991 Dec 4, 2020

Choose a reason for hiding this comment

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

This looks wrong; either you're in the directory with ./python or in Objects.

Oh, you are right. I just point out developer should use ./python in old usage. Using entire command would be better. I will update it.

Same for _sha3/cleanup.py. Did you try these commands?

the command in _sha3/cleanup.py is a entire command.

Copy link
Member Author

Choose a reason for hiding this comment

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

There have an another question. Typeslots.py should be moved to the dir of Tools? It's weird leave it alone in Objects. Maybe we should open an new bpo to discuss it.

@@ -1,5 +1,3 @@
#!/usr/bin/env python3
#
Copy link
Member

Choose a reason for hiding this comment

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

I don't think Clinic needs a locally built Python.

Copy link
Member Author

@shihai1991 shihai1991 Dec 4, 2020

Choose a reason for hiding this comment

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

Yes. It doesn't need a local builtin python. There have docs to introduce how to run this clinic.py. So I think remove it would be better(Avoid update the python version again and again).

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

Choose a reason for hiding this comment

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

I don't think makeopcodetargets needs a locally built Python. Does it?

Copy link
Member Author

@shihai1991 shihai1991 Dec 4, 2020

Choose a reason for hiding this comment

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

You are right. It will be called in makefile: https://github.com/python/cpython/blob/master/Makefile.pre.in#L946.
So I think the shebang haven't worked in here.

@github-actions
Copy link

github-actions bot commented Jan 4, 2021

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Jan 4, 2021
@tiran tiran removed their request for review April 18, 2021 09:51
@markshannon markshannon removed their request for review June 16, 2021 13:08
@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label Aug 1, 2022
Copy link
Member

@iritkatriel iritkatriel left a comment

Choose a reason for hiding this comment

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

This has merge conflicts now.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@shihai1991
Copy link
Member Author

This has merge conflicts now.

Thanks for your mention, Irit. I resolve the conflicts. But I forget this MR's content already ;)

@AlexWaygood AlexWaygood changed the title bpo-41626: Remove the shebang of internal Tools to avoid confusion. gh-85792: Remove the shebang of internal Tools to avoid confusion. Nov 27, 2022
@iritkatriel iritkatriel dismissed their stale review November 27, 2022 15:30

conflicts were resolved.

@encukou
Copy link
Member

encukou commented Mar 19, 2024

Sorry that I didn't follow up.
All the changed files are marked executable; we should remove the executable bit if we remove the shebang.

But, I think that today, it's best to close the PR without merging -- it's not solving any bug, and python2/python3 confusion should be history now.
I'll close next month if there are no objections.

@encukou encukou closed this Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants