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

Update typeguard to 3.x #327

Merged
merged 1 commit into from
Mar 17, 2023
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning][semver].
## [Unreleased]
### Added
### Changed
- Update typeguard to 3.x ([#327])

### Fixed

- Data files are no longer placed inside the wrong `site-packages` folder when installing `pygls` ([#232])
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [Denis Loginov](https://github.com/dinvlad)
- [Dillan Mills](https://github.com/DillanCMills)
- [Felicián Németh](https://github.com/nemethf)
- [Felix Yan](https://github.com/felixonmars)
- [Jérome Perrin](https://github.com/perrinjerome)
- [Karthik Nadig](https://github.com/karthiknadig)
- [Laurence Warne](https://github.com/LaurenceWarne)
Expand Down
2 changes: 1 addition & 1 deletion pygls/lsp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def get_method_return_type(method_name, lsp_methods_map=METHOD_TO_TYPES):

def is_instance(o, t):
try:
check_type('', o, t)
check_type(o, t)
return True
except TypeError:
return False
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ packages = find:
zip_safe = False
install_requires =
lsprotocol
typeguard>=2.10.0,<3
typeguard>=3,<4
include_package_data = True
tests_require =
mock==4.0.3
Expand Down
8 changes: 5 additions & 3 deletions tests/test_feature_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
)
from pygls.feature_manager import has_ls_param_or_annotation, wrap_with_server
from lsprotocol import types
from typeguard import TypeCheckError
from typeguard._utils import qualified_name


def test_has_ls_param_or_annotation():
Expand Down Expand Up @@ -92,10 +94,10 @@ class Options:
pass

with pytest.raises(
TypeError,
TypeCheckError,
match=(
f'Options of method "{types.TEXT_DOCUMENT_COMPLETION}" should be instance of type '
"<class 'lsprotocol.types.CompletionOptions'>"
f'{qualified_name(Options)} is not an instance of '
"lsprotocol.types.CompletionOptions"
), # noqa
):

Expand Down