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