Skip to content

Commit

Permalink
feat(python): add defaults for microgenerator libraries (#642)
Browse files Browse the repository at this point in the history
  • Loading branch information
busunkim96 authored Jun 23, 2020
1 parent 4f2c9f7 commit db4f15f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 12 additions & 3 deletions synthtool/gcp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,20 @@ def py_library(self, **kwargs) -> Path:

# Set default Python versions for noxfile.py
if "default_python_version" not in kwargs:
kwargs["default_python_version"] = "3.7"
kwargs["default_python_version"] = "3.8"
if "unit_test_python_versions" not in kwargs:
kwargs["unit_test_python_versions"] = ["2.7", "3.5", "3.6", "3.7", "3.8"]
kwargs["unit_test_python_versions"] = ["3.6", "3.7", "3.8"]
if "microgenerator" not in kwargs:
kwargs["unit_test_python_versions"] = ["2.7", "3.5"] + kwargs[
"unit_test_python_versions"
]

if "system_test_python_versions" not in kwargs:
kwargs["system_test_python_versions"] = ["2.7", "3.7"]
kwargs["system_test_python_versions"] = ["3.8"]
if "microgenerator" not in kwargs:
kwargs["system_test_python_versions"] = ["2.7"] + kwargs[
"system_test_python_versions"
]

# Don't add samples templates if there are no samples
if "samples" not in kwargs:
Expand Down
4 changes: 4 additions & 0 deletions synthtool/gcp/templates/python_library/noxfile.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ def lint_setup_py(session):

def default(session):
# Install all test dependencies, then install this package in-place.

{%- if microgenerator %}
session.install("asyncmock", "pytest-asyncio")
{% endif -%}
session.install("mock", "pytest", "pytest-cov")
session.install("-e", "."){% for dependency in unit_test_dependencies %}
session.install("-e", "{{dependency}}"){% endfor %}
Expand Down

0 comments on commit db4f15f

Please sign in to comment.