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

set default tqdm.disable from os.environ #950

Closed
wants to merge 1 commit into from

Conversation

kaivalyar
Copy link

@kaivalyar kaivalyar commented Apr 26, 2020

Allow setting the tqdm.disable option from the environment variables. The default value of False is unchanged, as is the expected behavior with None.

Resolves issues laid out it #619 #614 #612. Similar to the request in #370.

  • I have marked all applicable categories:
    • exception-raising fix
    • visual output fix
    • documentation modification
    • new feature
  • If applicable, I have mentioned the relevant/related issue(s)

Less important but also useful:

  • I have visited the source website, and in particular
    read the known issues
  • I have searched through the issue tracker for duplicates
  • I have mentioned version numbers, operating system and
    environment, where applicable:
    import tqdm, sys
    print(tqdm.__version__, sys.version, sys.platform)

Allow setting the tqdm.disable option from the environment variables. The default value of `False` is unchanged, as is the expected behavior with `None`.
@jarednielsen
Copy link

This would be helpful for my use case, where I'm using a third-party library which has a tqdm bar I'd like to disable but can't modify the library code itself easily.

@kaivalyar
Copy link
Author

Yes, this is exactly where I ran into this issue. I'm using pgmpy, which displays it's loops using the default tqdm behavior, which I would like to disable.

@jarednielsen
Copy link

Looks like this PR has been open for quite some time. @casperdcl Any thoughts on this change?

casperdcl added a commit that referenced this pull request Jun 25, 2020
All the bells & whistles!

- related #614
- realted #950
@Grokzen
Copy link

Grokzen commented Oct 26, 2020

A simple use-case for this option is that we are running a big set of code where we have both support to run the exact same code as a cli tool from a users computer and in a hosted environment inside celery. And when we run it in celery, we do not want our logs to be polluted with tdqm loggin output. This option would make it super easy to disable all tdqm logging as we have it in a lot of places in our code and we would just configure our production servers with this environment variable and we are all set.

@Mahdi-Hosseinali
Copy link

Any updates on this PR? This is very useful when running tests and in production.

casperdcl added a commit that referenced this pull request Aug 5, 2023
- fixes #370, fixes #612, fixes #619, fixes #1318
- closes #950, closes #1061
casperdcl added a commit that referenced this pull request Aug 8, 2023
- fixes #370, fixes #612, fixes #619, fixes #1318
- closes #950, closes #1061
casperdcl added a commit that referenced this pull request Aug 8, 2023
- fixes #370, fixes #612, fixes #619, fixes #1318
- closes #950, closes #1061
@casperdcl casperdcl self-assigned this Aug 9, 2023
@casperdcl casperdcl added duplicate 🗐 Seen it before p3-enhancement 🔥 Much new such feature c3-small 🕒 Complexity medium labels Aug 9, 2023
@casperdcl
Copy link
Sponsor Member

Thanks everyone for your patience! Just released tqdm==4.66.0 which includes support for env var overrides. I'm using TQDM_MININTERVAL=5 in most of my CI jobs now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c3-small 🕒 Complexity medium duplicate 🗐 Seen it before p3-enhancement 🔥 Much new such feature
Projects
Casper
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants