forked from python-poetry/poetry
-
Notifications
You must be signed in to change notification settings - Fork 0
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
7 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from __future__ import annotations | ||
|
||
import logging | ||
import sys | ||
|
||
from poetry.config.config import Config | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def _is_truststore_available() -> bool: | ||
if sys.version_info < (3, 10): | ||
logger.debug("Disabling truststore because Python version isn't 3.10+") | ||
return False | ||
|
||
try: | ||
import ssl # noqa: F401 | ||
except ImportError: | ||
logger.warning("Disabling truststore since ssl support is missing") | ||
return False | ||
|
||
try: | ||
import truststore # noqa: F401 | ||
except ImportError: | ||
logger.warning("Disabling truststore because `truststore` package is missing`") | ||
return False | ||
return True | ||
|
||
|
||
def is_truststore_enabled() -> bool: | ||
return Config.create().get("system-truststore") and _is_truststore_available() |
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