-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add conda support to nightly flake test #10523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b260c2a
885f972
d3f04f6
11c6097
db60ded
fca098e
ba0fc56
d4f3fee
fb16261
bfb4cec
43cf4a1
8e11f39
2573ea0
c418e11
318b82c
cd9112a
fd76344
a83acca
be983b2
39f5e4b
dcd6c0f
21eab4b
87fbdbb
96b4395
587bafc
94b75fd
7712c47
b9fc139
6f85ffb
130fc50
48cc263
bcdfdaf
04d6caa
1f03b7c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
pandas | ||
jupyter | ||
numpy | ||
matplotlib |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: conda_env_1 | ||
dependencies: | ||
- python=3.7 | ||
- pandas | ||
- jupyter | ||
- numpy | ||
- matplotlib |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: conda_env_2 | ||
dependencies: | ||
- python=3.8 | ||
- pandas | ||
- jupyter | ||
- numpy | ||
- matplotlib |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,16 +97,7 @@ steps: | |
python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python/debugpy/no_wheels --no-cache-dir --implementation py --no-deps --upgrade --pre debugpy | ||
displayName: 'pip install system test requirements' | ||
condition: and(succeeded(), eq(variables['NeedsPythonTestReqs'], 'true')) | ||
|
||
# Install the additional sqlite requirements | ||
# | ||
# This task will only run if variable `NeedsPythonFunctionalReqs` is true. | ||
- bash: | | ||
sudo apt-get install libsqlite3-dev | ||
python -m pip install pysqlite | ||
displayName: 'Setup python to run with sqlite on 2.7' | ||
condition: and(succeeded(), eq(variables['NeedsPythonFunctionalReqs'], 'true'), eq(variables['Agent.Os'], 'Linux'), eq(variables['PythonVersion'], '2.7')) | ||
|
||
|
||
# Install the requirements for functional tests. | ||
# | ||
# This task will only run if variable `NeedsPythonFunctionalReqs` is true. | ||
|
@@ -118,9 +109,69 @@ steps: | |
- bash: | | ||
python -m pip install numpy | ||
python -m pip install --upgrade -r ./build/functional-test-requirements.txt | ||
python -c "import sys;print(sys.executable)" | ||
displayName: 'pip install functional requirements' | ||
condition: and(succeeded(), eq(variables['NeedsPythonFunctionalReqs'], 'true')) | ||
|
||
# Add CONDA to the path so anaconda works | ||
# | ||
# This task will only run if variable `NeedsPythonFunctionalReqs` is true. | ||
- bash: | | ||
echo "##vso[task.prependpath]$CONDA/bin" | ||
displayName: 'Add conda to the path' | ||
condition: and(succeeded(), eq(variables['NeedsPythonFunctionalReqs'], 'true'), ne(variables['Agent.Os'], 'Windows_NT')) | ||
|
||
# Add CONDA to the path so anaconda works (windows) | ||
# | ||
# This task will only run if variable `NeedsPythonFunctionalReqs` is true. | ||
- powershell: | | ||
Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" | ||
displayName: 'Add conda to the path' | ||
condition: and(succeeded(), eq(variables['NeedsPythonFunctionalReqs'], 'true'), eq(variables['Agent.Os'], 'Windows_NT')) | ||
|
||
# On MAC let CONDA update install paths | ||
# | ||
# This task will only run if variable `NeedsPythonFunctionalReqs` is true. | ||
- bash: | | ||
sudo chown -R $USER $CONDA | ||
displayName: 'Give CONDA permission to its own files' | ||
condition: and(succeeded(), eq(variables['NeedsPythonFunctionalReqs'], 'true'), eq(variables['Agent.Os'], 'Darwin')) | ||
|
||
# Create the two anaconda environments | ||
# | ||
# This task will only run if variable `NeedsPythonFunctionalReqs` is true. | ||
# | ||
- script: | | ||
conda env create --quiet --force --file build/ci/conda_env_1.yml | ||
conda env create --quiet --force --file build/ci/conda_env_2.yml | ||
displayName: 'Create CONDA Environments' | ||
condition: and(succeeded(), eq(variables['NeedsPythonFunctionalReqs'], 'true')) | ||
|
||
# Run the pip installs in the 3 environments (darwin linux) | ||
- bash: | | ||
source activate base | ||
conda install --quiet -y --file build/ci/conda_base.yml | ||
python -m pip install --upgrade -r build/conda-functional-requirements.txt | ||
source activate conda_env_1 | ||
python -m pip install --upgrade -r build/conda-functional-requirements.txt | ||
source activate conda_env_2 | ||
python -m pip install --upgrade -r build/conda-functional-requirements.txt | ||
conda deactivate | ||
displayName: 'Install Pip requirements for CONDA envs' | ||
condition: and(succeeded(), eq(variables['NeedsPythonFunctionalReqs'], 'true'), ne(variables['Agent.Os'], 'Windows_NT')) | ||
|
||
# Run the pip installs in the 3 environments (windows) | ||
- script: | | ||
call activate base | ||
conda install --quiet -y --file build/ci/conda_base.yml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why install in base environment? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because the functional-requirements.txt seems to install jupyter into the base conda after conda is added to the path. So we need the pandas/matplotlib stuff in the base environment then too. It ends up being the first environment. In reply to: 391131125 [](ancestors = 391131125) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I'm going to leave this as is for now (it's just another environment). the original intent was to have base have nothing in it. For some reason we're detecting jupyter in it though. Maybe the anaconda install does this without our help. In reply to: 391138171 [](ancestors = 391138171,391131125) |
||
python -m pip install --upgrade -r build/conda-functional-requirements.txt | ||
call activate conda_env_1 | ||
python -m pip install --upgrade -r build/conda-functional-requirements.txt | ||
call activate conda_env_2 | ||
python -m pip install --upgrade -r build/conda-functional-requirements.txt | ||
displayName: 'Install Pip requirements for CONDA envs' | ||
condition: and(succeeded(), eq(variables['NeedsPythonFunctionalReqs'], 'true'), eq(variables['Agent.Os'], 'Windows_NT')) | ||
|
||
# Downgrade pywin32 on Windows due to bug https://github.com/jupyter/notebook/issues/4909 | ||
# | ||
# This task will only run if variable `NeedsPythonFunctionalReqs` is true. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,22 +50,6 @@ stages: | |
steps: | ||
- template: templates/test_phases.yml | ||
|
||
- job: 'Py36' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we removing 3.6? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This didn't actually test against 36. The conda environment determines what version of python is used now. In reply to: 391116118 [](ancestors = 391116118) |
||
dependsOn: [] | ||
timeoutInMinutes: 120 | ||
strategy: | ||
matrix: | ||
'Functional': | ||
PythonVersion: '3.6' | ||
TestsToRun: 'testfunctional' | ||
NeedsPythonTestReqs: true | ||
NeedsPythonFunctionalReqs: true | ||
VSCODE_PYTHON_ROLLING: true | ||
pool: | ||
vmImage: 'ubuntu-16.04' | ||
steps: | ||
- template: templates/test_phases.yml | ||
|
||
- stage: Mac | ||
dependsOn: | ||
- Build | ||
|
@@ -85,22 +69,6 @@ stages: | |
steps: | ||
- template: templates/test_phases.yml | ||
|
||
- job: 'Py36' | ||
dependsOn: [] | ||
timeoutInMinutes: 120 | ||
strategy: | ||
matrix: | ||
'Functional': | ||
PythonVersion: '3.6' | ||
TestsToRun: 'testfunctional' | ||
NeedsPythonTestReqs: true | ||
NeedsPythonFunctionalReqs: true | ||
VSCODE_PYTHON_ROLLING: true | ||
pool: | ||
vmImage: '$(vmImageMacOS)' | ||
steps: | ||
- template: templates/test_phases.yml | ||
|
||
- stage: Windows | ||
dependsOn: | ||
- Build | ||
|
@@ -119,19 +87,3 @@ stages: | |
vmImage: 'vs2017-win2016' | ||
steps: | ||
- template: templates/test_phases.yml | ||
|
||
- job: 'Py36' | ||
dependsOn: [] | ||
timeoutInMinutes: 120 | ||
strategy: | ||
matrix: | ||
'Functional': | ||
PythonVersion: '3.6' | ||
TestsToRun: 'testfunctional' | ||
NeedsPythonTestReqs: true | ||
NeedsPythonFunctionalReqs: true | ||
VSCODE_PYTHON_ROLLING: true | ||
pool: | ||
vmImage: 'vs2017-win2016' | ||
steps: | ||
- template: templates/test_phases.yml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# List of requirements for conda environments that cannot be installed using conda | ||
livelossplot | ||
versioneer | ||
flake8 | ||
autopep8 | ||
bandit | ||
black ; python_version>='3.6' | ||
yapf | ||
pylint | ||
pycodestyle | ||
prospector | ||
pydocstyle | ||
nose | ||
pytest==4.6.9 # Last version of pytest with Python 2.7 support | ||
rope | ||
flask | ||
django | ||
isort | ||
pathlib2>=2.2.0 ; python_version<'3.6' # Python 2.7 compatibility (pytest) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,2 @@ | ||
# List of requirements for functional tests | ||
versioneer | ||
jupyter | ||
numpy | ||
matplotlib | ||
pandas | ||
livelossplot | ||
# List of requirements for functional tests | ||
versioneer |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add conda environments to nightly test runs |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -512,18 +512,6 @@ export class NativeEditor extends InteractiveBase implements INotebookEditor { | |
protected async close(): Promise<void> { | ||
// Fire our event | ||
this.closedEvent.fire(this); | ||
|
||
// Restart our kernel so that execution counts are reset | ||
let oldAsk: boolean | undefined = false; | ||
const settings = this.configuration.getSettings(await this.getOwningResource()); | ||
if (settings && settings.datascience) { | ||
oldAsk = settings.datascience.askForKernelRestart; | ||
settings.datascience.askForKernelRestart = false; | ||
} | ||
await this.restartKernel(true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this is a breaking change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Breaking how? We talked it over and decided it was a mistake to restart the kernel. Instead will just close the kernel. In reply to: 391116888 [](ancestors = 391116888) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a day ago I changed restartKernel to pass a bool to not log telemetry just for this case (as it was not user triggered restart). We could remove that now as it's not needed. |
||
if (oldAsk && settings && settings.datascience) { | ||
settings.datascience.askForKernelRestart = true; | ||
} | ||
} | ||
|
||
protected saveAll() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to understand the purpose of creating two environments.
We have P37 and P38. Which will be used in tests?
I think P38 will always be used. If that's the case, then why install pandas, jupyter, matplotlib in P37?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the tests uses two environments now.
In reply to: 391113722 [](ancestors = 391113722)