Skip to content

Commit

Permalink
Fix mypy fails understanding FileLock
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
  • Loading branch information
gaborbernat committed Dec 5, 2022
1 parent efa8911 commit 122144a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-ast
- id: check-builtin-literals
Expand All @@ -12,7 +12,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/asottile/pyupgrade
rev: v3.2.2
rev: v3.3.0
hooks:
- id: pyupgrade
args: [ "--py36-plus" ]
Expand Down Expand Up @@ -44,7 +44,7 @@ repos:
- id: tox-ini-fmt
args: [ "-p", "fix_lint" ]
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
Expand All @@ -53,5 +53,5 @@ repos:
- flake8-pytest-style==1.6
- flake8-spellcheck==0.28
- flake8-unused-arguments==0.0.12
- flake8-noqa==1.2.9
- flake8-noqa==1.3
- pep8-naming==0.13.2
2 changes: 1 addition & 1 deletion pyproject.toml
@@ -1,6 +1,6 @@
[build-system]
requires = [
"setuptools>=65.5",
"setuptools>=65.6.3",
"setuptools_scm>=7.0.5",
]
build-backend = 'setuptools.build_meta'
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Expand Up @@ -38,9 +38,9 @@ where = src
docs =
furo>=2022.9.29
sphinx>=5.3
sphinx-autodoc-typehints>=1.19.4
sphinx-autodoc-typehints>=1.19.5
testing =
covdefaults>=2.2
covdefaults>=2.2.2
coverage>=6.5
pytest>=7.2
pytest-cov>=4
Expand Down
6 changes: 5 additions & 1 deletion src/filelock/__init__.py
Expand Up @@ -9,6 +9,7 @@

import sys
import warnings
from typing import TYPE_CHECKING

from ._api import AcquireReturnProxy, BaseFileLock
from ._error import Timeout
Expand All @@ -33,7 +34,10 @@

#: Alias for the lock, which should be used for the current platform. On Windows, this is an alias for
# :class:`WindowsFileLock`, on Unix for :class:`UnixFileLock` and otherwise for :class:`SoftFileLock`.
FileLock: type[BaseFileLock] = _FileLock
if TYPE_CHECKING:
FileLock = SoftFileLock
else:
FileLock = _FileLock


__all__ = [
Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Expand Up @@ -50,7 +50,7 @@ description = run type check on code base
setenv =
{tty:MYPY_FORCE_COLOR = 1}
deps =
mypy==0.982
mypy==0.991
commands =
mypy --strict src/filelock
mypy --strict tests
Expand All @@ -63,9 +63,9 @@ setenv =
COVERAGE_FILE = {toxworkdir}/.coverage
skip_install = true
deps =
covdefaults>=2.2
covdefaults>=2.2.2
coverage>=6.5
diff-cover>=7.0.1
diff-cover>=7.2
extras =
parallel_show_output = true
commands =
Expand Down Expand Up @@ -95,7 +95,7 @@ description = check that the long description is valid (need for PyPI)
skip_install = true
deps =
build[virtualenv]>=0.9
twine>=4.0.1
twine>=4.0.2
extras =
commands =
pyproject-build -o {envtmpdir} --wheel --sdist .
Expand Down

0 comments on commit 122144a

Please sign in to comment.