Skip to content

Conversation

tclh123
Copy link
Owner

@tclh123 tclh123 commented Nov 24, 2013

No description provided.

jdavid and others added 29 commits January 24, 2024 11:05
Changelog, readme, etc.
ReferenceType.OID and LISTALL were also deprecated (in favor of DIRECT and ALL) to keep in sync with libgit2's own deprecated enums.
On Fedora 40, this test fails with:

__________________________________ test_fetch __________________________________
emptyrepo = pygit2.Repository('/tmp/pytest-of-mockbuild/pytest-0/test_fetch0/emp
tyrepo/.git/')
    def test_fetch(emptyrepo):
        remote = emptyrepo.remotes[0]
        stats = remote.fetch()
>       assert stats.received_bytes == REMOTE_REPO_BYTES
E       assert 2760 == 2758
E        +  where 2760 = <pygit2.remote.TransferProgress object at 0xf60a7db0>.received_bytes
test/test_remote.py:218: AssertionError

Probably due to zlib-ng/zlib differences.
It would be great to have ppc64le manylinux wheels available on PyPI.
The change from wimglenn@aab211a incorrectly made setuptools a runtime dependency of pygit2. It is not a runtime dependency, it is only a build dependency (pkg_resources / setuptools are not used outside of the installer script setup.py). It should be possible to use pygit2 without needing setuptools installed.
On EPEL8 builds for s390x this transfers ~3040 bytes:

__________________________________ test_fetch __________________________________
emptyrepo = pygit2.Repository('/tmp/pytest-of-mockbuild/pytest-0/test_fetch0/emptyrepo/.git/')
    def test_fetch(emptyrepo):
        remote = emptyrepo.remotes[0]
        stats = remote.fetch()
        assert stats.received_bytes > 2700
>       assert stats.received_bytes < 2800
E       assert 3041 < 2800
E        +  where 3041 = <pygit2.remotes.TransferProgress object at 0x3ffa8668dd0>.received_bytes
test/test_remote.py:218: AssertionError

Would be too easy if this were deterministic.

Signed-off-by: Nils Philippsen <[email protected]>
Also use git_strarray_dispose instead of deprecated git_strarray_free.
And fix a couple of build warnings in git_commit_create.
To emphasize that the StrArray() context manager returns a pointer,
implement its ptr() property and use it whenever calling a C function
that takes a pointer to a git_strarray structure as a parameter.
Enable the StrArray() context manager to be used for assigning a list of
strings to a pre-existing git_strarray structure.  This is useful when
some other structure contains a git_strarray (rather than a pointer to
it).
Add a new keyword argument to Remote.push() that is a counterpart of
`git push --push-option=<string>`.

Fixes #1126
And small coding improvements related to git_strarray
kbaikov and others added 30 commits August 6, 2025 07:39
This commit adds a setter for the url property of the Submodule class.
The new setter leverages 'git_submodule_set_url' from libgit2.
Since the minium declared python version is 3.10
we don't need the Union and Option and many
type imports should be done from collections.abc.

so i ran fd --extension py --type f --exec pyupgrade --py310-plus
on the repo.
All changes are automated, i.e. no manual edit.
This hopefully helps with future typings.
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.