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

Refactor progress bars #5763

Merged
merged 64 commits into from Oct 8, 2019

Conversation

@czoido
Copy link
Contributor

czoido commented Sep 18, 2019

Changelog: Feature: Refactor Conan Upload, Download and Compress progress bars.
Docs: omit
Closes #5739

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.

@CLAassistant

This comment has been minimized.

Copy link

CLAassistant commented Sep 18, 2019

CLA assistant check
All committers have signed the CLA.

@czoido czoido force-pushed the czoido:refactor_progress_bars branch from 30d335e to 541ccff Sep 18, 2019
@czoido czoido changed the title [WIP] Refactor progress bars Refactor progress bars Sep 30, 2019
@czoido czoido marked this pull request as ready for review Sep 30, 2019
@memsharded memsharded self-assigned this Sep 30, 2019
Copy link
Member

memsharded left a comment

This is looking very, very good!
This refactor is very challenging, but excellent job here.
Please have a look to the comments.

conans/client/output.py Outdated Show resolved Hide resolved
conans/client/rest/uploader_downloader.py Outdated Show resolved Hide resolved
conans/client/rest/uploader_downloader.py Outdated Show resolved Hide resolved
conans/client/rest/uploader_downloader.py Outdated Show resolved Hide resolved
conans/client/rest/uploader_downloader.py Outdated Show resolved Hide resolved
Copy link
Member

memsharded left a comment

I have been thinking a bit, and I would say that the correct approach would be:

  • Do not change the output.py to include tqdm stuff
  • Make an Adapter around an output, that returns a similar output object, but that overwrites the write with the custom tqdm stuff. This adapter is part of the progress_bar package
  • Pass adaptors around the outputs to those who need them in the context of progress bars being displayed. They shouldn't be many, I'd say that only 1 or 2 different messages are interleaved to progress bars.

This is just an idea, lets wait for @lasote feedback on this PR.

@czoido

This comment has been minimized.

Copy link
Contributor Author

czoido commented Oct 3, 2019

I like that idea and would be much safer than using it for all the output.

Copy link
Contributor

lasote left a comment

As I talked with you on Slack, probably we can unify ReadProgress and WriteProgress.
I've been trying locally and works very well. The code is much nicer too. So great work.

czoido added 2 commits Oct 7, 2019
conans/util/progress_bar.py Outdated Show resolved Hide resolved
@lasote
lasote approved these changes Oct 7, 2019
conans/client/cmd/uploader.py Outdated Show resolved Hide resolved
conans/client/output.py Show resolved Hide resolved
conans/util/progress_bar.py Outdated Show resolved Hide resolved
czoido added 5 commits Oct 7, 2019
Copy link
Member

memsharded left a comment

Small question, but otherwise fantastic job, can be merged (after fixing the broken iterator: https://conan-ci.jfrog.info/blue/organizations/jenkins/ConanTestSuite/detail/PR-5763/37/pipeline)

conans/client/output.py Show resolved Hide resolved
czoido added 3 commits Oct 8, 2019
@lasote lasote merged commit ff0489e into conan-io:develop Oct 8, 2019
2 checks passed
2 checks passed
continuous-integration/jenkins/pr-head This commit looks good
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.