Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: partly move settings from setup.cfg to pyproject.toml #1053

Merged
merged 2 commits into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Empty file modified src/watchdog/events.py
100755 → 100644
Empty file.
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
Empty file modified src/watchdog/watchmedo.py
100755 → 100644
Empty file.
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
Loading