Skip to content

Commit

Permalink
fix: add import message via synth
Browse files Browse the repository at this point in the history
Closes #227.
Closes #228.
Closes #229.
  • Loading branch information
tseaver committed Oct 26, 2020
1 parent c55e421 commit 938c7f0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
3 changes: 2 additions & 1 deletion scripts/fixup_firestore_admin_v1_keywords.py
Expand Up @@ -20,9 +20,10 @@

try:
import libcst as cst
except ImportError as exception:
except ImportError:
raise ImportError('Run `python -m pip install "libcst >= 0.2.5"` to install libcst.')


import pathlib
import sys
from typing import (Any, Callable, Dict, List, Sequence, Tuple)
Expand Down
3 changes: 2 additions & 1 deletion scripts/fixup_firestore_v1_keywords.py
Expand Up @@ -20,9 +20,10 @@

try:
import libcst as cst
except ImportError as exception:
except ImportError:
raise ImportError('Run `python -m pip install "libcst >= 0.2.5"` to install libcst.')


import pathlib
import sys
from typing import (Any, Callable, Dict, List, Sequence, Tuple)
Expand Down
18 changes: 18 additions & 0 deletions synth.py
Expand Up @@ -173,6 +173,24 @@ def lint_setup_py(session):
""""mock", "pytest", "pytest-asyncio", "google-cloud-testutils",""",
)


# Add message for missing 'libcst' dependency
s.replace(
"scripts/fixup*.py",
"""\
import libcst as cst
""",
"""\
try:
import libcst as cst
except ImportError:
raise ImportError('Run `python -m pip install "libcst >= 0.2.5"` to install libcst.')
""",
)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)

s.replace(
Expand Down

0 comments on commit 938c7f0

Please sign in to comment.