Skip to content

Commit fd925ec

Browse files
committed
clean up
1 parent a02de40 commit fd925ec

File tree

5 files changed

+49
-11
lines changed

5 files changed

+49
-11
lines changed

.github/workflows/test.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
os: [ubuntu-latest, windows-latest, macos-latest]
18-
python-version: [3.7, 3.8, 3.9, 3.10-dev, pypy-3.7]
18+
python-version: [3.7, 3.8, 3.9, 3.10, pypy-3.7]
1919
exclude:
2020
# pywin32 not available
2121
- os: windows-latest
22-
python-version: 3.10-dev
22+
python-version: 3.10
2323
steps:
2424
- uses: actions/checkout@v2
2525
- name: Set up Python ${{ matrix.python-version }}
@@ -51,3 +51,23 @@ jobs:
5151
run: |
5252
pip install check-manifest
5353
check-manifest -v
54+
55+
pre-commit:
56+
name: pre-commit
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v2
60+
- uses: actions/setup-python@v2
61+
- uses: pre-commit/[email protected]
62+
with:
63+
extra_args: --all-files --hook-stage=manual
64+
- name: Help message if pre-commit fail
65+
if: ${{ failure() }}
66+
run: |
67+
echo "You can install pre-commit hooks to automatically run formatting"
68+
echo "on each commit with:"
69+
echo " pre-commit install"
70+
echo "or you can run by hand on staged files with"
71+
echo " pre-commit run"
72+
echo "or after-the-fact on already committed files with"
73+
echo " pre-commit run --all-files --hook-stage=manual"

.pre-commit-config.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
ci:
2-
skip: [check-jsonschema]
3-
41
repos:
52
- repo: https://github.com/pre-commit/pre-commit-hooks
63
rev: v4.1.0
@@ -47,6 +44,7 @@ repos:
4744
hooks:
4845
- id: doc8
4946
args: [--max-line-length=200]
47+
stages: [manual]
5048

5149
- repo: https://github.com/pycqa/flake8
5250
rev: 4.0.1
@@ -58,11 +56,16 @@ repos:
5856
"flake8-logging-format==0.6.0",
5957
"flake8-implicit-str-concat==0.2.0",
6058
]
59+
stages: [manual]
60+
6161

6262
- repo: https://github.com/pre-commit/mirrors-mypy
6363
rev: v0.942
6464
hooks:
6565
- id: mypy
66+
args: ["--config-file", "pyproject.toml"]
67+
stages: [manual]
68+
additional_dependencies: [pytest]
6669
exclude: |
6770
exclude: |
6871
(?x)^(
@@ -78,3 +81,4 @@ repos:
7881
files: ^\.github/workflows/
7982
types: [yaml]
8083
args: ["--schemafile", "https://json.schemastore.org/github-workflow"]
84+
stages: [manual]

jupyter_core/paths.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,12 +430,12 @@ def win32_restrict_file_to_user(fname):
430430
The path to the file to secure
431431
"""
432432
try:
433-
import win32api
433+
import win32api # type:ignore[import]
434434
except ImportError:
435435
return _win32_restrict_file_to_user_ctypes(fname)
436436

437-
import ntsecuritycon as con
438-
import win32security
437+
import ntsecuritycon as con # type:ignore[import]
438+
import win32security # type:ignore[import]
439439

440440
# everyone, _domain, _type = win32security.LookupAccountName("", "Everyone")
441441
admins = win32security.CreateWellKnownSid(win32security.WinBuiltinAdministratorsSid)

pyproject.toml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,26 @@ build-backend = "setuptools.build_meta"
44

55
[tool.mypy]
66
check_untyped_defs = true
7+
disallow_any_generics = false
78
disallow_incomplete_defs = true
9+
disallow_untyped_decorators = true
810
no_implicit_optional = true
11+
no_implicit_reexport = false
912
pretty = true
1013
show_error_context = true
1114
show_error_codes = true
1215
strict_equality = true
16+
strict_optional = true
1317
warn_unused_configs = true
14-
warn_unused_ignores = true
1518
warn_redundant_casts = true
19+
warn_return_any = false
20+
warn_unused_ignores = true
21+
22+
[[tool.mypy.overrides]]
23+
module = [
24+
"traitlets.*",
25+
"jupyter_core.*",
26+
"ipykernel",
27+
"entrypoints"
28+
]
29+
ignore_missing_imports = true

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# Distributed under the terms of the Modified BSD License.
55
import sys
66

7-
from setuptools import setup
8-
from setuptools.command.bdist_egg import bdist_egg
7+
from setuptools import setup # type:ignore[import]
8+
from setuptools.command.bdist_egg import bdist_egg # type:ignore[import]
99

1010

1111
class bdist_egg_disabled(bdist_egg):

0 commit comments

Comments
 (0)