Commit Graph
30 Commits
Author SHA1 Message Date
Daniel Hahler afb2755c27 Add extras_require=testing 2018-09-22 10:03:12 +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 cdb760487b tests: venv_path: use session scope 2018-09-16 11:24:27 +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
Daniel Hahler 10b61c41f4 Some minor flake8 fixes 2018-07-16 23:41:42 +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]

https://github.com/davidhalter/jedi-vim/blob/08792d3fd742ec9d8cb75fe1e2a799244ee45fe3/pythonx/jedi_vim.py#L492-L493
2018-07-16 13:23:38 +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
Daniel Hahler 08fa7941ce tests: use monkeypatch.setenv 2018-07-12 22:04:25 +02:00
Daniel Hahler 87d7c59c6e subprocess: listen: exit normally with EOFError
This is an expected case, since the parent closed normally, and
therefore the subprocess should exit with 0.
2018-07-11 12:56:55 +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
Daniel Hahler d10eff5625 Travis: report coverage also to codecov.io 2018-05-21 23:40:42 +02:00
Daniel Hahler 6748faa071 Fix _get_numpy_doc_string_cls: use cache
I've noticed that Jedi tries to import numpydoc a lot when using
jedi-vim's goto method in jedi_vim.py itself (via printing in Neovim's
VimPathFinder.find_spec).

This patch uses the cache before trying the import again and again.
2018-05-06 10:54:49 +02:00
Daniel Hahler 3c909a9849 Travis: remove TOXENV=cov from allowed failures 2018-05-02 20:04:46 +02:00
Daniel Hahler b94b45cfa1 Environment._get_version: add msgs with exceptions 2018-05-02 00:09:40 +02:00
Daniel Hahler aa6857d22d check_fs: handle FileNotFoundError
Ref: https://github.com/davidhalter/jedi-vim/pull/801
2018-04-17 23:40:25 +02:00
Daniel Hahler 6bab112bb7 test/completion/imports.py: fix typo in comment 2018-01-25 07:57:43 +01:00
Daniel Hahler adace8d7cb sys_path_with_modifications: append local file
This fixes "goto" preferring a local module instead of a global one.

Fixes https://github.com/davidhalter/jedi/issues/995.
2017-12-19 20:51:20 +01:00
Daniel Hahler e621e8590c Improve IntegrationTestCase.__repr__
Having the path (together with the line only) makes it easy to go to the
actual test.
2017-12-14 22:44:24 +01:00
Daniel Hahler 94dc563d8a tox: use posargs ("jedi test") for py.test command
Without this it would collect tests from other dirs also by default.
2016-11-04 14:31:43 +01:00
Daniel Hahler a4aabc2b65 Improve documentation in test/run.py 2016-11-04 14:28:27 +01:00
Daniel Hahler 78573b8fa2 Fix goto_definitions being invoked on a parent class
When invoking `goto_definitions` on `RequestFactory` in line 5, it would
jump to `Client` after 27f05de:

```python
class RequestFactory(object):
    pass

class Client(RequestFactory):
    pass
```

Fixes https://github.com/davidhalter/jedi/issues/761.
2016-11-04 13:00:23 +01:00
Daniel Hahler a5480c054d parser.utils.clear_cache: clear self.__index
This fixes a potential FileNotFoundError when clearing the cache
manually, using the method from
https://github.com/davidhalter/jedi-vim/pull/625.

Traceback:

```
  File "…/jedi/evaluate/imports.py", line 342, in _do_import
    module = _load_module(self._evaluator, module_path, source, sys_path, parent_module)
  File "…/jedi/evaluate/imports.py", line 457, in _load_module
    cached = load_parser(path)
  File "…/jedi/parser/utils.py", line 72, in load_parser
    return ParserPickling.load_parser(path, p_time)
  File "…/jedi/parser/utils.py", line 126, in load_parser
    with open(self._get_hashed_path(path), 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: '…/.cache/jedi/cpython-35/759d60e96c76f41ffd882d9b8d844899.pkl'
```
2016-10-14 14:25:18 +02:00
Daniel Hahler f7f966805f sys_path: prepend/prefer egg-link files
With `pip install -e` the generated .egg-link file gets preferred over
any normally installed distribution, and `pip uninstall` will first
remove the egg-link before the normal package.
2016-10-14 14:18:09 +02:00
Daniel Hahler 171873761b doc: fix goto_assignments, which can follow imports now 2016-08-13 09:04:57 +02:00
Daniel Hahler 4469e654ae find_module_py33: use str(e) with ValueError
ValueError has no message attribute.

Fixes https://github.com/davidhalter/jedi/issues/584
2015-05-09 23:05:30 +02:00
Daniel Hahler 8621aae73c Add any .egg-link paths from VIRTUAL_ENV to sys.path
Adding test_get_sys_path required factoring out
`_get_venv_sitepackages`, because `sys.version_info` cannot be mocked
apparently.
2015-01-25 21:35:09 +01:00
Daniel Hahler fd2f56f3b6 minor: changelog: formatting 2014-07-25 00:31:17 +02:00
Daniel Hahler 93f6d45e11 minor: changelog: fix typo 2014-07-25 00:30:53 +02:00