pypa / pyproject-hooks

A low-level library for calling build-backends in `pyproject.toml`-based project
https://pyproject-hooks.readthedocs.io/
MIT License
122 stars 49 forks source link

typing: allow PathLike objects in addition to strs #181

Open gotmax23 opened 11 months ago

gotmax23 commented 11 months ago

Some projects use pathlib or other libraries to encapsulate file system paths instead of working with strs (or bytes) directly. These classes implement the os.PathLike interface which the functions in os.path support in addition to strs.

This changes all functions that accept paths to accept PathLike objects in addition to strings. The way the backend_path attribute is set in BuildBackendHookCaller.__init__() was also modified so the typing was correct.

Follow-up-to: https://github.com/pypa/pyproject-hooks/pull/167