pip icon indicating copy to clipboard operation
pip copied to clipboard

Remove `import re` from script template

Open hukkin opened this issue 10 months ago • 5 comments

Overrides distlib.scripts.ScripMaker.script_template with a template that doesn't import re.

Closes https://github.com/pypa/pip/issues/13165

hukkin avatar Jan 14 '25 18:01 hukkin

While I would personally prefer the distlib script to contain the minimal number of imports, I am against diverging from distlibs default in pip.

If distlib maintainers don't want to take on the burden of this putting that burden on to pip has all the same problems and more, pip is not running distlib's test suite, does not have distlib's expertise, and could fall out of sync with changes in distlib. And this would affect a huge number of users.

I'll say -0, because it is actually fairly simple, and maybe some other maintainer is enthusiastic to support this.

notatallshaw avatar Jan 14 '25 19:01 notatallshaw

Added some code review comments, but see my comment on #13165 for my broader views.

pfmoore avatar Jan 14 '25 20:01 pfmoore

maybe some other maintainer is enthusiastic to support this.

I am!

pradyunsg avatar May 09 '25 09:05 pradyunsg

Note @ichard26 has some changes for this template also: https://github.com/pypa/distlib/pull/242

@ichard26 you want to pull them in in this or a follow up PR?

notatallshaw avatar May 09 '25 11:05 notatallshaw

Let's keep the changes separate. If we're going to override the script template, then I'm happy to make the changes against our template instead against distlib, but they achieve different goals and should be reviewed independently.

ichard26 avatar May 09 '25 15:05 ichard26

@hukkin thanks for your contribution.

notatallshaw avatar Jun 21 '25 18:06 notatallshaw