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

add disable_progress_bar option to disable tqdm. #427

Merged

Conversation

varunkamath18
Copy link
Contributor

  • Add a disable_progress_bar option to settings.

  • Add a disable_progress_bar argument to init method of the repository.

  • Forward repository's disable_progress_bar property to
    tqdm ProgressBar as disable kwarg.

  • update README with help options for upload command.

[x] ran tox -e lint
[x] ran tox against versions: 2.7, 3.6
[x] ran tox -e docs
[x] Added test to make sure tqdm is initialized with disable flag when repository is
initialized with disable_progress_bar parameter.

Closes #386

* Add a disable_progress_bar option to settings.

* Add a disable_progress_bar argument to init method of the repository.

* Forward repository's disable_progress_bar property to
tqdm ProgressBar as disable kwarg.

* update README with help options for upload command.
@codecov
Copy link

codecov bot commented Nov 24, 2018

Codecov Report

Merging #427 into master will increase coverage by 1.81%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #427      +/-   ##
=========================================
+ Coverage   78.29%   80.1%   +1.81%     
=========================================
  Files          14      14              
  Lines         751     754       +3     
  Branches      108     108              
=========================================
+ Hits          588     604      +16     
+ Misses        130     113      -17     
- Partials       33      37       +4
Impacted Files Coverage Δ
twine/repository.py 73.33% <100%> (+12.75%) ⬆️
twine/settings.py 93.33% <100%> (+0.22%) ⬆️
twine/wininst.py 31.57% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 89a35dc...51464a3. Read the comment docs.

* use mock instead of  unittest.mock for python2.7
* Update tox.ini to depend on mock for py27 and pypy.
@@ -16,7 +16,13 @@
from twine import repository
from twine.utils import DEFAULT_REPOSITORY

try:
from unittest import mock
Copy link
Member

Choose a reason for hiding this comment

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

This project doesn't use mock. Instead we use pretend which is already imported below and used throughout the test file. Please update your test to use that instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Turns out I didn't need mock after all. Just replaced ProgressBar with a context manager and it did the trick. Thanks!

replace ProgressBar with a contextmanager and assert on the args.
No need for a mock object.
@sigmavirus24 sigmavirus24 merged commit 81ee303 into pypa:master Jan 12, 2019
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.

2 participants