##// END OF EJS Templates
typing: add basic type hints to vfs.py...
typing: add basic type hints to vfs.py Again, there's a lot more that could be done, but this sticks to the obviously correct stuff that is related to primitives or `vfs` objects. Hopefully this helps smoke out more path related bytes vs str issues in TortoiseHg. PyCharm seems smart enough to apply hints from annotated superclass functions, but pytype isn't (according to the *.pyi file generated), so those are annotated too. There was some discussion about changing the default path arg from `None` to `b''` in order to avoid the more verbose `Optional` declarations. This would be more in line with `os.path.join()` (which rejects `None`, but ignores empty strings), and still not change the behavior for callers still passing `None` (because the check is `if path` instead of an explicit check for `None`). But I didn't want to hold this up while discussing that, so this documents what _is_.

File last commit:

r50415:eb02decd default
r50468:cc9a6005 default
Show More
Cargo.toml
51 lines | 1.2 KiB | text/plain | TOMLLexer
[package]
name = "hg-core"
version = "0.1.0"
authors = ["Georges Racinet <gracinet@anybox.fr>"]
description = "Mercurial pure Rust core library, with no assumption on Python bindings (FFI)"
edition = "2018"
[lib]
name = "hg"
[dependencies]
bitflags = "1.3.2"
bytes-cast = "0.2.0"
byteorder = "1.4.3"
derive_more = "0.99.17"
hashbrown = { version = "0.9.1", features = ["rayon"] }
home = "0.5.3"
im-rc = "15.0"
itertools = "0.10.3"
lazy_static = "1.4.0"
libc = "0.2"
ouroboros = "0.15.0"
rand = "0.8.4"
rand_pcg = "0.3.1"
rand_distr = "0.4.3"
rayon = "1.5.1"
regex = "1.5.5"
sha-1 = "0.10.0"
twox-hash = "1.6.2"
same-file = "1.0.6"
tempfile = "3.1.0"
crossbeam-channel = "0.5.0"
micro-timer = "0.4.0"
log = "0.4.8"
memmap2 = { version = "0.5.3", features = ["stable_deref_trait"] }
zstd = "0.5.3"
format-bytes = "0.3.0"
# once_cell 1.15 uses edition 2021, while the heptapod CI
# uses an old version of Cargo that doesn't support it.
once_cell = "=1.14.0"
# We don't use the `miniz-oxide` backend to not change rhg benchmarks and until
# we have a clearer view of which backend is the fastest.
[dependencies.flate2]
version = "1.0.22"
features = ["zlib"]
default-features = false
[dev-dependencies]
clap = "2.34.0"
pretty_assertions = "1.1.0"