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

chore: change setup.py to use optional build_ext option #2242

Merged
merged 5 commits into from
Jul 18, 2024

Conversation

CaselIT
Copy link
Member

@CaselIT CaselIT commented Jul 13, 2024

This allows skipping the compilation of the c file if it fails for some reason, like the compiler is missing.
The build will still fail if cython can't generate the c file from the py/pyx file but that should be ok.

The optional keyword is documented here https://setuptools.pypa.io/en/latest/userguide/ext_modules.html#setuptools.Extension

optional (bool) – specifies that a build failure in the extension should not abort the build process, but simply not install the failing extension.

Fixes: #2237

This allows skipping the compilation of the c file if it fails for some reason,
like the compiler is missing.
The build will still fail if cython can't generate the c file from the py/pyx file
but that should be ok.
Copy link

codecov bot commented Jul 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (6ba54b4) to head (5c70ac4).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2242   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           63        63           
  Lines         6852      6852           
  Branches      1260      1260           
=========================================
  Hits          6852      6852           

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

@CaselIT CaselIT marked this pull request as ready for review July 13, 2024 13:38
Copy link
Member

@vytas7 vytas7 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, and I've tested it to work well in different scenarios.
But apparently it is conflicted against master, we need to address these conflicts before merging.

@CaselIT
Copy link
Member Author

CaselIT commented Jul 16, 2024

Thanks. Will merge with master soon!

@CaselIT
Copy link
Member Author

CaselIT commented Jul 17, 2024

updated

@vytas7 vytas7 changed the title change setup.py to make use of optional build_ext option chore: change setup.py to use optional build_ext option Jul 18, 2024
@vytas7 vytas7 merged commit 89b5fb0 into master Jul 18, 2024
72 checks passed
@CaselIT CaselIT deleted the modernize_setup.py branch July 18, 2024 21:08
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.

Modernize setup.py to avoid custom built_ext subclass
2 participants