Skip to content

Commit 8f9847a

Browse files
committed
fix: support packaging with poetry 2.0
1 parent f14900d commit 8f9847a

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Fixed
6+
7+
- Support packaging with poetry 2.0
8+
39
# v0.15.0 (2024-12-13)
410

511
### Added

edsnlp/package.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,17 @@ def validate(cls, value, config=None):
8686
POETRY_SNIPPET = """\
8787
from poetry.core.masonry.builders.sdist import SdistBuilder
8888
from poetry.factory import Factory
89-
from poetry.core.masonry.utils.module import ModuleOrPackageNotFound
89+
try:
90+
from poetry.core.masonry.utils.module import ModuleOrPackageNotFound
91+
except ImportError:
92+
from poetry.core.masonry.utils.module import ModuleOrPackageNotFoundError as ModuleOrPackageNotFound
9093
import sys
9194
# Initialize the Poetry object for the current project
9295
poetry = Factory().create_poetry("__root_dir__")
9396
9497
# Initialize the builder
9598
try:
96-
builder = SdistBuilder(poetry, None, None)
99+
builder = SdistBuilder(poetry)
97100
# Get the list of files to include
98101
files = builder.find_files_to_add()
99102
except ModuleOrPackageNotFound:
@@ -114,7 +117,7 @@ def validate(cls, value, config=None):
114117
# Print the list of files
115118
for file in files:
116119
print(file.path)
117-
"""
120+
""" # noqa E501
118121

119122
INIT_PY = """
120123
# -----------------------------------------

0 commit comments

Comments
 (0)