Skip to content

Commit ad30c52

Browse files
committed
Add pyright
1 parent f77d1bf commit ad30c52

4 files changed

Lines changed: 18 additions & 7 deletions

File tree

.github/workflows/tests.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
name: CI
22

33
on:
4-
push:
54
pull_request:
5+
branches:
6+
- master
7+
push:
8+
branches:
9+
- master
610

711
jobs:
812
test:
@@ -37,7 +41,7 @@ jobs:
3741
python-version: 3.12
3842

3943
- name: Install dependencies for lint
40-
run: pip install .[test]
44+
run: pip install .[lint]
4145

4246
- name: Run make lint
4347
run: make lint

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
lint:
22
isort --check-only --diff .
33
flake8 .
4+
pyright .
45

56
test:
67
pytest -v

setup.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
description='Werkzeug encrypted cookie',
1313
packages=['werkzeug_encryptedcookie'],
1414
platforms='any',
15-
install_requires=['pycryptodome>=3.11.0', 'secure-cookie', 'brotli>=1.0.1'],
15+
install_requires=[
16+
'pycryptodome>=3.11.0',
17+
'secure-cookie',
18+
'brotli>=1.0.1',
19+
'Werkzeug>=2.0.0,<2.1.0',
20+
],
1621
classifiers=[
1722
'Programming Language :: Python',
1823
'Programming Language :: Python :: 3',
@@ -21,7 +26,8 @@
2126
'Topic :: Software Development :: Libraries :: Python Modules'
2227
],
2328
extras_require={
24-
'test': ['pytest', 'isort', 'flake8'],
29+
'test': ['pytest'],
30+
'lint': ['isort', 'flake8', 'pyright'],
2531
},
2632
test_suite='test',
2733
)

tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,14 @@ def test_compression_and_decompression(self):
119119
class TestSecureEncryptedCookie(TestEncryptedCookie):
120120
Cookie = SecureEncryptedCookie
121121

122-
class RawCookie(Cookie):
122+
class RawCookie(Cookie): # pyright: ignore[reportIncompatibleVariableOverride]
123123
quote_base64 = False
124124

125-
class NoCompressCookie(Cookie):
125+
class NoCompressCookie(Cookie): # pyright: ignore[reportIncompatibleVariableOverride]
126126
compress_cookie = False
127127

128128
# Explicit setup for tests
129-
class CompressCookie(Cookie):
129+
class CompressCookie(Cookie): # pyright: ignore[reportIncompatibleVariableOverride]
130130
compress_cookie = True
131131

132132
def test_unsigned(self):

0 commit comments

Comments
 (0)