rec / safer

🧷 A safer writer 🧷
https://rec.github.io/safer/
MIT License
174 stars 10 forks source link

`safer.py` is not a script (and should not be handled as one) #16

Closed jhereth closed 2 years ago

jhereth commented 2 years ago

setup.py claims that safer.py is an (executable) script.

The docs say that "Scripts are files containing Python source code, intended to be started from the command line." and should have something like #! /usr/bin/env python in their first line.

This is not the case for safer.py nor does this file contain any logic to be executed when called from the command line.

This leads to interesting side-effects.

rec commented 2 years ago

Oops, I'm sure you're right - I set that package up quite a long time ago!

How embarrassing, sorry! Thanks for filing the bug.

I'm about to go to bed here, but I can look at this first thing tomorrow AM here and get a new release out almost immediately.

If you have a pull request or suggestions, I'd of course be happy to get them!

On Thu, Feb 17, 2022 at 10:09 PM Joachim Hereth @.***> wrote:

setup.py claims https://github.com/rec/safer/blob/85c53f9d0502a6a2410741b3b662ea8ad73cff2e/setup.py#L32 that safer.py is an (executable) script.

The docs https://docs.python.org/3/distutils/setupscript.html#installing-scripts say that "Scripts are files containing Python source code, intended to be started from the command line." and should have something like #! /usr/bin/env python in their first line.

This is not the case for safer.py https://github.com/rec/safer/blob/85c53f9d0502a6a2410741b3b662ea8ad73cff2e/safer.py#L1 nor does this file contain any logic to be executed when called from the command line.

This leads to interesting side-effects https://github.com/asottile/reorder_python_imports/issues/222#issuecomment-1042584827 .

— Reply to this email directly, view it on GitHub https://github.com/rec/safer/issues/16, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB53MVO65NJIU5NM34YJC3U3VPZHANCNFSM5OV34DEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- /t

PGP Key: @.** https://tom.ritchford.com https://tom.ritchford.com https://tom.swirly.com https://tom.swirly.com*

jhereth commented 2 years ago

@rec Thanks for the quick response - the PR is here: #17

Good night!

rec commented 2 years ago

I foolishly looked at my phone. :-D

On Thu, Feb 17, 2022 at 10:15 PM Joachim Hereth @.***> wrote:

@rec https://github.com/rec Thanks for the quick response - the PR is here: #17 https://github.com/rec/safer/pull/17

Good night!

— Reply to this email directly, view it on GitHub https://github.com/rec/safer/issues/16#issuecomment-1043454946, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB53MXIS3X2LOUTQXWIBI3U3VQOJANCNFSM5OV34DEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

-- /t

PGP Key: @.** https://tom.ritchford.com https://tom.ritchford.com https://tom.swirly.com https://tom.swirly.com*