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

Use build to create wheels #2697

Closed
wants to merge 2 commits into from
Closed

Use build to create wheels #2697

wants to merge 2 commits into from

Conversation

JCGoran
Copy link
Contributor

@JCGoran JCGoran commented Jan 30, 2024

In Python 3.12, calling python setup.py to create wheels is deprecated; instead, one should use a "standard-based tool" (whatever that means exactly), like the build package from PyPA.
Therefore, instead of calling setup.py bdist_wheel, we use python -m build, which is the recommended replacement for it (as mentioned here: https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html#summary).
Fixes #2696.

Note that we may need to pin version dependencies due to the comment listed here:

After all, the tools aren't printing anything indicating they are assuming implicit defaults and for all I know the defaults could change in a backwards incompatible manner in any release and break my build. (Although I would hope to see a deprecation warning before that occurs.)

by adding a very minimal pyproject.toml.

EDIT: Seems we need to pass --config-setting="--build-option=[OPTION]" to actually pass the options to the build system.

EDIT 2: there's also --config-setting="--global-option=[OPTION]" which puts all of the global options before the build ones, so this is a bit of a hack to silence the installer.

In Python 3.12, calling `python setup.py` to create wheels is deprecated;
instead, one should use a "standard-based tool" (whatever that means),
like the `build` package from PyPA.
Therefore, instead of calling `setup.py bdist_wheel`, we use `python -m
build`, which is the recommended replacement for it (as mentioned here:
https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html#summary).
Fixes #2696.
Copy link

codecov bot commented Jan 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a710366) 66.41% compared to head (b0dc196) 66.41%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2697      +/-   ##
==========================================
- Coverage   66.41%   66.41%   -0.01%     
==========================================
  Files         558      558              
  Lines      108213   108214       +1     
==========================================
- Hits        71874    71873       -1     
- Misses      36339    36341       +2     

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

Copy link

sonarcloud bot commented Jan 31, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@JCGoran
Copy link
Contributor Author

JCGoran commented Apr 13, 2024

Closing in favor of #2832

@JCGoran JCGoran closed this Apr 13, 2024
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.

Deprecation warning when building wheels on Python 3.12 and above
2 participants