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

Added canonicalize_name() to console/commands/init.py #5076

Merged
merged 9 commits into from
Jan 29, 2022
Merged

Added canonicalize_name() to console/commands/init.py #5076

merged 9 commits into from
Jan 29, 2022

Conversation

evanrittenhouse
Copy link
Contributor

@evanrittenhouse evanrittenhouse commented Jan 20, 2022

Pull Request Check List

Resolves: #5035
Resolves: #5033

  • Added tests for changed code - didn't add tests, but new code passes all existing tests.
  • Updated documentation for changed code.

Copy link
Member

@finswimmer finswimmer left a comment

Choose a reason for hiding this comment

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

Thanks a lot. Looks good to me 👍

As discussed here my suggestion for a test:

You can take the test_interactive_with_dependencies as an example and play around with adding packages to the repo, give different spelling (upper/lower cases) of the package you search and always expect to find it in the first position.

src/poetry/console/commands/init.py Outdated Show resolved Hide resolved
src/poetry/console/commands/init.py Outdated Show resolved Hide resolved
tests/console/commands/test_init.py Outdated Show resolved Hide resolved
tests/utils/test_helpers.py Outdated Show resolved Hide resolved
Evan Rittenhouse added 9 commits January 29, 2022 12:40
Used canonicalize_name to standardize the names of all packages in
poetry init with interactive dependencies. Given its importance, added a
test_canoncalize_name() test to tests/utils/test_helpers.py
Parameterized a _generate_choice_list_packages fixture in order to call
the test with both > 10 and < 10 cases, verifying that output is <= 10
and the package_name has the desired package first in choices
Also added cases for truncation and non-truncation in
test_generate_choice_list to ensure the message is printed in only the
correct cases
Moved info_string generation logic out of init._generate_choice_list
Copy link
Member

@finswimmer finswimmer left a comment

Choose a reason for hiding this comment

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

Thanks a lot for your contribution. Looks good to me 👍

Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants