libgit2 / pygit2

Python bindings for libgit2
https://www.pygit2.org/
Other
1.58k stars 382 forks source link

sideband_progress callback never happens #1119

Closed antazoey closed 2 years ago

antazoey commented 2 years ago

Issue

When trying to use sideband_progress on GitRemoteCallbacks, nothing happens.

Example Code

import pygit2

class GitRemoteCallbacks(pygit2.RemoteCallbacks):
    def sideband_progress(self, string):
       # This never gets called. I have tried setting
       # breakpoints, printing, and writing a file. Nada.
       print(string)

repo_url = "https://github.com/OpenZeppelin/openzeppelin-contracts.git"
target_path = "./tempdeleteme"

clone = pygit2.clone_repository(
   repo_url, target_path, callbacks=GitRemoteCallbacks()
)

To summarize the comment, I have tried various methods but can't seem to get any sign that this callback happens.

My Goal

I would like to be able to display a progress bar while cloning a repository, especially when it is a larger repositoy

Conclusion

Thank you for everything :)

jdavid commented 2 years ago

@jorio has fixed this in PR #1120 Try the master branch. Closing.. reopen if the master branch doesn't work for you.

antazoey commented 2 years ago

@jorio has fixed this in PR #1120 Try the master branch. Closing.. reopen if the master branch doesn't work for you.

I was able to test the changes via editing site-packages but I was not able to figure out how to install from source haha. It kept erroring and I don't have a lot of the C-based dependencies it seems (am on macOS).

Thank you so much!

P.S. I am wondering approximately when you think the next release will be out? I would like to test it out again at that point and increment the version pinned. Thankfully, my progress-bar changes don't cause errors on the current released version.

thanks again :)

jorio commented 2 years ago

@unparalleled-js If you need to develop your progress code before the next release comes out, try renaming your "sideband_progress" function to just "progress". Don't forget to change it back when the update comes out though!