Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Address deprecation warning when importing poetry.core.semver #106

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
2 changes: 2 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
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) >= 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,
Expand Down