forked from cookiecutter/cookiecutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Why?
KimSia Sim edited this page May 24, 2024
·
2 revisions
The impetus is to create a cookiecutter that's usable as a python binary using a tool like PyInstaller.
Unfortunately, there are two ways the current cookiecutter (as of 2024-05-24 Friday, version 2.6.0) cannot be used directly in a python binary.
from pathlib import Path
def _get_version() -> str:
"""Read VERSION.txt and return its contents."""
path = Path(__file__).parent.resolve()
version_file = path / "VERSION.txt"
return version_file.read_text(encoding="utf-8").strip()The use of Path will break when in a binary.
https://github.com/cookiecutter/cookiecutter/pull/2071