From 3012dfdc9a3a854d182a7f8704579153df51bda2 Mon Sep 17 00:00:00 2001 From: samschott Date: Tue, 22 Nov 2022 01:48:36 +0100 Subject: [PATCH] run linters manually in CI --- .github/workflows/lint.yml | 14 +++++++++++--- .github/workflows/test.yml | 6 +++--- .pre-commit-config.yaml | 24 ------------------------ setup.cfg | 27 +++++++++++++++++++-------- 4 files changed, 33 insertions(+), 38 deletions(-) delete mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 39d5f03e4..7fb8b3ef5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -7,10 +7,18 @@ on: workflow_dispatch: jobs: - pre-commit: + lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4.3.0 - - run: python -m pip install -U .[dev] - - uses: pre-commit/action@v3.0.0 + - run: python -m pip install -U .[lint] + - name: black + run: | + black --check src tests + - name: flake8 + run: | + flake8 src tests + - name: mypy + run: | + mypy src diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e7acc13a0..d4a7baffa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install -U .[dev] + python -m pip install -U .[test] - name: Test with pytest run: | @@ -91,7 +91,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install -U .[dev] + python -m pip install -U .[test] - name: Get short-lived Dropbox token # We generate a short-lived auth token which is passed to the test runner as @@ -164,7 +164,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install -U .[dev] + python -m pip install -U .[test] - name: Get short-lived Dropbox token # We generate a short-lived auth token which is passed to the test runner as diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index 74a1d7b12..000000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,24 +0,0 @@ -repos: -- repo: https://github.com/ambv/black - rev: 22.10.0 - hooks: - - id: black - -- repo: https://github.com/pycqa/flake8 - rev: 5.0.4 - hooks: - - id: flake8 - -- repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.991 - hooks: - - id: mypy - additional_dependencies: - - "types-setuptools" - - "types-requests" - -- repo: https://github.com/asottile/pyupgrade - rev: v3.2.2 - hooks: - - id: pyupgrade - args: [--py37-plus] diff --git a/setup.cfg b/setup.cfg index fa86b5316..e684043c0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -67,19 +67,23 @@ pyinstaller40 = gui = maestral-qt>=1.6.3;sys_platform=='linux' maestral-cocoa>=1.6.3;sys_platform=='darwin' -syslog = systemd-python +syslog = + systemd-python dev = - black + pre-commit bump2version +lint = + black flake8 mypy - pre-commit + pyupgrade + types-pkg_resources + types-requests +test = pytest pytest-benchmark pytest-cov pytest-rerunfailures - types-pkg_resources - types-requests docs = sphinx sphinxext-opengraph @@ -92,7 +96,14 @@ ignore = E203,E501,W503,H306 statistics = True [mypy] -files = src, tests -python_version = 3.7 -warn_redundant_casts = True +python_version = 3.8 ignore_missing_imports = True +disallow_any_generics = True +disallow_untyped_defs = True +disallow_incomplete_defs = True +check_untyped_defs = True +disallow_untyped_decorators = True +warn_redundant_casts = True +no_implicit_reexport = True +strict_equality = True +strict_concatenate = True