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

Use utils.UNSAFE_PACKAGES as source of truth #516

Merged
merged 2 commits into from
May 31, 2017

Conversation

dschaller
Copy link
Member

@dschaller dschaller commented May 27, 2017

Update cli help for --allow-unsafe to use utils.UNSAFE_PACKAGES so this is only defined in one place.

  --allow-unsafe                  Pin packages considered unsafe: distribute,
                                  pip, setuptools
Contributor checklist
  • Provided the tests for the changes
  • Added the changes to CHANGELOG.md
  • Requested (or received) a review from another contributor

@dschaller
Copy link
Member Author

@jdufresne @vphilippon @davidovich any chance one of you could take a look?

@@ -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)))
Copy link

@rpkilby rpkilby May 30, 2017

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.

Copy link
Member

@jdufresne jdufresne May 30, 2017

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))

Copy link
Member Author

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

Copy link
Member

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.

Copy link

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.

@dschaller
Copy link
Member Author

Updated @jdufresne @rpkilby

@dschaller dschaller merged commit 2439a7f into jazzband:master May 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants