Skip to content

Commit

Permalink
fix: add import message via synth (#231)
Browse files Browse the repository at this point in the history
Also, drop fossil script (created with old name).

Closes #227.
Closes #228.
Closes #229.
  • Loading branch information
tseaver committed Oct 26, 2020
1 parent 2df1e61 commit 5fb02e9
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 193 deletions.
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
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -81,7 +81,7 @@
python_requires=">=3.6",
scripts=[
"scripts/fixup_firestore_v1_keywords.py",
"scripts/fixup_admin_v1_keywords.py",
"scripts/fixup_firestore_admin_v1_keywords.py",
],
include_package_data=True,
zip_safe=False,
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 5fb02e9

Please sign in to comment.