Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add import message via synth #231

Merged
merged 3 commits into from Oct 26, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
190 changes: 0 additions & 190 deletions scripts/fixup_admin_v1_keywords.py

This file was deleted.

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