-
-
Notifications
You must be signed in to change notification settings - Fork 610
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
Use utils.UNSAFE_PACKAGES as source of truth #516
Use utils.UNSAFE_PACKAGES as source of truth #516
Conversation
@jdufresne @vphilippon @davidovich any chance one of you could take a look? |
piptools/scripts/compile.py
Outdated
@@ -58,7 +58,7 @@ class PipCommand(pip.basecommand.Command): | |||
help=('Output file name. Required if more than one input file is given. ' | |||
'Will be derived from input file otherwise.')) | |||
@click.option('--allow-unsafe', is_flag=True, default=False, | |||
help="Pin packages considered unsafe: pip, setuptools & distribute") | |||
help="Pin packages considered unsafe: {}".format(list(UNSAFE_PACKAGES))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use sorted
instead of list
, since sets are unordered. idk if the output is consistent or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is displaying as, ['distribute', 'pip', 'setuptools']
where previously it was displaying as pip, setuptools & distribute
. Did you intend to include the full repr value of the list? Maybe do the following instead:
', '.join(sorted(UNSAFE_PACKAGES))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did consider formatting the output but figured the overhead wasn't worth it since we wouldn't be able to have it identical to the original and the list output is still consumable. Happy to update if you think it's worth it @jdufresne
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just my personal preference, the commas are more readable than the repr. I'm open to other people's preference if they'd like to see something else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe ', '.join(sorted(UNSAFE_PACKAGES))
? Predictable ordering and better presentation than a simple list repr.
Updated @jdufresne @rpkilby |
Update cli help for --allow-unsafe to use utils.UNSAFE_PACKAGES so this is only defined in one place.
Contributor checklist