Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leverage pkg-config in setup.py #498

Merged
merged 1 commit into from
Nov 17, 2023
Merged

Conversation

pablogsal
Copy link
Member

Using pkg-config we can get automatically the build flags in MacOS
and Linux and this doesn't require the user to manually modify CFLAGS
just to build the extension.

Signed-off-by: Pablo Galindo pablogsal@gmail.com

@codecov-commenter
Copy link

codecov-commenter commented Nov 17, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (986a17e) 92.34% compared to head (c7a0573) 92.20%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #498      +/-   ##
==========================================
- Coverage   92.34%   92.20%   -0.14%     
==========================================
  Files          91       91              
  Lines       11033    11033              
  Branches     1524     1524              
==========================================
- Hits        10188    10173      -15     
- Misses        840      855      +15     
  Partials        5        5              
Flag Coverage Δ
cpp 85.61% <ø> (-0.41%) ⬇️
python_and_cython 95.48% <ø> (ø)

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.

Copy link
Contributor

@godlygeek godlygeek left a comment

Choose a reason for hiding this comment

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

Looks good to me except for one nit:

@@ -46,7 +47,7 @@ jobs:
python3.10-dbg
- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip cython
python3 -m pip install --upgrade pip cython pkgconfig
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this change should be needed. make test-install runs

$(ENV) CYTHON_TEST_MACROS=1 $(PIP_INSTALL) -e .[test]

and that pip install will use the build dependencies specified in the pyproject.toml. We need pip here so that we can pip install, and I believe we need cython for its coverage plugin, not for the package build.

Suggested change
python3 -m pip install --upgrade pip cython pkgconfig
python3 -m pip install --upgrade pip cython

Copy link
Contributor

Choose a reason for hiding this comment

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

Nope, I'm wrong, we do need it. Not for the make test-install, but because later we do make ccoverage, which does:

CFLAGS=" -O0 -pg --coverage" make build

and that needs it.

Sorry for the bad advice!

Copy link
Contributor

@godlygeek godlygeek left a comment

Choose a reason for hiding this comment

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

LGTM

Using pkg-config we can get automatically the build flags in MacOS
and Linux and this doesn't require the user to manually modify CFLAGS
just to build the extension.

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
@pablogsal pablogsal enabled auto-merge (rebase) November 17, 2023 20:23
@pablogsal pablogsal merged commit c4b35f3 into bloomberg:main Nov 17, 2023
33 checks passed
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.

None yet

3 participants