Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Nov 5, 2023
1 parent 63a1291 commit 8979eae
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Run Linters
run: |
hatch run typing:test
hatch run lint:style
hatch run lint:build
pipx run interrogate .
pipx run doc8 --max-line-length=200
Expand Down
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,24 @@ repos:
- id: codespell
args: ["-L", "sur,nd"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.6.1"
hooks:
- id: mypy
files: "^jupyter_events"
stages: [manual]
args: ["--install-types", "--non-interactive"]
additional_dependencies:
[
"traitlets>=5.13",
"jupyter_core>=5.4",
"pyyaml",
"python-json-logger",
"pytest>=7",
"click",
"rich",
]

- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.10.0"
hooks:
Expand Down
2 changes: 1 addition & 1 deletion jupyter_events/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def add_listener(
if modified:
self._modified_listeners[id_].add(listener)
else:
self._unmodified_listeners[schema_id].add(listener)
self._unmodified_listeners[id_].add(listener)

def remove_listener(
self,
Expand Down
2 changes: 1 addition & 1 deletion jupyter_events/traits.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ def validate(self, obj: t.Any, value: t.Any) -> t.Any:
self.validate_elements(obj, value)
return value
else:
self.error(obj, value) # type:ignore[no-untyped-call]
self.error(obj, value)
30 changes: 11 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,33 +92,25 @@ dependencies = ["coverage[toml]", "pytest-cov"]
test = "python -m pytest -vv --cov jupyter_events --cov-branch --cov-report term-missing:skip-covered {args}"
nowarn = "test -W default {args}"

[tool.hatch.envs.typing]
features = ["test"]
dependencies = ["mypy~=1.6", "traitlets>=5.11.1", "jupyter_core>=5.4"]
[tool.hatch.envs.typing.scripts]
test = "mypy --install-types --non-interactive {args}"

[tool.hatch.envs.lint]
dependencies = ["mdformat>0.7", "ruff==0.1.3"]
detached = true
dependencies = ["pre-commit"]
[tool.hatch.envs.lint.scripts]
style = [
"ruff {args:.}",
"ruff format {args:.}",
"mdformat --check {args:docs *.md}"
]
fmt = [
"ruff --fix {args:.}",
"ruff format {args:.}",
"mdformat {args:docs *.md}"
]
build = "pre-commit run --all-files ruff"

[tool.hatch.envs.typing]
dependencies = [ "pre-commit"]
detached = true
[tool.hatch.envs.typing.scripts]
test = "pre-commit run --all-files --hook-stage manual mypy"


[tool.pytest.ini_options]
minversion = "6.0"
xfail_strict = true
log_cli_level = "info"
addopts = [
"-raXs", "--durations=10", "--color=yes", "--doctest-modules",
"-ra", "--durations=10", "--color=yes", "--doctest-modules",
"--showlocals", "--strict-markers", "--strict-config"
]
testpaths = [
Expand Down Expand Up @@ -214,4 +206,4 @@ fail-under=100
exclude = ["docs", "tests"]

[tool.repo-review]
ignore = ["PY007", "PP308", "GH102", "PC140"]
ignore = ["PY007", "GH102"]

0 comments on commit 8979eae

Please sign in to comment.