Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfacee4c

Browse files
tseaverparthea
andauthored
chore: drop mention of Python 2.7 from templates (#1173)
Install async test dependencies unconditionally.Drop unused 'samples' session. Samples are tested via separate noxfiles in all repos which have them.Closes#1118.Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parentff01716 commitfacee4c

File tree

5 files changed

+9
-33
lines changed

5 files changed

+9
-33
lines changed

‎synthtool/gcp/common.py‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,17 +225,9 @@ def py_library(self, **kwargs) -> Path:
225225
kwargs["default_python_version"]="3.8"
226226
if"unit_test_python_versions"notinkwargs:
227227
kwargs["unit_test_python_versions"]= ["3.6","3.7","3.8","3.9"]
228-
if"microgenerator"notinkwargs:
229-
kwargs["unit_test_python_versions"]= ["2.7"]+kwargs[
230-
"unit_test_python_versions"
231-
]
232228

233229
if"system_test_python_versions"notinkwargs:
234230
kwargs["system_test_python_versions"]= ["3.8"]
235-
if"microgenerator"notinkwargs:
236-
kwargs["system_test_python_versions"]= ["2.7"]+kwargs[
237-
"system_test_python_versions"
238-
]
239231

240232
# If cov_level is not given, set it to None.
241233
if"cov_level"notinkwargs:

‎synthtool/gcp/templates/python_library/noxfile.py.j2‎

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,8 @@ def default(session):
8787
constraints_path = str(
8888
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
8989
)
90-
{%-ifmicrogenerator%}
91-
session.install("asyncmock", "pytest-asyncio", "-c", constraints_path)
92-
{%endif%}
93-
session.install("mock", "pytest", "pytest-cov",{%fordinunit_test_external_dependencies%}"{{d}}",{%endfor%} "-c", constraints_path)
90+
session.install("mock", "asyncmock", "pytest", "pytest-cov", "pytest-asyncio", "-c", constraints_path)
91+
{%fordinunit_test_external_dependencies%}session.install("{{d}}", "-c", constraints_path){%endfor%}
9492
{%fordependencyinunit_test_local_dependencies%}session.install("-e", "{{dependency}}", "-c", constraints_path)
9593
{%endfor%}
9694
{%fordependencyinunit_test_dependencies%}session.install("-e", "{{dependency}}", "-c", constraints_path){%endfor%}
@@ -192,20 +190,6 @@ def system(session):
192190
*session.posargs
193191
)
194192

195-
{%ifsamples_test%}
196-
@nox.session(python=["2.7", "3.7"])
197-
def samples(session):
198-
requirements_path = os.path.join("samples", "requirements.txt")
199-
requirements_exists = os.path.exists(requirements_path)
200-
201-
session.install("mock", "pytest")
202-
if requirements_exists:
203-
session.install("-r", requirements_path)
204-
session.install("-e", ".")
205-
206-
session.run("py.test", "--quiet", "samples", *session.posargs)
207-
{%endif%}
208-
209193
@nox.session(python=DEFAULT_PYTHON_VERSION)
210194
def cover(session):
211195
"""Run the final coverage report.

‎synthtool/gcp/templates/python_library/scripts/readme-gen/templates/install_deps.tmpl.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Install Dependencies
1212
.. _Python Development Environment Setup Guide:
1313
https://cloud.google.com/python/setup
1414

15-
#. Create a virtualenv. Samples are compatible with Python2.7 and 3.4+.
15+
#. Create a virtualenv. Samples are compatible with Python3.6+.
1616

1717
..code-block::bash
1818

‎synthtool/gcp/templates/python_samples/noxfile.py.j2‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ BLACK_VERSION = "black==19.10b0"
3939

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

4444
# Old samples are opted out of enforcing Python type hints
4545
# All new samples should feature them
@@ -88,8 +88,8 @@ def get_pytest_env_vars() -> Dict[str, str]:
8888

8989

9090
# DO NOT EDIT - automatically generated.
91-
# All versions used totested samples.
92-
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"]
91+
# All versions used totest samples.
92+
ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9"]
9393

9494
# Any default versions that should be ignored.
9595
IGNORED_VERSIONS = TEST_CONFIG['ignored_versions']

‎synthtool/languages/python.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
importre
1616
importsys
1717
frompathlibimportPath
18-
fromtypingimportAny,Dict
18+
fromtypingimportAny,Dict,List
1919

2020
importyaml
2121

@@ -45,8 +45,8 @@
4545
# See the License for the specific language governing permissions and
4646
# limitations under the License."""
4747

48-
SAMPLES_VERSIONS= ["2.7","3.6","3.7","3.8"]
49-
IGNORED_VERSIONS= ["2.7"]
48+
SAMPLES_VERSIONS= ["3.6","3.7","3.8"]
49+
IGNORED_VERSIONS:List[str]= []
5050

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp