Skip to content

📦 Move packaging to PEP 517 in-tree backend#560

Merged
webknjaz merged 1 commit intoaio-libs:masterfrom
webknjaz:packaging/pep517-in-tree-backend
Dec 9, 2023
Merged

📦 Move packaging to PEP 517 in-tree backend#560
webknjaz merged 1 commit intoaio-libs:masterfrom
webknjaz:packaging/pep517-in-tree-backend

Conversation

@webknjaz
Copy link
Copy Markdown
Member

@webknjaz webknjaz commented Dec 7, 2023

This essentially allows the cythonization opt-out be controlled by the pure-python PEP 517 config setting that can be passed to the corresponding build frontends via their respective CLIs.

The users, and packagers are now supposed to explicitly pass the pure-python config setting to their PEP 517 build frontends in use, when they need to make pure-python wheels.

$ python -m pip install . --config-settings=pure-python=
$ python -m pip install .

$ python -m pip install -e . --config-settings=pure-python=
$ python -m pip install -e .

$ python -m pip wheel . --no-deps --config-settings=pure-python=
$ python -m pip wheel . --no-deps

$ python -m build --config-setting=pure-python=
$ python -m build

$ python -m build --wheel --config-setting=--pure-python=
$ python -m build --wheel

Additionally, Cython line tracing is exposed and helps measure code coverage in the PYX files.

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modifications, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep the list in alphabetical order, the file is sorted by name.
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

@webknjaz webknjaz added the enhancement New feature or request label Dec 7, 2023
@webknjaz webknjaz self-assigned this Dec 7, 2023
@webknjaz webknjaz force-pushed the packaging/pep517-in-tree-backend branch from 1aa27a9 to d95289f Compare December 7, 2023 22:46
Comment on lines +8 to +13
from ._backend import ( # type: ignore[assignment] # noqa: WPS436
build_sdist,
build_wheel,
get_requires_for_build_wheel,
prepare_metadata_for_build_wheel,
)

Check notice

Code scanning / CodeQL

Unused import

Import of 'build_sdist' is not used. Import of 'build_wheel' is not used. Import of 'get_requires_for_build_wheel' is not used. Import of 'prepare_metadata_for_build_wheel' is not used.
Comment on lines +17 to +21
from ._backend import ( # type: ignore[assignment] # noqa: WPS436
build_editable,
get_requires_for_build_editable,
prepare_metadata_for_build_editable,
)

Check notice

Code scanning / CodeQL

Unused import

Import of 'build_editable' is not used. Import of 'get_requires_for_build_editable' is not used. Import of 'prepare_metadata_for_build_editable' is not used.

# isort: split
from distutils.command.install import install as _distutils_install_cmd
from distutils.core import Distribution as _DistutilsDistribution

Check warning

Code scanning / CodeQL

Importing value of mutable attribute

Importing the value of 'Distribution' from [module distutils.core](1) means that any change made to [distutils.core.Distribution](2) will be not be observed locally.
@webknjaz webknjaz force-pushed the packaging/pep517-in-tree-backend branch 3 times, most recently from f41a2db to d2c90c5 Compare December 8, 2023 12:23
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (cd4c589) 99.60% compared to head (583a620) 75.98%.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #560       +/-   ##
===========================================
- Coverage   99.60%   75.98%   -23.63%     
===========================================
  Files           2        2               
  Lines         254      254               
  Branches       23       23               
===========================================
- Hits          253      193       -60     
- Misses          1       61       +60     
Flag Coverage Δ
unit 75.98% <ø> (-23.23%) ⬇️

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.

@webknjaz webknjaz force-pushed the packaging/pep517-in-tree-backend branch 10 times, most recently from 00692b5 to 0afd279 Compare December 9, 2023 02:16
@webknjaz webknjaz force-pushed the packaging/pep517-in-tree-backend branch from 0afd279 to af6ac47 Compare December 9, 2023 03:07
This essentially allows the cythonization opt-out be controlled by the
`pure-python` PEP 517 config setting that can be passed to
the corresponding build frontends via their respective CLIs.
@webknjaz webknjaz force-pushed the packaging/pep517-in-tree-backend branch from 664562a to 583a620 Compare December 9, 2023 03:43
@webknjaz webknjaz merged commit 5bd6483 into aio-libs:master Dec 9, 2023
bdraco added a commit that referenced this pull request Oct 5, 2025
PR #560 added --config-settings=pure-python=false
which makes dependabot fail to do dep updates. It
looks like we did not notice for a long time since it was
still doing actions updates
@bdraco bdraco mentioned this pull request Oct 5, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant