For example, we currently generate a setup.cfg snippet with:
It would often be convenient to also generate a stub {package}/__init__.py as well. Variable interpolation doesn't happen on the filenames currently.
For this issue, regen.py needs to be updated to apply variable_format to local_path as well. It's currently a Path, not a str, which makes this a little more interesting, and the logic from VARIABLE_RE through the call to variable_format should be extracted out to a function that can be called multiple times. Moving this to a class to make it easier to test is ok too!
Steps to test:
- Create
templates/{package}/__init__.py with some text.
cd /tmp/example
/path/to/skel/regen.py (and answer some questions, say package is "foo")
- Check that
/tmp/example/foo/__init__.py contains the appropriate text
For example, we currently generate a setup.cfg snippet with:
It would often be convenient to also generate a stub
{package}/__init__.pyas well. Variable interpolation doesn't happen on the filenames currently.For this issue,
regen.pyneeds to be updated to applyvariable_formattolocal_pathas well. It's currently a Path, not a str, which makes this a little more interesting, and the logic fromVARIABLE_REthrough the call tovariable_formatshould be extracted out to a function that can be called multiple times. Moving this to a class to make it easier to test is ok too!Steps to test:
templates/{package}/__init__.pywith some text.cd /tmp/example/path/to/skel/regen.py(and answer some questions, say package is "foo")/tmp/example/foo/__init__.pycontains the appropriate text