diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4c5a68e..06fffc5 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -31,6 +31,8 @@ jobs: - '1.2.0' - '1.2.1' - '1.2.2' + - '1.3.0' + - '1.3.1' steps: - uses: actions/checkout@v3 with: diff --git a/poetry_dynamic_versioning/plugin.py b/poetry_dynamic_versioning/plugin.py index 637cf87..c35c27c 100644 --- a/poetry_dynamic_versioning/plugin.py +++ b/poetry_dynamic_versioning/plugin.py @@ -11,12 +11,19 @@ from cleo.events.console_command_event import ConsoleCommandEvent from cleo.events.event_dispatcher import EventDispatcher from cleo.events.console_events import COMMAND, SIGNAL, TERMINATE, ERROR +from packaging.version import Version as PackagingVersion +from poetry.core import __version__ as poetry_core_version from poetry.core.poetry import Poetry from poetry.core.factory import Factory -from poetry.core.semver.version import Version as PoetryCoreVersion from poetry.console.application import Application from poetry.plugins.application_plugin import ApplicationPlugin +if PackagingVersion(poetry_core_version) >= PackagingVersion("1.3.0"): + from poetry.core.constraints.version import Version as PoetryCoreVersion +else: + from poetry.core.semver.version import Version as PoetryCoreVersion + + from poetry_dynamic_versioning import ( _get_config, _get_and_apply_version,