diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index 3ab1761508..d4799c4def 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -16,6 +16,9 @@ concurrency: permissions: contents: read +env: + LINTING_PYTHON_VERSION: 3.8 + jobs: mypy: runs-on: ubuntu-latest @@ -26,7 +29,7 @@ jobs: persist-credentials: false - uses: actions/setup-python@v5 with: - python-version: 3.7 + python-version: ${{ env.LINTING_PYTHON_VERSION }} cache: 'pip' cache-dependency-path: 'setup.py' - name: Install with type-checking tools, stubs & minimal test libraries @@ -43,7 +46,7 @@ jobs: persist-credentials: false - uses: actions/setup-python@v5 with: - python-version: 3.7 + python-version: ${{ env.LINTING_PYTHON_VERSION }} cache: 'pip' cache-dependency-path: 'setup.py' - name: Install with linting tools @@ -60,7 +63,7 @@ jobs: persist-credentials: false - uses: actions/setup-python@v5 with: - python-version: 3.7 + python-version: ${{ env.LINTING_PYTHON_VERSION }} cache: 'pip' cache-dependency-path: 'setup.py' - name: Install with linting tools & minimal test libraries @@ -78,7 +81,7 @@ jobs: persist-credentials: false - uses: actions/setup-python@v5 with: - python-version: 3.7 + python-version: ${{ env.LINTING_PYTHON_VERSION }} cache: 'pip' cache-dependency-path: 'setup.py' - name: Install with linting tools @@ -95,7 +98,7 @@ jobs: persist-credentials: false - uses: actions/setup-python@v5 with: - python-version: 3.7 + python-version: ${{ env.LINTING_PYTHON_VERSION }} cache: 'pip' cache-dependency-path: 'setup.py' - name: Install with linting tools @@ -112,7 +115,7 @@ jobs: persist-credentials: false - uses: actions/setup-python@v5 with: - python-version: 3.7 + python-version: ${{ env.LINTING_PYTHON_VERSION }} cache: 'pip' cache-dependency-path: 'setup.py' - name: Minimal install @@ -129,7 +132,7 @@ jobs: persist-credentials: false - uses: actions/setup-python@v5 with: - python-version: 3.7 + python-version: ${{ env.LINTING_PYTHON_VERSION }} cache: 'pip' cache-dependency-path: 'setup.py' - name: Minimal install @@ -154,7 +157,7 @@ jobs: - uses: actions/setup-python@v5 if: github.event_name == 'pull_request' with: - python-version: 3.7 + python-version: ${{ env.LINTING_PYTHON_VERSION }} cache: 'pip' cache-dependency-path: 'setup.py' - name: Install with gitlint @@ -215,7 +218,7 @@ jobs: - uses: actions/setup-python@v5 if: github.event_name == 'pull_request' with: - python-version: 3.7 + python-version: ${{ env.LINTING_PYTHON_VERSION }} cache: 'pip' cache-dependency-path: 'setup.py' - name: Run check-branch diff --git a/pyproject.toml b/pyproject.toml index a2920b838d..f01695735c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,7 +90,8 @@ warn_unused_ignores = true warn_return_any = false no_implicit_reexport = true # NOTE: Disabled explicitly for tests/ in run-mypy strict_equality = true -strict_concatenate = true + +extra_checks = true enable_error_code = [ "redundant-expr", diff --git a/setup.py b/setup.py index 1862573293..168f33dd33 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ def long_description(): typing_deps = [ "lxml-stubs", - "mypy~=1.3.0", + "mypy~=1.8.0", "types-beautifulsoup4", "types-pygments", "types-python-dateutil", @@ -98,7 +98,7 @@ def long_description(): extras_require={ "dev": testing_deps + linting_deps + typing_deps + helper_deps + gitlint_deps, "testing": testing_deps, - "testing_minimal": testing_minimal_deps, + "testing-minimal": testing_minimal_deps, # extra must be hyphenated "linting": linting_deps, "gitlint": gitlint_deps, "typing": typing_deps, diff --git a/tools/convert-unicode-emoji-data b/tools/convert-unicode-emoji-data index 74acc1e685..2e7b307520 100755 --- a/tools/convert-unicode-emoji-data +++ b/tools/convert-unicode-emoji-data @@ -8,7 +8,7 @@ from pathlib import Path, PurePath try: # Ignored for type-checking, as it is a temporary file, deleted at the end of file - from zulipterminal.unicode_emoji_dict import ( # type: ignore [import] + from zulipterminal.unicode_emoji_dict import ( # type: ignore [import-not-found,import-untyped,unused-ignore] EMOJI_NAME_MAPS, ) except ModuleNotFoundError: diff --git a/zulipterminal/cli/run.py b/zulipterminal/cli/run.py index a3ccd9d18e..46d13e8992 100755 --- a/zulipterminal/cli/run.py +++ b/zulipterminal/cli/run.py @@ -513,11 +513,11 @@ def main(options: Optional[List[str]] = None) -> None: ) # Validate remaining settings - for setting, valid_values in valid_remaining_settings.items(): - if zterm[setting].value not in valid_values: + for setting, valid_remaining_values in valid_remaining_settings.items(): + if zterm[setting].value not in valid_remaining_values: helper_text = ( ["Valid values are:"] - + [f" {option}" for option in valid_values] + + [f" {option}" for option in valid_remaining_values] + [f"Specify the {setting} option in zuliprc file."] ) exit_with_error( @@ -563,8 +563,8 @@ def print_setting(setting: str, data: SettingData, suffix: str = "") -> None: # Translate valid strings for boolean values into True/False boolean_settings: Dict[str, bool] = dict() - for setting, valid_values in VALID_BOOLEAN_SETTINGS.items(): - boolean_settings[setting] = zterm[setting].value == valid_values[0] + for setting, valid_boolean_values in VALID_BOOLEAN_SETTINGS.items(): + boolean_settings[setting] = zterm[setting].value == valid_boolean_values[0] Controller( config_file=zuliprc_path,