commit - a107e66a92bfcb253e3bd002d87c33927b126d39
commit + a42dd27a39722aa850842cfefad75ba15d2f5730
blob - 2fc0c2979b814029ff6f71f90065aa944cd71ccc
blob + 8dbb1fa20714b6caaae5bc094fb58261d742e49b
--- CONTRIBUTING.rst
+++ CONTRIBUTING.rst
-All functionality should be available in pure Python. Optional C
+All functionality should be available in pure Python. Optional Rust
implementations may be written for performance reasons, but should never
-replace the Python implementation. The C implementations should follow the
-kernel/git coding style.
+replace the Python implementation.
Where possible include updates to NEWS along with your improvements.
blob - 926141ec7155bb82c74d682f1eb1e6cb71b2c78d
blob + 2abb9de16227bc1ebc030c7ecc0503ac4938030b
--- README.rst
+++ README.rst
Installation
------------
-By default, Dulwich' setup.py will attempt to build and install the optional C
+By default, Dulwich' setup.py will attempt to build and install the optional Rust
extensions. The reason for this is that they significantly improve the performance
since some low-level operations that are executed often are much slower in CPython.
blob - d2fd817f88027cd9c96bd7f8e026784cf85d2c83
blob + e5c04260cf10ed610fbf7f0cd6e0a6925b4c378f
--- docs/performance.txt
+++ docs/performance.txt
Places for improvement, ordered by difficulty / effectiveness:
-* read_zlib() should have a C equivalent (~ 4% overhead atm)
+* read_zlib() should have a Rust equivalent (~ 4% overhead atm)
* unpack_object() should have a C equivalent
blob - 61dae810d378fc0c2f1fc530fb60b8c82c675c88
blob + 58b3cadebb283d765494edf4f3523577de485b4a
--- dulwich/client.py
+++ dulwich/client.py
"""Git Client that just uses a local on-disk repository."""
def __init__(
- self, thin_packs=True, report_activity=None, config: Optional[Config] = None
+ self,
+ thin_packs: bool = True,
+ report_activity=None,
+ config: Optional[Config] = None,
) -> None:
"""Create a new LocalGitClient instance.
blob - aada776d6239309fa009b4ada5dfdf453289483b
blob + eeec9d48ddd89b5ccde8d4bed038590f2f69586a
--- dulwich/diff_tree.py
+++ dulwich/diff_tree.py
_merge_entries_py = _merge_entries
_count_blocks_py = _count_blocks
try:
- # Try to import C versions
+ # Try to import Rust versions
from dulwich._diff_tree import ( # type: ignore
_count_blocks,
_is_tree,
blob - 27c24013803e7a09146c6f060f43769e36d21bbb
blob + 04e392508e73f6ba9c69b70206d8e4b030314dd7
--- dulwich/objects.py
+++ dulwich/objects.py
key_func = key_entry
for name, entry in sorted(entries.items(), key=key_func):
mode, hexsha = entry
- # Stricter type checks than normal to mirror checks in the C version.
+ # Stricter type checks than normal to mirror checks in the Rust version.
mode = int(mode)
if not isinstance(hexsha, bytes):
raise TypeError(f"Expected bytes for SHA, got {hexsha!r}")
_parse_tree_py = parse_tree
_sorted_tree_items_py = sorted_tree_items
try:
- # Try to import C versions
+ # Try to import Rust versions
from dulwich._objects import parse_tree, sorted_tree_items # type: ignore
except ImportError:
pass
blob - 0d907f1e1b9529f39144093d2d8e354aae42278e
blob + 8c6d18f5f2a31fea5682244f90281a0373b5b5ff
--- tests/test_objects.py
+++ tests/test_objects.py
# C/Python implementations may differ in specific error types, but
# should all error on invalid inputs.
- # For example, the C implementation has stricter type checks, so may
+ # For example, the Rust implementation has stricter type checks, so may
# raise TypeError where the Python implementation raises
# AttributeError.
errors = (TypeError, ValueError, AttributeError)