(
filename: Path, binary: bool = False, **opts: str
)
| 85 | |
| 86 | # TODO: use literals & overload (typing extensions or Python 3.8) |
| 87 | def get_and_replace( |
| 88 | filename: Path, binary: bool = False, **opts: str |
| 89 | ) -> Union[bytes, str]: |
| 90 | if binary: |
| 91 | contents = filename.read_bytes() |
| 92 | return string.Template(contents.decode()).substitute(opts).encode() |
| 93 | |
| 94 | return string.Template(filename.read_text()).substitute(opts) |
| 95 | |
| 96 | |
| 97 | # Use our input files instead when making the SDist (and anything that depends |
no test coverage detected