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

feat(python): add defaults for microgenerator libraries #642

Merged
merged 5 commits into from
Jun 23, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions synthtool/gcp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,14 @@ def py_library(self, **kwargs) -> Path:
if "default_python_version" not in kwargs:
kwargs["default_python_version"] = "3.7"
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.7"]
plamut marked this conversation as resolved.
Show resolved Hide resolved
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