Skip to content

Commit

Permalink
fix: support packaging with poetry 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
percevalw committed Jan 21, 2025
1 parent f14900d commit 8f9847a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Fixed

- Support packaging with poetry 2.0

# v0.15.0 (2024-12-13)

### Added
Expand Down
9 changes: 6 additions & 3 deletions edsnlp/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,17 @@ def validate(cls, value, config=None):
POETRY_SNIPPET = """\
from poetry.core.masonry.builders.sdist import SdistBuilder
from poetry.factory import Factory
from poetry.core.masonry.utils.module import ModuleOrPackageNotFound
try:
from poetry.core.masonry.utils.module import ModuleOrPackageNotFound
except ImportError:
from poetry.core.masonry.utils.module import ModuleOrPackageNotFoundError as ModuleOrPackageNotFound
import sys
# Initialize the Poetry object for the current project
poetry = Factory().create_poetry("__root_dir__")
# Initialize the builder
try:
builder = SdistBuilder(poetry, None, None)
builder = SdistBuilder(poetry)
# Get the list of files to include
files = builder.find_files_to_add()
except ModuleOrPackageNotFound:
Expand All @@ -114,7 +117,7 @@ def validate(cls, value, config=None):
# Print the list of files
for file in files:
print(file.path)
"""
""" # noqa E501

INIT_PY = """
# -----------------------------------------
Expand Down

0 comments on commit 8f9847a

Please sign in to comment.