Skip to content

Commit

Permalink
Merge branch 'fix/pytest_session_dir' into 'master'
Browse files Browse the repository at this point in the history
ci: apply new fix in pytest-embedded 1.10

See merge request espressif/esp-idf!30660
  • Loading branch information
hfudev committed May 7, 2024
2 parents 01c13a7 + 948fdfc commit 6354a79
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ repos:
name: Check type annotations in python files
entry: tools/ci/check_type_comments.py
additional_dependencies:
- 'mypy==0.940'
- 'mypy-extensions==0.4.3'
- 'types-setuptools==57.4.14'
- 'types-PyYAML==0.1.9'
- 'mypy'
- 'mypy-extensions'
- 'types-setuptools'
- 'types-PyYAML'
- 'types-requests'
exclude: >
(?x)^(
Expand Down
14 changes: 4 additions & 10 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import typing as t
import zipfile
from copy import deepcopy
from datetime import datetime
from urllib.parse import quote

import common_test_methods # noqa: F401
Expand Down Expand Up @@ -56,15 +55,10 @@ def idf_path() -> str:
return os.path.dirname(__file__)


@pytest.fixture(scope='session', autouse=True)
def session_tempdir() -> str:
_tmpdir = os.path.join(
os.path.dirname(__file__),
'pytest_embedded_log',
datetime.now().strftime('%Y-%m-%d_%H-%M-%S'),
)
os.makedirs(_tmpdir, exist_ok=True)
return _tmpdir
@pytest.fixture(scope='session')
def session_root_logdir(idf_path: str) -> str:
"""Session scoped log dir for pytest-embedded"""
return idf_path


@pytest.fixture
Expand Down
3 changes: 1 addition & 2 deletions tools/ci/check_type_comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0

import argparse
import subprocess
from sys import exit
Expand Down Expand Up @@ -30,7 +29,7 @@ def types_valid_ignored_rules(file_name): # type: (str) -> bool
"""
Run Mypy check with rules for ignore list on the given file, return TRUE if Mypy check passes
"""
mypy_exit_code = subprocess.call('mypy {} --allow-untyped-defs'.format(file_name), shell=True)
mypy_exit_code = subprocess.call('mypy {} --python-version 3.8 --allow-untyped-defs'.format(file_name), shell=True)
return not bool(mypy_exit_code)


Expand Down

0 comments on commit 6354a79

Please sign in to comment.