modm-io / lbuild

lbuild: a generic, modular code generator in Python 3
https://pypi.org/project/lbuild
BSD 2-Clause "Simplified" License
37 stars 12 forks source link

Use pathlib.Path for all paths #36

Open salkinium opened 5 years ago

salkinium commented 5 years ago

At the moment there is a mix of use of both os.path and pathlib.Path which is really annoying to cast around interally.

The goal is to only use pathlib interally and convert all path inputs to pathlib. Do we also want to return pathlib objects instead of strings? cc @dergraaf

salkinium commented 5 years ago

We need to be careful to preserve backwards compatiblity for anything paths we output. pathlib paths don't convert to string in all the usual cases.

salkinium commented 5 years ago

This is actually a difficult thing to implement, since an empty path "" cannot be stored in Path("") -> Path("."). This is particularly an issue for PathOption, which cannot be backwards compatible this way. Returning Path() from repopath() and localpath() is also not backwards compatible.

salkinium commented 5 years ago

Keeping this open for v2