The pre-commit hook in calver-init currently assumes that the project is named in a standard project/project structure, so for instance the VERSION file lives under, ojd_daps/ojd_daps/VERSION. This breaks if the repo name differs from the module name (e.g. by using kebab case on the repo side), or indeed if you ever decide to check out a repo under a different name for testing, as you might do when developing multiple feature branches in parallel.
I propose handling this by adding a little python script specifically for poetry-based projects, where the project name can be accessed from pyproject.toml. Something similar may be possible for traditional setup.py projects, but it's a little hairier to pull the name field out of that script... Maybe not in the initial PR. The idea for now is to revert to the current directory-based pattern whenever tool.poetry.name isn't set in the toml.
See also https://github.com/nestauk/data-utils/issues/15
The pre-commit hook in
calver-initcurrently assumes that the project is named in a standardproject/projectstructure, so for instance the VERSION file lives under,ojd_daps/ojd_daps/VERSION. This breaks if the repo name differs from the module name (e.g. by using kebab case on the repo side), or indeed if you ever decide to check out a repo under a different name for testing, as you might do when developing multiple feature branches in parallel.I propose handling this by adding a little python script specifically for
poetry-based projects, where the project name can be accessed frompyproject.toml. Something similar may be possible for traditionalsetup.pyprojects, but it's a little hairier to pull thenamefield out of that script... Maybe not in the initial PR. The idea for now is to revert to the current directory-based pattern whenevertool.poetry.nameisn't set in the toml.See also https://github.com/nestauk/data-utils/issues/15