reflex icon indicating copy to clipboard operation
reflex copied to clipboard

Replace rich progress bar to tqdm progress bar

Open TG199 opened this issue 1 year ago β€’ 6 comments

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.

TG199 avatar Jun 18 '24 02:06 TG199

Okay

TG199 avatar Jun 25 '24 05:06 TG199

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 #3487

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

masenf avatar Jun 28 '24 00:06 masenf

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.

itsmeadarsh2008 avatar Jul 03 '24 14:07 itsmeadarsh2008

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

TG199 avatar Jul 03 '24 14:07 TG199

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 πŸ€”

itsmeadarsh2008 avatar Jul 05 '24 11:07 itsmeadarsh2008

Okay

TG199 avatar Jul 05 '24 15:07 TG199

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 Β» [email protected] – License: MIT AND MPL-2.0
  pyproject.toml Β» [email protected] – 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.

ericwb avatar Aug 29 '24 00:08 ericwb

Marked this as draft until resynced with main.

Lendemor avatar Oct 25 '24 18:10 Lendemor

closing this due to inactivity, feels free to resurrect it when appropriate :+1:

adhami3310 avatar Jan 07 '25 23:01 adhami3310