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

chore: drop mention of Python 2.7 from templates #1173

Merged
merged 8 commits into from
Aug 13, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions synthtool/gcp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,17 +225,9 @@ def py_library(self, **kwargs) -> Path:
kwargs["default_python_version"] = "3.8"
if "unit_test_python_versions" not in kwargs:
kwargs["unit_test_python_versions"] = ["3.6", "3.7", "3.8", "3.9"]
if "microgenerator" not in kwargs:
tseaver marked this conversation as resolved.
Show resolved Hide resolved
kwargs["unit_test_python_versions"] = ["2.7"] + kwargs[
"unit_test_python_versions"
]

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

# If cov_level is not given, set it to None.
if "cov_level" not in kwargs:
Expand Down
2 changes: 1 addition & 1 deletion synthtool/gcp/templates/python_library/noxfile.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def system(session):
)

{% if samples_test %}
tseaver marked this conversation as resolved.
Show resolved Hide resolved
@nox.session(python=["2.7", "3.7"])
@nox.session(python=["3.7"])
def samples(session):
requirements_path = os.path.join("samples", "requirements.txt")
requirements_exists = os.path.exists(requirements_path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Install Dependencies
.. _Python Development Environment Setup Guide:
https://cloud.google.com/python/setup

#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+.
#. Create a virtualenv. Samples are compatible with Python 3.6+.

.. code-block:: bash

Expand Down
4 changes: 2 additions & 2 deletions synthtool/gcp/templates/python_samples/noxfile.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ BLACK_VERSION = "black==19.10b0"

TEST_CONFIG = {
# You can opt out from the test for specific Python versions.
'ignored_versions': ["2.7"],
'ignored_versions': [],

# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
Expand Down Expand Up @@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]:

# DO NOT EDIT - automatically generated.
# All versions used to tested samples.
tseaver marked this conversation as resolved.
Show resolved Hide resolved
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"]
ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9"]

# Any default versions that should be ignored.
IGNORED_VERSIONS = TEST_CONFIG['ignored_versions']
Expand Down
6 changes: 3 additions & 3 deletions synthtool/languages/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import re
import sys
from pathlib import Path
from typing import Any, Dict
from typing import Any, Dict, List

import yaml

Expand Down Expand Up @@ -45,8 +45,8 @@
# See the License for the specific language governing permissions and
# limitations under the License."""

SAMPLES_VERSIONS = ["2.7", "3.6", "3.7", "3.8"]
IGNORED_VERSIONS = ["2.7"]
SAMPLES_VERSIONS = ["3.6", "3.7", "3.8"]
IGNORED_VERSIONS: List[str] = []

SAMPLES_TEMPLATE_PATH = Path(CommonTemplates()._template_root) / "python_samples"

Expand Down