Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5b5205e
Add FS-related testing helpers.
ericsnowcurrently Nov 3, 2020
bbd0f72
Add WindowsKnownPathsLocator.
ericsnowcurrently Oct 6, 2020
1e46276
Drop WindowsKnownPathsLocator.triggerRefresh().
ericsnowcurrently Nov 3, 2020
9d1d4dd
Make sure the files are actually executable.
ericsnowcurrently Oct 28, 2020
be48b07
Deal with missing directories on $PATH.
ericsnowcurrently Nov 3, 2020
6fa898f
Register the locator.
ericsnowcurrently Oct 6, 2020
fd0a29c
Add tests.
ericsnowcurrently Oct 8, 2020
719a06c
Drop unneeded tests.
ericsnowcurrently Nov 3, 2020
cae16bc
Mark the PyenvLocator tests as functional.
ericsnowcurrently Nov 10, 2020
1f56574
Mark the GlobalVirtualEnvironmentLocator tests as functional.
ericsnowcurrently Nov 10, 2020
f44a558
Fix findInterpretersInDir().
ericsnowcurrently Nov 10, 2020
df16786
Stub out normalizeFilename() during unit tests.
ericsnowcurrently Nov 10, 2020
2ec727e
Do not assume "python.exe" is 2.7 on Windows.
ericsnowcurrently Nov 10, 2020
03cd240
Make sure the cache mapping uses normalized filenames.
ericsnowcurrently Nov 10, 2020
04c6482
Fix tests for KnownSearchPathsForInterpreters.
ericsnowcurrently Nov 10, 2020
30422a5
Deal with the fact that fs.access() is useless on Windows.
ericsnowcurrently Nov 11, 2020
2359b06
initialize() -> activate()
ericsnowcurrently Nov 12, 2020
e025ffe
Process search path entries in parallel.
ericsnowcurrently Nov 17, 2020
666f41a
Fold the unit tests into the functional tests.
ericsnowcurrently Nov 17, 2020
8a33257
Add a better doc comment for the `parseTree()` helper.
ericsnowcurrently Nov 18, 2020
dced4ef
Add better doc comments for `parseFSTree()`.
ericsnowcurrently Nov 18, 2020
39332be
Move the text-oriented helpers to the appropriate module.
ericsnowcurrently Nov 18, 2020
06e7d2e
Fix the tests.
ericsnowcurrently Nov 30, 2020
8b4a4eb
Drop errant line.
ericsnowcurrently Dec 1, 2020
db71c64
Fix the tests.
ericsnowcurrently Dec 2, 2020
8b1180c
lint
ericsnowcurrently Dec 2, 2020
917cbc0
Do not check if files are executable.
ericsnowcurrently Dec 8, 2020
0021f3a
Drop an outdated comment.
ericsnowcurrently Dec 8, 2020
b6c350a
Do not fail if directory not found.
ericsnowcurrently Dec 10, 2020
ed31414
Add DirFilesLocator.
ericsnowcurrently Dec 10, 2020
45689da
Fix WindowsKnownPathsLocator.
ericsnowcurrently Dec 10, 2020
12a3688
WindowsKnownPathsLocator -> WindowsPathEnvVarLocator.
ericsnowcurrently Dec 10, 2020
13b997d
Drop an outdated comment.
ericsnowcurrently Dec 10, 2020
a5ac756
Drop the "opts" param from findInterpretersInDir().
ericsnowcurrently Dec 10, 2020
e19a429
Factor out getDirFilesLocator().
ericsnowcurrently Dec 10, 2020
f5d1284
Wrap DirFilesLocator.
ericsnowcurrently Dec 10, 2020
68151a3
Filter out "non-standard" executables.
ericsnowcurrently Dec 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lint
  • Loading branch information
ericsnowcurrently committed Dec 10, 2020
commit 8b1180c8c7af41f0faa19998f940292ab56ee447
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,13 @@ suite('Python envs locator - WindowsKnownPathsLocator', async () => {
const filename = path.join(ROOT1, 'python3.8.exe');
const env = {
executable: { ...EMPTY_EXECUTABLE, filename },
} as PythonEnvInfo;
};
const expected = getEnv('', '3.8', filename);
const locator = new WindowsKnownPathsLocator();
setSearchPath([ROOT2, ROOT6, ROOT1]);
await ensureActivated(locator);

const resolved = await locator.resolveEnv(env);
const resolved = await locator.resolveEnv(env as PythonEnvInfo);

assert.deepEqual(resolved, expected);
});
Expand Down Expand Up @@ -290,15 +290,15 @@ suite('Python envs locator - WindowsKnownPathsLocator', async () => {

[
'',
{ name: 'env1' } as PythonEnvInfo, // matches an env but resolveEnv() doesn't care
{} as PythonEnvInfo,
{ name: 'env1' }, // matches an env but resolveEnv() doesn't care
{},
].forEach((env) => {
test(`missing executable (${env})`, async () => {
const locator = new WindowsKnownPathsLocator();
setSearchPath([ROOT2, ROOT6, ROOT1]);
await ensureActivated(locator);

const resolved = await locator.resolveEnv(env);
const resolved = await locator.resolveEnv(env as string | PythonEnvInfo);

assert.equal(resolved, undefined);
});
Expand Down Expand Up @@ -336,16 +336,16 @@ suite('Python envs locator - WindowsKnownPathsLocator', async () => {
...EMPTY_EXECUTABLE,
filename: path.join(ROOT1, 'python3.8.exe'),
},
} as PythonEnvInfo,
{ name: 'env1' } as PythonEnvInfo, // matches an env but resolveEnv() doesn't care
{} as PythonEnvInfo,
},
{ name: 'env1' }, // matches an env but resolveEnv() doesn't care
{},
];
const locator = new WindowsKnownPathsLocator();
setSearchPath([ROOT2, ROOT6, ROOT1]);
await ensureActivated(locator);

const envs = await Promise.all(
executables.map((ex) => locator.resolveEnv(ex)),
executables.map((exe) => locator.resolveEnv(exe as string | PythonEnvInfo)),
);

assert.deepEqual(envs, expected);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as sinon from 'sinon';
import * as fsWatcher from '../../../../client/common/platform/fileSystemWatcher';
import * as platformUtils from '../../../../client/common/utils/platform';
import {
PythonEnvInfo, PythonEnvKind, PythonReleaseLevel, PythonVersion, UNKNOWN_PYTHON_VERSION
PythonEnvInfo, PythonEnvKind, PythonReleaseLevel, PythonVersion, UNKNOWN_PYTHON_VERSION,
} from '../../../../client/pythonEnvironments/base/info';
import { getEnvs } from '../../../../client/pythonEnvironments/base/locatorUtils';
import * as externalDependencies from '../../../../client/pythonEnvironments/common/externalDependencies';
Expand Down