Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions cycode/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1 @@
__version__ = '0.0.0' # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag

if __version__ == '0.0.1.dev1':
# If CLI was installed from shallow clone, __version__ will be 0.0.1.dev1 due to non-strict versioning.
# This happens when installing CLI as pre-commit hook.
# We are not able to provide the version based on Git Tag in this case.
# This fallback version is maintained manually.

# One benefit of it is that we could pass the version with a special suffix to mark pre-commit hook usage.

import os

version_filepath = os.path.join(os.path.dirname(__file__), 'pre-commit-hook-version')
with open(version_filepath, 'r', encoding='UTF-8') as f:
__version__ = f.read().strip()
1 change: 0 additions & 1 deletion cycode/pre-commit-hook-version

This file was deleted.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ log_cli = true
[tool.poetry-dynamic-versioning]
# poetry self add "poetry-dynamic-versioning[plugin]"
enable = true
strict = false
strict = true
bump = true
metadata = false
fix-shallow-repository=true
vcs = "git"
style = "pep440"

Expand Down Expand Up @@ -134,5 +135,5 @@ inline-quotes = "single"
"cycode/*.py" = ["BLE001"]

[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=0.25.0"]
build-backend = "poetry_dynamic_versioning.backend"