Dave Halter
a5dff65142
Evaluator -> InferState
2019-08-15 00:37:51 +02:00
Dave Halter
3b4f292464
Move the evaluate package to inference
2019-08-15 00:14:26 +02:00
Dave Halter
4619552589
Evaluation -> type inference
2019-08-13 01:29:50 +02:00
Dave Halter
48b1b9a1aa
Make sure that 3.8 is a supported Python environment going forward (and remove 3.3)
2019-06-08 02:11:45 +02:00
Dave Halter
05eb06d91b
Merge remote-tracking branch 'origin/master' into typeshed
2019-04-13 01:52:15 +02:00
mlangkabel
c801e24afc
fix get_system_environment misses if same python version has multiple installs
...
The Environment.__init__ may throw an InvalidPythonEnvironment if the call to _get_subprocess() fails. In this case other registered Python environments of the same Python version may still work and shall also be considered.
2019-04-09 23:01:37 +02:00
Dave Halter
31442ecb3b
Merge branch 'master' into typeshed
2019-04-09 22:58:30 +02:00
Nikhil Mitra
8d0c4d3cec
Resolve path in get_cached_default_environment() in api/environment.py to
...
prevent unnecessary cache busting when using pipenv.
2019-04-05 15:21:46 +02:00
Dave Halter
2f1ce2bbf9
Some test fixes
2019-03-28 19:23:55 +01:00
Stanislav Grozev
6031971028
Use expanded paths when looking for virtualenv root
...
This fixes virtualenv resolution under macOS and Pipenv.
2019-03-08 01:22:21 +01:00
Dave Halter
9bb8f335c9
A small improvement for environments
...
see comment in 8d313e014f
2019-02-22 01:04:01 +01:00
Dave Halter
8d313e014f
Check for specific Python versions first on unix, see davidhalter/jedi-vim#870
2019-02-22 00:34:03 +01:00
Dave Halter
a79d386eba
Cleanup SameEnvironment and use the same logic for creation in virtualenvs
2019-02-22 00:24:55 +01:00
Dave Halter
b4a4dacebd
Fix embedded Python with Jedi (see comments in source code), fixes davidhalter/jedi-vim#870
2019-02-21 10:19:28 +01:00
Bet4
76417cc3c1
Fix environment cache regression ( #1238 )
...
The only remaining issue with this PR is that it does compare with executable instead of _start_executable (they don't need to be the same).
2018-12-15 18:37:28 +01:00
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