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
Merged

Conversation

czoido
Copy link
Contributor

@czoido 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
Copy link

CLAassistant commented Sep 18, 2019

CLA assistant check
All committers have signed the CLA.

@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 September 30, 2019 07:57
@memsharded memsharded self-assigned this Sep 30, 2019
Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

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

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 memsharded left a comment

Choose a reason for hiding this comment

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

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
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 lasote left a comment

Choose a reason for hiding this comment

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

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.

conans/util/progress_bar.py Outdated Show resolved Hide resolved
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
Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

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

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
@lasote lasote merged commit ff0489e into conan-io:develop Oct 8, 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.

Refactor progress bars
5 participants