Dave Halter
a2108de2c0
Use py__get__ for Django Model.objects
...
This includes the fix in https://github.com/typeddjango/django-stubs/pull/394
2020-06-09 23:26:43 +02:00
Dave Halter
9adcf3d233
Make sure meta class filters can distinguish between classes and instances
2020-06-07 14:54:26 +02:00
Dave Halter
105c097fea
Merge branch 'django-custom-object-manager' of https://github.com/PeterJCLaw/jedi into django
2020-06-06 01:24:24 +02:00
Dave Halter
574b790296
Make it possible to use inheritance on generics without always specifying type vars, see also discussion in #1593
2020-06-06 01:23:14 +02:00
Dave Halter
21a380f7cb
Merge pull request #1590 from muffinmad/references-scope
...
Get references in the current module only
2020-06-05 19:21:34 +02:00
muffinmad
404661f361
Replace Script by timedelta in the test
2020-06-05 17:44:59 +03:00
muffinmad
1e58f9a15c
Test both named params are found
2020-06-05 15:28:22 +03:00
Dave Halter
24236be3ce
Fix a small issue with doctest completions, fixes #1585
2020-06-05 13:35:36 +02:00
muffinmad
8705149619
Use pytest.mark.parametrize
2020-06-03 17:20:23 +03:00
muffinmad
782dedd439
Get references in the current module only
2020-06-03 16:35:28 +03:00
Michał Górny
cecdaa98ae
Exclude more Linux constants in test_import
...
The list of differences have grown again in Python 3.9. Instead of
increasing the allowed count let's filter out more Linux-specific
constants. This probably makes it possible to reduce allowed
len(difference) too.
2020-06-02 23:04:50 +02:00
yuan_xy
32687474db
add test case to fix code example in doc
2020-05-31 11:00:15 +08:00
Peter Law
c62cbd6654
Explicitly handle a not in b operator comparison
...
This avoids a `KeyError` from operator_to_magic_method lookup for
this case. Jedi probably could check for `__contains__` here, however
as it doesn't do so for `in` checks I'm following that lead for now.
Fixes https://github.com/davidhalter/jedi/issues/1594 .
2020-05-23 12:49:53 +01:00
Peter Law
c36904d983
Support custom managers in Django models
...
For the moment this support is limited to just Model.objects
replacements and does not use the custom manager for ForeignKey
related managers.
2020-05-22 12:33:03 +01:00
Peter Law
669b70b2cd
Validate instance methods on Django models
2020-05-22 12:32:14 +01:00
muffinmad
7459d67fee
Test local references in some other cases
2020-05-22 13:24:39 +03:00
muffinmad
741097827d
Get references in the current module only
2020-05-21 19:51:13 +03:00
Peter Law
b7cdec427e
Support OneToOneFields
2020-05-18 22:19:20 +01:00
Peter Law
df66b35444
Support UUIDFields
2020-05-18 22:11:31 +01:00
Peter Law
cd9f2f31ea
Support URLFields
2020-05-18 22:10:48 +01:00
Peter Law
b54d7433c7
Support GenericIPAddressFields
2020-05-18 22:10:09 +01:00
Dave Halter
8fdf16b316
Fix an error of get_definition_end_pos, see #1584
2020-05-18 01:44:51 +02:00
Dave Halter
fa6194c0a9
Refactor test_definition_start_end_position to use parametrize
2020-05-18 01:41:07 +02:00
Dave Halter
2d17b81313
definition_end_position -> get_definition_end_position, same for start, see #1584
2020-05-18 01:18:22 +02:00
Dave Halter
cb1730f628
Merge pull request #1584 from pappasam/get_definition_position
...
Add BaseName.definition_[start,end]_position
2020-05-18 01:14:00 +02:00
Sam Roeca
d848047012
Add unit tests for definition_[start,end]_position
2020-05-17 11:48:28 -04:00
Dave Halter
d16355fcf2
Fix tests in Python 2
2020-05-16 17:47:33 +02:00
Dave Halter
b3fc10a6e4
Magic methods fixes for reverse methods
2020-05-16 15:39:48 +02:00
Dave Halter
0db50b521d
Fix an issue with Tuple generics
2020-05-16 14:55:59 +02:00
Dave Halter
2fb072532a
Skip another non-important Python 2 test that fails on Windows
2020-05-16 01:25:15 +02:00
Dave Halter
384b2ad014
Fix an about dict completions
2020-05-16 00:46:46 +02:00
Dave Halter
41c146a6f3
Implement magic method return values, fixes #1577
2020-05-15 23:53:44 +02:00
Peter Law
43806f8668
Add support for generic optional parameters ( #1559 )
...
* Add support for generic optional parameters
* Tests for passing non-optional arguments to optional parameters
* Remove now-redundant is_class_value handling
This parameter has since been removed from infer_type_vars methods,
much simplifying the code.
2020-05-15 19:56:03 +02:00
Dave Halter
d4aa583e16
Fix inline case where a name was removed without the code being used, fixes #1582
2020-05-14 23:08:37 +02:00
Dave Halter
381fbeda6a
Make the diff nicer if there is no ending newline, fixes #1581
2020-05-14 00:20:20 +02:00
Dave Halter
3104443212
Merge pull request #1579 from muffinmad/pseudotreenameclass
...
Return 'class' as _PseudoTreeNameClass.type (fix #1578 )
2020-05-13 18:59:05 +02:00
muffinmad
16e2b86bcf
Fix test
2020-05-13 01:18:47 +03:00
Dave Halter
0caee73975
Merge pull request #1572 from davidhalter/classvar
...
Remove is_class_value from infer_type_vars
2020-05-12 23:56:03 +02:00
Dave Halter
7f25e28d89
Fix tuple issue in 3.6
2020-05-12 23:33:06 +02:00
muffinmad
7ccee7d8fc
Add test _PseudoTreeNameClass.type == 'class'
2020-05-12 23:28:46 +03:00
Vlad Serebrennikov
e1c0d2c501
Reduce noise in signatures of compiled params ( #1564 )
...
* Remove "typing." prefix from compiled signature param
* Don't print default "None" for Optional params
* Don't remove 'typing.' prefix if symbol doesn't come from typing module
* Revert "Don't print default "None" for Optional params"
This reverts commit 8db334d9bb .
* Make sure "typing." doesn't appear in the middle
* Make sure only "typing." prefix is removed and not it's entries in the middle
* Use inspect.formatannotation() to create an annotation string
* Update AUTHORS.txt
* Add test for compiled param annotation string
* Replace Optional in test with other typing facilities
in order for test to be forward-compatible with 3.9
* Add an empty string fallback for Python 2
* Move _annotation_to_str back to original position
2020-05-10 13:33:36 +02:00
Dave Halter
6dbc5e783e
Fix argument clinic unpacking, remove dynamic bullshit
2020-05-10 13:27:20 +02:00
Dave Halter
bf4ec2282f
Fix getattr completions on very weird cases, fixes #1573
2020-05-10 11:37:58 +02:00
Dave Halter
c2d1da09cb
Make sure that Tuple/Callable instances have the correct py__class__
2020-05-10 01:05:55 +02:00
Dave Halter
25973554e2
Remove the common folder and move it to a common file
2020-05-08 13:23:56 +02:00
Dave Halter
5fcbed721d
Merge pull request #1554 from PeterJCLaw/fix-nested-tuple-argument
...
Fix handling of nested tuple arguments
2020-05-08 12:49:44 +02:00
Dave Halter
d606ea6759
Correct a test
2020-04-27 09:59:38 +02:00
Dave Halter
8c7a883abd
Test that the actual signature of a function is used in Interpreter
2020-04-27 01:47:06 +02:00
Peter Law
17ca3a620f
Merge branch 'master' into fix-nested-tuple-argument
2020-04-26 13:56:14 +01:00
Peter Law
612fd23777
Support accessing the py__class__ of a NewType
...
The test here is a bit contrived, the actual place I found this
was in using a NewType as a type within a NamedTuple. However due
to https://github.com/davidhalter/jedi/issues/1560 that currently
also fails for other reasons. This still feels useful to fix on
its own though.
2020-04-26 00:59:07 +01:00