Skip to content

Commit

Permalink
fix: use dunamai to calculate dev version numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsteers committed Nov 12, 2024
1 parent 4a0db22 commit 6a141e1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
13 changes: 11 additions & 2 deletions airbyte_cdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
# Imports should also be placed in `if TYPE_CHECKING` blocks if they are only used as type
# hints - again, to avoid circular dependencies.
# Once those issues are resolved, the below can be sorted with isort.
from importlib import metadata
import dunamai as _dunamai

from .destinations import Destination
from .models import AirbyteConnectionStatus, AirbyteMessage, ConfiguredAirbyteCatalog, Status, Type, FailureType, AirbyteStream, AdvancedAuth, DestinationSyncMode, ConnectorSpecification, OAuthConfigSpecification, OrchestratorType, ConfiguredAirbyteStream, SyncMode, AirbyteLogMessage, Level, AirbyteRecordMessage
Expand Down Expand Up @@ -281,4 +281,13 @@
"Source",
"StreamSlice",
]
__version__ = metadata.version("airbyte_cdk")

__version__ = _dunamai.get_version(
"airbyte-cdk",
third_choice=_dunamai.Version.from_any_vcs,
).serialize()
"""Version generated by poetry dynamic versioning during publish.
When running in development, dunamai will calculate a new prerelease version
from existing git release tag info.
"""
16 changes: 15 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ classifiers = [
keywords = ["airbyte", "connector-development-kit", "cdk"]

# Python CDK uses dynamic versioning: https://github.com/mtkennerly/poetry-dynamic-versioning
version = "0.0.0" # Version will be replaced by the version of the release tag during publish.
version = "0.0.0" # Version will be calculated dynamically.

[tool.poetry-dynamic-versioning]
enable = true
Expand All @@ -34,6 +34,7 @@ backoff = "*"
cachetools = "*"
Deprecated = "~1.2"
dpath = "^2.1.6"
dunamai = "^1.22.0"
genson = "1.2.2"
isodate = "~0.6.1"
Jinja2 = "~3.1.2"
Expand Down

0 comments on commit 6a141e1

Please sign in to comment.