Skip to content

Commit

Permalink
drop support for older Poetry versions
Browse files Browse the repository at this point in the history
  • Loading branch information
radoering committed Feb 16, 2025
1 parent a4f278c commit 020c90e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 22 deletions.
2 changes: 1 addition & 1 deletion poetry.lock

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

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = [{ name = "Sébastien Eustace", email = "[email protected]" }]
license = { text = "MIT" }
readme = "README.md"
requires-python = ">=3.9,<4.0"
dependencies = ["poetry>=1.5.0,<3.0.0"]
dependencies = ["poetry>=2.1.0,<3.0.0"]
dynamic = ["classifiers"]

[project.entry-points."poetry.application.plugin"]
Expand Down
16 changes: 2 additions & 14 deletions src/poetry_plugin_bundle/bundlers/venv_bundler.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,7 @@ def bundle(self, poetry: Poetry, io: IO) -> bool:

from cleo.io.null_io import NullIO
from poetry.core.masonry.builders.wheel import WheelBuilder

try:
from poetry.core.masonry.utils.module import ModuleOrPackageNotFoundError
except ImportError:
# poetry-core < 2.0
from poetry.core.masonry.utils.module import ( # type: ignore[attr-defined, no-redef]
ModuleOrPackageNotFound as ModuleOrPackageNotFoundError,
)
from poetry.core.masonry.utils.module import ModuleOrPackageNotFoundError
from poetry.core.packages.package import Package
from poetry.installation.installer import Installer
from poetry.installation.operations.install import Install
Expand Down Expand Up @@ -150,12 +143,7 @@ def locked_repository(self) -> LockfileRepository:
package.develop = False
return repo

try:
locker_data = poetry.locker._pyproject_data
except AttributeError:
# poetry < 2.0
locker_data = poetry.locker._local_config # type: ignore[attr-defined]
custom_locker = CustomLocker(poetry.locker.lock, locker_data)
custom_locker = CustomLocker(poetry.locker.lock, poetry.locker._pyproject_data)

installer = Installer(
NullIO() if not io.is_debug() else io,
Expand Down
7 changes: 1 addition & 6 deletions tests/console/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@ def poetry(project_directory: str, config: Config) -> Poetry:
p = Factory().create_poetry(
Path(__file__).parent.parent / "fixtures" / project_directory
)
try:
locker_data = p.locker._pyproject_data
except AttributeError:
# poetry < 2.0
locker_data = p.locker._local_config # type: ignore[attr-defined]
p.set_locker(TestLocker(p.locker.lock, locker_data))
p.set_locker(TestLocker(p.locker.lock, p.locker._pyproject_data))

return p

Expand Down

0 comments on commit 020c90e

Please sign in to comment.