Skip to content

Commit

Permalink
Merge pull request #20 from rohanpm/set-path
Browse files Browse the repository at this point in the history
Force version path rather than relying on autodetect
  • Loading branch information
rohanpm authored Oct 3, 2024
2 parents f797e2c + b48a448 commit ec9bbb5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ dependencies = { file = "requirements.in" }
[tool.isort]
profile = "black"

[tool.buildsys-dateversion]
version-path = "src/buildsys_dateversion/__init__.py"

[build-system]
requires = []
backend-path = ["src"]
Expand Down
4 changes: 4 additions & 0 deletions src/buildsys_dateversion/_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ def _find_version_path(self) -> str:
if not file.endswith(".py"):
continue

# TODO: revisit handling of multiple matches:
# - assume shortest path is the best?
# - give fatal error?
# - update all of them?
path = os.path.join(dirpath, file)
LOG.debug("Checking file %s", path)
if VERSION_PATTERN.search(open(path).read()):
Expand Down

0 comments on commit ec9bbb5

Please sign in to comment.