-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor code to support multiple project type
- Loading branch information
Showing
16 changed files
with
539 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from __future__ import annotations | ||
|
||
from abc import ABC | ||
from abc import abstractmethod | ||
from typing import TYPE_CHECKING | ||
from typing import Any | ||
|
||
|
||
if TYPE_CHECKING: | ||
from pathlib import Path | ||
|
||
from poetry.core.packages.project_package import ProjectPackage | ||
from poetry.core.pyproject.formats.validation_result import ValidationResult | ||
|
||
|
||
class ContentFormat(ABC): | ||
def __init__(self, content: dict[str, Any]) -> None: | ||
self._content = content | ||
|
||
@classmethod | ||
@abstractmethod | ||
def supports(cls, content: dict[str, Any]) -> bool: | ||
... | ||
|
||
@abstractmethod | ||
def validate(self, strict: bool = False) -> ValidationResult: | ||
... | ||
|
||
@abstractmethod | ||
def to_package(self, root: Path, with_groups: bool = True) -> ProjectPackage: | ||
... | ||
|
||
@property | ||
@abstractmethod | ||
def hash_content(self) -> dict[str, Any]: | ||
... | ||
|
||
@property | ||
@abstractmethod | ||
def poetry_config(self) -> dict[str, Any]: | ||
""" | ||
The custom poetry configuration (i.e. the parts in [tool.poetry] that are not related to the package) | ||
""" | ||
... |
Oops, something went wrong.