- Extract PyVersionSpecifiers from Poetry-specific PoetryPythonVersion
into python-community-openapi for reuse across subsystems
- Add PyVersionSpecifiers parameter to PythonInstallerService.installLatestPython()
so installation respects pyproject.toml version constraints
- Pass version specifiers from getSystemPython() through to the installer
- Move pyproject.toml python-version parsing to pyproject PSI utilities
- Replace PoetryPyProjectTomlPythonVersionsService internals with PyVersionSpecifiers
(cherry picked from commit 5ef8f7cb3430826ee38cd80ab460ea4a52da919a)
IJ-MR-193218
GitOrigin-RevId: a989e2dffd5b3081db526b703f9cc6085eac96d5
PY-87542, IJPL-234101: (technical fix): suppress test dependencies check.
There is a bug in `IdeaUltimatePackagingTest` and reports several dependencies as redundant. But they aren't. I've been told by Develar to suppress it for now.
PY-87542, IJPL-234101: Support `SystemPythonService` python detection on WSL and Docker/Windows.
Enable `UnixSystemPythonProvider` on Windows so it can find WSL and Docker pythons even when host is Windows. We need it to test Docker descriptor support on Windows, and it is generally good thing to have.
To do that, we need to fix `directories` (`Path(""/foo/bar")` doesn't work on Windows JVM.
`collectPythonsInPaths` was also broken: `Path` isn't a string: it is a path (either real or eel path) with eel descriptor inside.
PY-87542, IJPL-234101: Do not touch removed container eel descriptor in tests.
`SystemPythonService` caches eel descriptors and looks for pythons in background.
`VirtualEnvReaderEelTest` called it for Docker, and removed the container shortly after, effectively left `SystemPythonService` with unusable descriptor that throws random (undocumented) exceptions from `toEelApi`.
Eel descriptor for Docker lifetime is somewhat blur (must be discussed with Eel team) so for now we mark it "ephemeral" which means we never cache it: see `EelDescriptorFilter`
Merge-request: IJ-MR-191348
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>
GitOrigin-RevId: e007e09b2e8a496105e9a8a269916981823c7f78
Module `intellij.python.community.services.systemPython` is required by both: JUnit4 and JUnit5 tests.
For 5, we have it as a part of `intellij.python.junit5Tests.plugin`.
GitOrigin-RevId: 538d66caf2dc9f081565d1ca901bdb2df9313b10
Dialogs are no longer used in sdk configurators, so those were removed.
System pythons are sorted in a way so that free-threaded Python won't be
the first one (as it's unstable and may cause issues when used as a
default for venv creation).
Venv creation is now the default fallback, so that we won't use system
python as an interpreter.
SdkCreator won't return nullable SDK anymore. Also WSL sdk configurator
should be supported by respective tools, no need in a separate
configurator.
GitOrigin-RevId: 4db65e50363ced52a9ab468c56191095354d3fa2
Use `VirtualEnvReader()` instead of `VirtualEnvReader.Instance` as it is shorter and more idiomatic
Space-RevId: 58448643037948f1e7dc2e84303844b50bd56ee9
GitOrigin-RevId: 35d5b67b8a2d2964ec4b5f611b0f081ac722be2a
`com.intellij.python.community.services.shared.PythonInfoWithUiComparator` sorts by `PythonInfoComparator` and then by `UiComparator`.
It used to multiply first result to `10` trying to shift it one digit left, but `compare` contract doesn't guarantee anything except the sign. It could be `-233` for certain tool names (i.e: different lengths, different characters with a huge distance between their codes).
We now only check contract
Merge-request: IJ-MR-186470
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>
GitOrigin-RevId: 89e9b3de2bd0e4b46d1c213f3b262dd698462275
[python]: `PathShortenerTest`: do not throw an exception for relative paths.
`EelPath` is always absolute, so we used to throw an exception if relative path was provided.
It makes no sense to substitute anything in relative path, so we simply return it as is.
[python]: `SystemPythonService`: remove duplicates.
Merge-request: IJ-MR-183231
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>
GitOrigin-RevId: c391a55fda0f372184279e444e9188f71bceba3e
Instead of old `addManuallyAddedInterpreter` we now have two functions: one that requires system python and one that doesn't.
Both functions register system python if provided, but the latter one accepts any python (venv included).
Various "selectors" use these functions.
We also make sure no non-system python is set to `baseInterpreters`: base are always system!
As a bonus, we show "system" or "virtual env" title near interpreter.
It now checks that python is system (see `ensureSystemPython`).
Non-system pythons are never reported, and `registerSystemPython` also returns an error for non-system pythons
We need `execGetBoolFromStdout` for the further changes
Merge-request: IJ-MR-182415
Merged-by: Ilya Kazakevich <ilya.kazakevich@jetbrains.com>
GitOrigin-RevId: 2950f5f0cd2745c12987a92e40774d366568f312
Currently, we don't have a special 'visible for testing' variant of the visibility modifier, so we need to mark such modules as internal to avoid errors after the visibility checks are enabled at runtime.
Reviewed in IJ-MR-180677.
GitOrigin-RevId: 1dcff728cc567e0c9c4055285b279402b7e5e030
There was a problem with detecting system-wide pythons, which relied on
binary not being a part of conda env or virtualenv. But it led to
unrelated Hatch and Poetry pythons automatically configured as
interpreters in new projects. Another problem is that free-threaded
python was chosen as default interpreter with highest priority because
of the newest version.
This change uses SystemPythonService to detect system pythons properly,
also free-threaded python used as a default interpreter only if it's the
only available option.
Merge-request: IJ-MR-179008
Merged-by: Alexey Katsman <alexey.katsman@jetbrains.com>
GitOrigin-RevId: f32238b063575a125642ee91984ed45ba47010ec
+ add requirePythonSdk() verification for the Sdk extension functions, these methods are not designed to be called for non-python sdks and now will throw IllegalArgumentException.
also corrects dependency tree:
+ move PythonSdkUtil to the python.sdk module, remove dependency on psi.impl
+ create PySkeletonUtil for skeleton utils and leave it in the psi.impl
[python] (IJPL-205889) (BAZEL-2462) don't call getOrCreateAdditionalData for non-python sdks
+ add requirePythonSdk() verification for the Sdk extension functions, these methods are not designed to be called for non-python sdks and now will throw IllegalArgumentException
also corrects dependency tree:
+ move PythonSdkUtil to the python.sdk module, remove dependency on psi.impl
+ create PySkeletonUtil for skeleton utils and leave it in the psi.impl
GitOrigin-RevId: 20d958c5e15cc4e05545b2e61b126b5e015696ed
This module listens for topic that model was just rebuilt from `pyproject.toml` and does its best to configure SDK.
It will support UI to make this process configurable
GitOrigin-RevId: c752c94385814b5fc4413316c0d9d4cc2adb41e4
After this refactoring we how have `comparators.kt` with sorting logic that is used both by `SystemPython` and `PythonSelectableInterpreter` (ViewModel thing for V2).
Tests are also added.
GitOrigin-RevId: 9d04405829f31874d15cb893d9261c7997cb2dd5
Extract various classes to the shared modules, `ExecutablePython` now has `env` map as it can be used by conda.
GitOrigin-RevId: eb45ea29f49132fa4f91c979f71453e6a2ade344