1
0
forked from VimPlug/jedi
Commit Graph

53 Commits

Author SHA1 Message Date
Dave Halter
862f611829 If the VIRTUAL_ENV variable changes, need to reload the default environment, fixes #1201, #1200 2018-09-30 19:07:48 +02:00
Dave Halter
f9cbc65f2d Return SameEnvironment as a default, fixes #1226, #1196 2018-09-30 14:07:37 +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
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
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
Daniel Hahler
b94b45cfa1 Environment._get_version: add msgs with exceptions 2018-05-02 00:09:40 +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
Dave Halter
8af4fc5728 Do binary comparisons to get virtualenvs working and not just venvs 2018-04-13 21:45:07 +02:00
Dave Halter
83d635cbac Add a way to generalize Popen 2018-04-13 10:17:30 +02:00
Dave Halter
81623c6b5d Check the windows environments in a better way 2018-04-12 14:26:17 +02:00
Dave Halter
27419be56d Fix some issues with the latest changes 2018-04-12 14:24:18 +02:00
Dave Halter
b8e879bc53 DefaultEnvironment -> SameEnvironment 2018-04-12 09:00:19 +02:00
Dave Halter
f4317dadc4 Better docs for Environment 2018-04-12 08:59:18 +02:00
Dave Halter
bf0169480d Some docstrings 2018-04-12 08:58:06 +02:00
Dave Halter
5bb3b8c122 Make the Environment clearly non-public 2018-04-12 08:56:07 +02:00
Dave Halter
9ac7182fea Make some names public 2018-04-12 08:52:24 +02:00
Dave Halter
93a28c4230 Make sure Windows environments are safe 2018-04-12 08:50:31 +02:00
micbou
903bdf5fef Fix virtual environment tests 2018-04-10 09:19:12 +02:00
Dave Halter
519f54321e Merge the environment changes for Windows 2018-04-09 01:43:57 +02:00
Dave Halter
f4c14864a5 Better tests for venvs 2018-04-09 01:28:43 +02:00
micbou
b3b6b798ff Find Python environments on Windows using the registry 2018-04-08 19:04:11 +02:00
Dave Halter
af956d70a3 Make a few modifications to always use the latest environment available. 2018-04-04 09:53:23 +02:00
micbou
2283b67836 Specify executable extension to detect virtual environment on Windows 2018-03-22 23:17:23 +01:00
ggilmore
3c9aa9ef25 fix set.append syntax error 2018-03-03 10:37:56 +01:00
Dave Halter
6e24c120cf A few documentation improvements 2018-02-27 18:06:47 +01:00
Dave Halter
33c9d21e35 Use Scripts for virtualenvs instead of bin for windows
Thanks @blueyed for the hint.
2018-01-25 19:55:10 +01:00
Dave Halter
4e4f75c882 evaluate.project doesn't exist anymore. Eliminated code that used it 2018-01-17 19:11:20 +01:00
Dave Halter
2a0e8f91d3 A possible introduction for projects 2018-01-15 23:57:08 +01:00
Dave Halter
999fb35914 Check for safe and unsafe environments when searching for them 2018-01-11 08:59:39 +01:00
Dave Halter
9c5ce5a8d2 Try to use the virtual env that was defined in the VIRTUAL_ENV variable, if possible. 2018-01-02 01:28:02 +01:00
Dave Halter
d93b613fd9 Move the default environment around 2018-01-01 20:37:50 +01:00
Dave Halter
e2629b680f Test if virtualenvs and pth files work 2017-12-30 00:02:14 +01:00
Dave Halter
456ae20aac Start using the new virtualenv code
There used to be a lot of code to kind of understand virtualenvs. This can all be removed now, because this is done in a subprocess with the correct interpreter
2017-12-19 21:05:04 +01:00
Dave Halter
96a67f9a4c Start using the correct parser for each environment 2017-12-19 19:19:35 +01:00
Dave Halter
a9ebd92c20 Add a way to specify environments in tox 2017-12-19 19:02:57 +01:00