Comments (11)
Hello,
I don't like much the idea. Here are other, closely related, disadvantages:
- Will make pygit2 vulnerable to Cython bugs
- Loss of control on the generated C code
- Likely not as fast (related to the reason above)
It is impressive how you have rewritten pygit2 in just one day, it speaks well of the virtues of Cython. But I don't think it is the best fit for pygit2.
The Python community is quite large and interest on libgit2 should raise overtime; pygit2 is already relatively well maintained, 13 people have contributed so far with patches, others have done so by reporting issues. I think libgit2 deserves hand-written carefully tuned Python bindings, and that there will be enough developers/testers interested to make it happen.
Best regards,
from pygit2.
Hi,
i have been thinking about writing cython bindings for libgit2. I think the issue of handwritten vs. Cython is not an either or question, but i think that both bindings (I would call the Cython ones cygit2) should co-exist. This would mean the cython bindings would have to be 100% api compatible to the handwritten ones which AFAICS is currently the case since the Cython bindings use the unit-tests. One could think about introducing a flag allowing the programmer to select an appropriate 'backend' to give the choice to the user.
I think both wrapping approaches have their merits and both can learn from each other.
from pygit2.
I find that proposal (pygit2 and cygit2) interesting, it looks there are more than enough developers interested in one or another, or both (searching a little I found someone else had the same idea, https://github.com/pyos/cygit2).
from pygit2.
It shouldn't be too hard to maintain the Cython bindings if the test suite is shared with the C-API pygit2, but it'll necessarily mean each would have less users/testers :(
Anyway, I'll be keeping them around at least until pygit2 supports Python 3.
I've contacted pyos to see what he thinks.
As for speed... my code is about 10% slower on the test suite, and I didn't try to optimize at all. The test suite is not a good benchmark, though – there's a lot of exception raising; I think Cython's detailed tracebacks are better than speed here.
And talking about speed is useless without a good benchmark, so I'll end here.
from pygit2.
How to share the unit tests? Maybe you could use Git submodules?
I have open an issue for Python 3 support.
Regarding speed, for what I need pygit2 for, 1% slower would already be too much. It depends on the usage scenario I guess, in my case I use Git as a brick in a database system used in a web application (many requests from clients, blah blah ...).
from pygit2.
Git submodules are quite a hassle in my opinion (unless the linked project is big), not to mention libgit2 doesn't really have them yet. I can just continue to pull from pygit2, and ignore the non-test changes.
from pygit2.
Actually, I decided to write cygit2 because I like Python 3, but I don't know C good enough. It would be awesome if you could add support for py3k without using cython.
And if you care about speed that much, you chose the wrong language to write your web application in :-)
from pygit2.
Support for Python 3 has been started.
from pygit2.
Just to comment about the speed stuff and more precisely how I see pygit2.
I think pygit2 should be low-level, expose the features of libgit2 to the Python developer and that's it.
Then I guess other developers will use it to write higher level libraries with richer functionality. I believe the developer of GitPython has already started to use pygit2, maybe Dulwich will follow. I myself maintain such a library (itools.git).
This is important. It is related for instance to question discussed in issue #43, whether pygit2 should accept unicode strings for the Hex SHAs or not.
Cheers,
PS : @pyos you are right Python is not the best choice regarding speed, but...
from pygit2.
For what it's worth in my initial tests I see very small to no difference in overhead, I haven't taken the time to construct an accurate rig but it should be the case that the same speeds can be accomplished with about half of the code to maintain.
from pygit2.
Time to close this issue. If somebody is interested to develop cygit2
just go ahead. Thanks.
from pygit2.
Related Issues (20)
- `certificate_check` callback not used in `remote.connect` or `remote.ls_remotes` HOT 1
- Mailmap with empty email address is not parsed
- _pygit2.GitError: no URL configured for submodule
- Please add more error types
- Test the connection to a git repository without cloning it HOT 1
- Git HTTP Auth breaks w/1.14 HOT 1
- How to create signed tag HOT 1
- How to amend a git commit with GPG signature?
- invalid credential type for any passed RemoteCallback
- pip3 install pygit2 fails on ppc64le and s390x platform HOT 4
- Release a new version HOT 3
- Cannot detach head
- Useless dichotomy between oid and commit HOT 1
- Incorrect pygit2.GIT_CHECKOUT_NOTIFY_IGNORED value assigned (?)
- It's not documented how to use constants HOT 3
- pygit2: How to implement `git clone --single-branch`?
- Repository.notes KeyError when empty
- Can not fetch of HEAD of repository HOT 1
- Segmentation fault at `test_push_options()` HOT 8
- test_binary_diff() fails
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pygit2.