diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 659eeff70d..053b2a2ef8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,5 +1,5 @@ trigger: - # start a new build for every push + # start a new build for every push (triggering run 2 for cache verification) batch: False branches: include: @@ -19,6 +19,7 @@ jobs: condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/develop')) # skip for PR merges variables: MPLBACKEND: agg + CACHE_VERSION: '1' strategy: matrix: Win-Python311-64bit-full: @@ -63,6 +64,29 @@ jobs: versionSpec: $(PYTHON_VERSION) addToPath: true architecture: $(PYTHON_ARCH) + + - powershell: | + $cachePath = Join-Path $env:LOCALAPPDATA "pip\Cache" + if (!(Test-Path $cachePath)) { New-Item -ItemType Directory -Force -Path $cachePath } + Write-Host "##vso[task.setvariable variable=PIP_CACHE_DIR]$cachePath" + displayName: 'Set pip cache directory (Windows)' + condition: eq(variables['Agent.OS'], 'Windows_NT') + + - bash: | + CACHE_DIR="$HOME/.cache/pip" + mkdir -p "$CACHE_DIR" + echo "##vso[task.setvariable variable=PIP_CACHE_DIR]$CACHE_DIR" + displayName: 'Set pip cache directory (Linux)' + condition: eq(variables['Agent.OS'], 'Linux') + + - task: Cache@2 + inputs: + key: 'pip | "$(Agent.OS)" | "$(PYTHON_VERSION)" | "$(BUILD_TYPE)" | "$(imageName)" | "$(CACHE_VERSION)" | package/requirements.txt' + restoreKeys: | + pip | "$(Agent.OS)" | "$(PYTHON_VERSION)" | "$(BUILD_TYPE)" | "$(imageName)" | "$(CACHE_VERSION)" + pip | "$(Agent.OS)" | "$(PYTHON_VERSION)" | "$(BUILD_TYPE)" | "$(imageName)" + path: $(PIP_CACHE_DIR) + displayName: 'Cache pip' # a PEP518 compliant wheel build shoud be # able to build MDAnalysis in an isolated # environment *before* any deps are installed diff --git a/package/AUTHORS b/package/AUTHORS index a799200bf5..729dbd7676 100644 --- a/package/AUTHORS +++ b/package/AUTHORS @@ -275,6 +275,7 @@ Chronological list of authors - Harshit Gajjela - Kunj Sinha - Ayush Agarwal + - Unnati Kadam External code ------------- diff --git a/package/CHANGELOG b/package/CHANGELOG index 790bbbe80f..bc75941537 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -50,6 +50,7 @@ Enhancements * Adds support for parsing `.tpr` files produced by GROMACS 2026.0 * Enables parallelization for analysis.diffusionmap.DistanceMatrix (Issue #4679, PR #4745) + * Implement pip dependency caching for Azure Pipelines (PR #5267) Changes * The msd.py inside analysis is changed, and ProgressBar is implemented inside