NINAnor / python-template

1 stars 0 forks source link

Custom rules for Django migrations apply to non-Django project #15

Open frafra opened 1 month ago

frafra commented 1 month ago

https://github.com/NINAnor/python-template/blob/6c8cebe5d4b316c7b74c6192d5454b2de166c77c/pyproject.toml#L9

This code is in the main pyproject.toml file, shared across templates. There is no comment explaining what it is for, but I assume that is for Django project only, right?

nicokant commented 1 month ago

No, actually it's for the template itself. It contains some migrations file that needs to be ignored/treated differently when running pre-commit

frafra commented 1 month ago

This ends up in the generated project, even if it should not, right? Is there any kind of technical limitation that prevents us from doing that?

nicokant commented 1 month ago

Yes, we use include to avoid copy-paste, but you cannot include just a part of a regular file

frafra commented 1 month ago

So this is a technical limitation of how copier as a whole works, and the only solution seems to copy-and-paste snippets of codes, which increases the burden on the maintainers of the template. I value more generating a correct project for the users of the template than making things more complicated for the maintainers of the template.

Is there any open discussion about this in the copier community?