Skip to content

Commit

Permalink
Merged PR 419227: Anaconda: need to use call activate in a Batch sc…
Browse files Browse the repository at this point in the history
  • Loading branch information
brcrista committed Jan 2, 2019
1 parent 6d5fdf9 commit 70fc7e2
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions docs/pipelines/languages/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@ When you run a script in a later step after creating an Anaconda environment, yo

```yaml
- script: |
activate myEnvironment
call activate myEnvironment
pytest -m unit --junitxml=junit/unit-test.xml
displayName: 'Unit tests'

- script: |
activate myEnvironment
call activate myEnvironment
pytest -m integration --junitxml=junit/integration-test.xml
displayName: 'Integration tests'
```
Expand Down Expand Up @@ -219,13 +219,37 @@ After updating `pip` and friends, a typical next step is to install from `requir

### Install Anaconda packages with conda

Add the following YAML to install the `scipy` package in the conda environment named `myEnvironment`. See [Activate an Anaconda environment](#activate-an-anaconda-environment) above.
Add the following YAML to install the `scipy` package in the conda environment named `myEnvironment`.

# [Hosted Ubuntu 16.04](#tab/ubuntu-16-04)

```yaml
- script: conda install -n myEnvironment scipy
- bash: |
source activate myEnvironment
conda install -n myEnvironment scipy
displayName: 'Install conda libraries'
```

# [Hosted macOS](#tab/macos)

```yaml
- bash: |
source activate myEnvironment
conda install -n myEnvironment scipy
displayName: 'Install conda libraries'
```

# [Hosted VS2017](#tab/vs2017)

```yaml
- script: |
call activate myEnvironment
conda install -n myEnvironment scipy
displayName: 'Install conda libraries'
```

---

## Test

### Run lint tests with Flake8
Expand Down Expand Up @@ -258,7 +282,7 @@ Add the [Publish Test Results](../tasks/test/publish-test-results.md) task to pu

```yaml
- task: PublishTestResults@2
condition: succeededOrFailed()
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'
Expand Down

0 comments on commit 70fc7e2

Please sign in to comment.