Skip to content

feat(setup): support using system CMake#188

Merged
XuehaiPan merged 4 commits intometaopt:mainfrom
mgorny:sys-cmake
Feb 12, 2025
Merged

feat(setup): support using system CMake#188
XuehaiPan merged 4 commits intometaopt:mainfrom
mgorny:sys-cmake

Conversation

@mgorny
Copy link
Contributor

@mgorny mgorny commented Feb 10, 2025

Description

Add the dependency on PyPI cmake package only when the system tool is not available, and use it otherwise.

Motivation and Context

This avoids an unnecessary dependency on a third-party binary package, and improves portability by letting users benefit from downstream patching.

close #187

  • I have raised an issue to propose this change (required for new features and bug fixes)

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds core functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)

Implemented Tasks

Checklist

Go over all the following points, and put an x in all the boxes that apply.
If you are unsure about any of these, don't hesitate to ask. We are here to help!

  • I have read the CONTRIBUTION guide. (required)
  • My change requires a change to the documentation.
  • I have updated the tests accordingly. (required for a bug fix or a new feature)
  • I have updated the documentation accordingly.
  • I have reformatted the code using make format. (required)
  • I have checked the code using make lint. (required)
  • I have ensured make test pass. (required)

Add the dependency on PyPI `cmake` package only when the system tool
is not available, and use it otherwise.  This avoids an unnecessary
dependency on a third-party binary package, and improves portability
by letting users benefit from downstream patching.
@mgorny mgorny requested a review from XuehaiPan as a code owner February 10, 2025 16:55
@mgorny
Copy link
Contributor Author

mgorny commented Feb 10, 2025

For the record, make lint fails on existing code (i.e. unrelated to my changes).

@XuehaiPan XuehaiPan added the enhancement New feature or request label Feb 10, 2025
Copy link
Member

@XuehaiPan XuehaiPan left a comment

Choose a reason for hiding this comment

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

It generally looks good. I have tested it locally, and it works as expected.

I have raised a discussion in the original issue.

@XuehaiPan XuehaiPan changed the title Support using system CMake feat(setup): support using system CMake Feb 10, 2025
@codecov
Copy link

codecov bot commented Feb 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (6808d38) to head (691dcea).
Report is 50 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #188   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           36        36           
  Lines         3786      3786           
=========================================
  Hits          3786      3786           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@XuehaiPan
Copy link
Member

Hi @mgorny, I tweaked some of the changes in this PR. Let me know if you are fine with the changes. Then we can get this merged. Thanks!

Copy link
Contributor Author

@mgorny mgorny left a comment

Choose a reason for hiding this comment

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

WFM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] optree tries to install cmake from PyPI unconditionally

2 participants