Skip to content

Implement pip dependency caching for Azure Pipelines#5267

Open
unnatikdm wants to merge 7 commits intoMDAnalysis:developfrom
unnatikdm:add-pip-caching
Open

Implement pip dependency caching for Azure Pipelines#5267
unnatikdm wants to merge 7 commits intoMDAnalysis:developfrom
unnatikdm:add-pip-caching

Conversation

@unnatikdm
Copy link

@unnatikdm unnatikdm commented Mar 1, 2026

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

  • Issue raised/referenced? - Fixes Improve Azure CI performance by enabling pip dependency caching #5255
  • Tests updated/added? - CI configuration change, no new tests needed
  • Documentation updated/added? - Not required for CI change
  • package/CHANGELOG file updated? - Added entry under "Enhancements"
  • Is your name in package/AUTHORS? - Added my name (@unnatikdm)
  • 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.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello there first time contributor! Welcome to the MDAnalysis community! We ask that all contributors abide by our Code of Conduct and that first time contributors introduce themselves on GitHub Discussions so we can get to know you. You can learn more about participating here. Please also add yourself to package/AUTHORS as part of this PR.

@codecov
Copy link

codecov bot commented Mar 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ 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              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@BradyAJohnston
Copy link
Member

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.

@unnatikdm
Copy link
Author

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!

@IAlibay
Copy link
Member

IAlibay commented Mar 8, 2026

/azp run

@azure-pipelines
Copy link

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.

Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to put a block on this. It's not immediately clear to me that this actually brings about any significant improvements in CI install time.

That would have to be proven, and also a means of clearing the cache should be readily available before we consider moving ahead with this.

@unnatikdm
Copy link
Author

@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.

@unnatikdm unnatikdm requested a review from IAlibay March 8, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Azure CI performance by enabling pip dependency caching

3 participants