Implement pip dependency caching for Azure Pipelines
Fixes #5255
Changes made in this Pull Request: Implement pip dependency caching for Azure Pipelines to reduce CI runtime:
- Added platform-specific cache paths (Linux/macOS:
$(HOME)/.cache/pip, Windows:$(LocalAppData)\pip\Cache) - Integrated Cache@2 task with granular keys using Agent.OS, PYTHON_VERSION, BUILD_TYPE, imageName, and requirements hash
- Added fallback keys for cache reuse across similar builds
- Fixed Windows path quoting issue that was causing build failures
LLM / AI generated code disclosure
LLMs or other AI-powered tools (beyond simple IDE use cases) were used in this contribution: yes
Disclosure details: I used AI assistance (ChatGPT) to help debug the Windows path quoting issue and to format the PR description. The core implementation logic and understanding of the problem were my own, with AI helping to:
- Identify the trailing quote issue in the Windows cache path
- Suggest the PowerShell fix for Windows path handling
- Format the PR description according to the template
All code was reviewed and understood before committing.
PR Checklist
- [x] Issue raised/referenced? - Fixes #5255
- [ ] Tests updated/added? - CI configuration change, no new tests needed
- [ ] Documentation updated/added? - Not required for CI change
- [x] package/CHANGELOG file updated? - Added entry under "Enhancements"
- [x] Is your name in package/AUTHORS? - Added my name (@unnatikdm)
- [x] LLM/AI disclosure was updated. - See above
Developers Certificate of Origin
I certify that I can submit this code contribution as described in the Developer Certificate of Origin, under the MDAnalysis LICENSE.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 93.83%. Comparing base (6e837a4) to head (4746135).
Additional details and impacted files
@@ Coverage Diff @@
## develop #5267 +/- ##
===========================================
- Coverage 93.83% 93.83% -0.01%
===========================================
Files 182 182
Lines 22501 22501
Branches 3195 3195
===========================================
- Hits 21114 21113 -1
- Misses 924 925 +1
Partials 463 463
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
There is a PR template which includes a check list and required certification around origin of code (authoring and AI usage): https://github.com/MDAnalysis/mdanalysis/blob/develop/.github/PULL_REQUEST_TEMPLATE.md
Please include it filled out in the PR description. Ensure you read the AI policy (https://github.com/MDAnalysis/mdanalysis/blob/develop/AI_POLICY.md) and answer truthfully.
Currently a number of files have been added to git that are not required as they are results of compiling, please remove them.
Hi @BradyAJohnston, thanks for the feedback!
I've updated the PR description to include the full template with AI disclosure (truthfully stated that AI assistance was used for debugging and formatting). I also removed the accidentally added compiled/binary files in commit 10007e04f – the PR now only contains changes to azure-pipelines.yml, package/AUTHORS, and package/CHANGELOG.
Regarding the Codecov coverage drop (-7.69%): It appears unrelated to my changes because only CI configuration and documentation files were modified. Codecov itself notes "No files covered by tests were changed" and that the commits have different numbers of coverage report uploads, which can cause artificial drops. I believe this can be safely ignored.
Please let me know if any further changes are needed. Thanks again for your review!
/azp run
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.
@IAlibay I’ve addressed the feedback:
Added CACHE_VERSION variable to allow manual cache clearing (incremented to force a fresh cache). This is included in both the primary key and the restore keys. Collected performance data showing a significant speedup in dependency installation (~75% on Linux, ~33% on Windows). Rebased on latest develop to resolve conflicts. Please let me know if there’s anything else needed.