Skip to content

Commit

Permalink
Fix the check for extra dependencies required by certain providers (#…
Browse files Browse the repository at this point in the history
…1568)

* Fix the regex so that it returns just the package name

Signed-off-by: Avi Miller <me@dje.li>

* Use the correct PyPi package name for Lexicon

Signed-off-by: Avi Miller <me@dje.li>

---------

Signed-off-by: Avi Miller <me@dje.li>
  • Loading branch information
Djelibeybi committed Jun 11, 2023
1 parent 44eb33c commit 19366be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lexicon/client.py
Expand Up @@ -115,7 +115,7 @@ def _validate_config(self) -> None:
if not available:
raise ProviderNotAvailableError(
f"This provider ({provider_name}) has required extra dependencies that are missing. "
f"Please run `pip install lexicon[{provider_name}]` first before using it."
f"Please run `pip install dns-lexicon[{provider_name}]` first before using it."
)

if not self.config.resolve("lexicon:action"):
Expand Down
2 changes: 1 addition & 1 deletion lexicon/discovery.py
Expand Up @@ -50,7 +50,7 @@ def _resolve_requirements(provider: str, distribution: Distribution) -> bool:
raise ValueError("Error while trying finding requirements.")

requirements = [
re.sub(r"^(.*)\s\(.*\)(?:;.*|)$", r"\1", requirement)
re.sub(r"^(.*)\s\(.*\)(?:\s*;.*|)$", r"\1", requirement)
for requirement in requires
if f'extra == "{provider}"' in requirement
]
Expand Down

0 comments on commit 19366be

Please sign in to comment.