Skip to content

Commit

Permalink
fix: Address deprecation warning when importing poetry.core.semver
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Dec 22, 2022
1 parent 910413f commit 94b9237
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 8 additions & 1 deletion poetry_dynamic_versioning/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 94b9237

Please sign in to comment.