-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
40 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,33 @@ | ||
from typing import Any, Mapping | ||
from typing import Any, Mapping, Optional, List | ||
|
||
from coveo_stew.metadata.poetry_api import dependencies_factory | ||
from coveo_styles.styles import echo | ||
|
||
|
||
class StewPackage: | ||
"""Represents the coveo-specific sections of a pyproject.toml file.""" | ||
"""Represents the stew-specific sections of a pyproject.toml file.""" | ||
|
||
def __init__( | ||
self, | ||
*, | ||
build: bool = False, | ||
build: bool = False, # deprecated | ||
build_without_hashes: bool = False, | ||
pydev: bool = False, | ||
build_dependencies: Mapping[str, Any] = None, | ||
build_dependencies: Optional[Mapping[str, Any]] = None, | ||
extras: Optional[List[str]] = None, | ||
all_extras: bool = False, | ||
) -> None: | ||
self.build = build # we won't build a project unless this is specified. | ||
# poetry sometimes fail at getting hashes, in which case the export cannot work because pip will complain | ||
# that some files have a hash and some don't. This fixes it. | ||
self.build_without_hashes = build_without_hashes | ||
self.pydev = pydev # is this a one-ring-to-bind-them-all dev environment? | ||
# additional build-time dependencies | ||
self.build_dependencies = dependencies_factory(build_dependencies) | ||
self.extras = extras | ||
self.all_extras = all_extras | ||
|
||
if extras and all_extras: | ||
echo.suggest( | ||
"Both 'extras' and 'all_extras' are specified. 'extras' will be ignored; " | ||
"consider removing it from your pyproject.toml." | ||
) |
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