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

Replace rich progress bar to tqdm progress bar #3514

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

TG199
Copy link
Contributor

@TG199 TG199 commented Jun 18, 2024

All Submissions:

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

New Feature Submission:

  • Does your submission pass the tests?
  • Have you linted your code locally prior to submission?

Changes To Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Description

This commit replaces the Rich progress bar implementation with TQDM #3487. The following changes were made:

  • Replaced Rich Progress Bar:

    • Updated the _zip function to use TQDM for progress bar handling.
    • TQDM is now responsible for displaying progress during zipping operations, providing a simpler and lighter alternative to Rich.
  • Preserved Pretty Printing with Rich:

    • Retained the use of rich.console for pretty printing logs and outputs to maintain readability and formatting in the console.
  • Updated Dependencies:

    • Added TQDM to pyproject.toml as a dependency.

Copy link
Contributor

@picklelo picklelo left a comment

Choose a reason for hiding this comment

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

I think you need to poetry lock again for the tests

@TG199
Copy link
Contributor Author

TG199 commented Jun 25, 2024

Okay

@masenf
Copy link
Collaborator

masenf commented Jun 28, 2024

i pushed a fix for the merge conflict here... but i think there are some other issues we need to resolve here before we can take this change.

  1. update the dependency review CI job to accept the MIT / APL-2.0 license... unfortunately these combo licenses need to all be added in the workflow
  2. this adds a new dependency but doesn't actually remove the rich dependency as specified by Removing Rich #3487

i'm hesitant to take the new dep without fully removing the old dep

@itsmeadarsh2008
Copy link

itsmeadarsh2008 commented Jul 3, 2024

We can use the termcolor (wheel size - 12.7KB source and built distribution 7.7KB) instead but for the current prompts (that uses rich too) that ask for what kind of template are you building. Or maybe select your region for deployment. I found an alternative born as an inquirer on PyPI (14.5KB). The tqdm is about 169.4KB on the source and 78.3KB on the built distribution.

@TG199
Copy link
Contributor Author

TG199 commented Jul 3, 2024

It appears tqdm lacks necessary features such as colored text support and interactive prompts, so I left that part of the rich lib to handle it

@itsmeadarsh2008
Copy link

itsmeadarsh2008 commented Jul 5, 2024

It appears tqdm lacks necessary features such as colored text support and interactive prompts, so I left that part of the rich lib to handle it

Use termcolor and inquirer python 🤔

@TG199
Copy link
Contributor Author

TG199 commented Jul 5, 2024

Okay

@ericwb
Copy link
Contributor

ericwb commented Aug 29, 2024

1. update the dependency review CI job to accept the MIT / APL-2.0 license... unfortunately these combo licenses need to all be added in the workflow
  The following dependencies have incompatible licenses:
  poetry.lock » tqdm@4.66.4 – License: MIT AND MPL-2.0
  pyproject.toml » tqdm@4.66.4 – License: MIT AND MPL-2.0
  Error: Dependency review detected incompatible licenses.

The dependency review failure is with MPL-2.0 license not APL-2.0. Note, that MPL is a copyleft license, so the maintainers should consider whether this might affect stakeholders. Might not be for most, but some enterprises steer clear of anything copyleft.

Here's a nice FAQ on MPL:
https://www.mozilla.org/en-US/MPL/2.0/FAQ/

Also, the fix is simply, just add MPL-2.0 to the allow list.

@Lendemor Lendemor marked this pull request as draft October 25, 2024 18:08
@Lendemor
Copy link
Collaborator

Marked this as draft until resynced with main.

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.

7 participants