Skip to content

Commit

Permalink
chore: partly move settings from setup.cfg to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
BoboTiG committed Jul 28, 2024
1 parent 654707e commit 7cd723a
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 30 deletions.
17 changes: 0 additions & 17 deletions mypy.ini

This file was deleted.

30 changes: 30 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,33 @@ safe = true

[tool.isort]
profile = "black"

[tool.mypy]
# Ensure we know what we do
warn_redundant_casts = true
warn_unused_ignores = true
warn_unused_configs = true

# Imports management
ignore_missing_imports = true
follow_imports = "skip"

# Ensure full coverage
#disallow_untyped_defs = true [TODO]
disallow_incomplete_defs = true
#disallow_untyped_calls = true [TODO]

# Restrict dynamic typing (a little)
# e.g. `x: List[Any]` or x: List`
# disallow_any_generics = true

strict_equality = true

[tool.pytest.ini_options]
pythonpath = "src"
addopts = """
--showlocals
-vvv
--cov=watchdog
--cov-report=term-missing:skip-covered
"""
7 changes: 0 additions & 7 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,3 @@ max-line-length = 120
[upload_sphinx]
# Requires sphinx-pypi-upload to work.
upload-dir = docs/build/html

[tool:pytest]
addopts =
--showlocals
-v
--cov=watchdog
--cov-report=term-missing
4 changes: 2 additions & 2 deletions src/watchdog/observers/fsevents.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import time
import unicodedata

import _watchdog_fsevents as _fsevents # type: ignore[import-not-found]
import _watchdog_fsevents as _fsevents

from watchdog.events import (
DirCreatedEvent,
Expand Down Expand Up @@ -164,7 +164,7 @@ def _is_meta_mod(event):
"""Returns True if the event indicates a change in metadata."""
return event.is_inode_meta_mod or event.is_xattr_mod or event.is_owner_change

def queue_events(self, timeout, events): # type: ignore[override]
def queue_events(self, timeout, events):
if logger.getEffectiveLevel() <= logging.DEBUG:
for event in events:
flags = ", ".join(attr for attr in dir(event) if getattr(event, attr) is True)
Expand Down
4 changes: 2 additions & 2 deletions src/watchdog/observers/fsevents2.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
from typing import List, Optional, Type

# pyobjc
import AppKit # type: ignore[import-not-found]
from FSEvents import ( # type: ignore[import-not-found]
import AppKit
from FSEvents import (
CFRunLoopGetCurrent,
CFRunLoopRun,
CFRunLoopStop,
Expand Down
2 changes: 1 addition & 1 deletion src/watchdog/tricks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def _restart_process(self):
if not platform.is_windows():

def kill_process(pid, stop_signal):
os.killpg(os.getpgid(pid), stop_signal) # type: ignore[attr-defined]
os.killpg(os.getpgid(pid), stop_signal)

else:

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ deps =
-r requirements-tests.txt
commands =
# "--platform win32" to not fail on ctypes.windll (it does not affect the overall check on other OSes)
mypy --platform win32
mypy --platform win32 src

[testenv:isort]
usedevelop = true
Expand Down

0 comments on commit 7cd723a

Please sign in to comment.