Skip to content

Commit af6b23a

Browse files
committed
Implement pip dependency caching for Azure Pipelines
1 parent 900d20b commit af6b23a

15 files changed

Lines changed: 378105 additions & 0 deletions

File tree

azure-pipelines.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,23 @@ jobs:
6363
versionSpec: $(PYTHON_VERSION)
6464
addToPath: true
6565
architecture: $(PYTHON_ARCH)
66+
67+
- script: echo "##vso[task.setvariable variable=PIP_CACHE_DIR]$(HOME)/.cache/pip"
68+
condition: eq(variables['Agent.OS'], 'Linux')
69+
displayName: 'Set PIP_CACHE_DIR for Linux'
70+
71+
- script: echo "##vso[task.setvariable variable=PIP_CACHE_DIR]$(LocalAppData)\pip\Cache"
72+
condition: eq(variables['Agent.OS'], 'Windows_NT')
73+
displayName: 'Set PIP_CACHE_DIR for Windows'
74+
75+
- task: Cache@2
76+
inputs:
77+
key: 'pip | "$(Agent.OS)" | "$(PYTHON_VERSION)" | "$(BUILD_TYPE)" | "$(imageName)"'
78+
restoreKeys: |
79+
pip | "$(Agent.OS)" | "$(PYTHON_VERSION)" | "$(BUILD_TYPE)"
80+
pip | "$(Agent.OS)" | "$(PYTHON_VERSION)"
81+
path: $(PIP_CACHE_DIR)
82+
displayName: 'Cache pip'
6683
# a PEP518 compliant wheel build shoud be
6784
# able to build MDAnalysis in an isolated
6885
# environment *before* any deps are installed

build_log.txt

204 KB
Binary file not shown.

0 commit comments

Comments
 (0)