Skip to content

calver-init: add support for projects that diverge from project_name/project_name directory structure #111

@jooh

Description

@jooh

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions