diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4c5a68e..17e9cf4 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -27,10 +27,13 @@ jobs: - '3.8' - '3.9' - '3.10' + - '3.11' poetry-version: - '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..5ee9f95 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).release >= (1, 3): + 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,