Dave Halter
75a02a13d9
Use ContextSet closer to they way how Python's set works
2018-09-24 20:30:57 +02:00
Dave Halter
ef9d0421fa
Merge remote-tracking branch 'origin/master' into typeshed
2018-09-24 00:16:13 +02:00
Dave Halter
cc493866cd
Try to introduce is_instance and is_function
2018-09-24 00:15:16 +02:00
Daniel Hahler
56bd795100
_get_virtual_env_from_var: use safe=False
...
Without this creating an env from VIRTUAL_ENV will always silently fail
if it is not the same/current environment.
2018-09-16 11:37:22 +02:00
Daniel Hahler
fc9a55b042
jedi/api/environment.py: minor flake8 fix
2018-09-16 11:22:02 +02:00
Daniel Hahler
1cf5b194ca
jedi.api.environment._SUPPORTED_PYTHONS: add 3.7
...
The grammar is available in parso already, and it works in general.
2018-09-15 16:58:07 +02:00
Dave Halter
39162de2a8
Some more minor adaptions
2018-09-05 01:49:19 +02:00
Dave Halter
4a3fc91c1e
Implement StubParserTreeFilter.values
2018-09-05 01:36:12 +02:00
Dave Halter
ab872b9a34
Fix some tests
2018-09-05 00:10:25 +02:00
Dave Halter
6036ea60d1
Fix interpreter issues with modules
2018-09-04 01:02:00 +02:00
Dave Halter
e3203ebaa5
Try to change the module cache
2018-09-02 13:06:36 +02:00
Dave Halter
2dfe2de0fe
Fix some stub tests
2018-08-31 01:26:20 +02:00
Dave Halter
511ba5231a
Get an own class for type aliases
2018-08-29 22:46:28 +02:00
Dave Halter
481e6bcff0
Don't create a FunctionExecutionContext if it's not used.
2018-08-03 00:25:25 +02:00
Dave Halter
4b276bae87
The import resolution for namespace packages was wrong
...
With this change we can now include all parents of the script, which will make
relative imports always work.
Now the whole meta_path is scanned and not just importlib's PathFinder.
Fixes #1183 .
2018-07-21 00:16:10 +02:00
Daniel Hahler
08b0b668a6
Script.__repr__: include environment
2018-07-16 13:26:10 +02:00
Daniel Hahler
72a8ceed76
Add params to CallSignature.__repr__
...
Looks like this for `jedi.Script` then:
> <CallSignature: Script index=0 params=[source=None, line=None, column=None, path=None, encoding='utf-8', sys_path=None, environment=None]>
`_params_str` could be made public, and then could be used in jedi-vim,
which currently has this:
params = [p.description.replace('\n', '').replace('param ', '', 1)
for p in signature.params]
08792d3fd7/pythonx/jedi_vim.py (L492-L493)
2018-07-16 13:23:38 +02:00
Dave Halter
1e796fc08d
Environments are now always created on request
...
The issue was that if something changed about the environment (e.g. version
switch) or sys.path change, re-creating the environment was possible, but did
not involve the change. The environments have now a __del__ function that
deletes the subprocess after every time an Environment is garbage collected.
2018-07-15 17:49:17 +02:00
Daniel Hahler
2fc91ceb64
Improve Environment
...
It only takes `executable` and gets all the information from the
subprocess directly.
Fixes https://github.com/davidhalter/jedi/issues/1107 .
2018-07-15 17:49:17 +02:00
Dave Halter
71cea7200b
Don't use invalid escape sequences in regex, see https://github.com/davidhalter/jedi-vim/issues/843
2018-07-12 21:13:26 +02:00
Daniel Hahler
f3c1f4c548
Script: improve ValueError for column
...
Ref: https://github.com/davidhalter/jedi/issues/1168
2018-07-11 12:55:18 +02:00
Dave Halter
cef769ecd8
The encoding parameter should be used again (includes test), fixes #1167
2018-07-09 18:25:28 +02:00
Dave Halter
aa4dcc1631
Remove source_encoding from documentation (see #1167 )
2018-07-09 18:12:27 +02:00
Dave Halter
a59e5a016f
Actually use the fast_parser setting again
2018-07-05 21:31:03 +02:00
Dave Halter
d8c0d8e5d2
Different _load_module API
2018-07-05 10:15:49 +02:00
Dave Halter
a12d62e9c9
Don't mutate the sys.path. This is pretty nasty bug that fixes #1148
2018-07-04 08:40:05 +02:00
Dave Halter
2500112f6c
Don't follow builtin imports anymore by default when follow_imports is on (goto)
2018-07-04 00:01:03 +02:00
Dave Halter
80831d79c2
additional_module_paths in usages never actually worked
2018-07-03 22:54:47 +02:00
Dave Halter
d857668292
Add include_builtins to usages, fixes #1131 .
2018-07-03 22:53:19 +02:00
Dave Halter
8ffdf6746f
Comprehensions are also possible arguments. Fixes 1146
2018-07-01 03:33:24 +02:00
Dave Halter
68974aee58
Don't use internal parso APIs if possible
2018-06-29 10:04:03 +02:00
Dave Halter
c208d37ac4
Remove code that is no longer used, because parso was refactored.
2018-06-29 09:56:56 +02:00
Dave Halter
38474061cf
Make jedi work with the next parso release
2018-06-29 09:54:57 +02:00
micbou
282c6a2ba1
Use highest possible pickle protocol
2018-06-23 14:45:34 +02:00
micbou
70c2fce9c2
Replace distutils.spawn.find_executable with shutil.which
...
The distutils.spawn.find_executable function is not available on stock system
Python 3 in recent Debian-based distributions. Since shutil.which is a better
alternative but not available on Python 2.7, we include a copy of that function
and use it in place of find_executable.
2018-06-07 21:07:22 +02:00
Dave Halter
5dab97a303
Add an error message, see also #1139 .
2018-06-07 21:01:41 +02:00
Daniel Hahler
b94b45cfa1
Environment._get_version: add msgs with exceptions
2018-05-02 00:09:40 +02:00
Dave Halter
ba96c21f83
Follow up from the last async issue, fixes more related things about #1092 .
2018-04-24 01:02:31 +02:00
micbou
5f37d08761
Extend create_environment to accept an executable path
...
Assume environments specified by the user are safe.
2018-04-19 21:36:44 +02:00
Dave Halter
a21d77e8ad
There's really no bin/activate needed for an environment to work
2018-04-15 16:15:20 +02:00
Dave Halter
ed2a0a8218
Document get_sys_path and change the signature of get_system_environment a bit
2018-04-15 16:12:07 +02:00
Dave Halter
22b0c0f1fe
Rework the time cache.
2018-04-15 15:51:16 +02:00
Dave Halter
a972d49e88
Cache default environment
2018-04-15 15:28:05 +02:00
Dave Halter
d2f9e83b25
Fix some references
2018-04-15 12:55:33 +02:00
Dave Halter
bb979a040d
Adda lot of environment documentation to sphinx
2018-04-15 11:25:46 +02:00
Dave Halter
336087fcf8
find_python_environments -> find_system_environments
2018-04-14 15:46:16 +02:00
Dave Halter
45fb770033
A small refactoring
2018-04-14 15:38:32 +02:00
Dave Halter
9f07e7e352
Remove from_executable, were not really using it, yet.
2018-04-14 15:13:02 +02:00
Dave Halter
737154d657
Remove an unnecessary else
2018-04-14 01:47:17 +02:00
Dave Halter
fac773a60d
The SameEnvironment should not load by default if it's a portable
...
find_python_environments should only find Python versions if they are actually installed on the system. If people copy virtualenvs around etc. it will find nothing instead.
2018-04-13 21:53:06 +02:00