Add and use a pyproject-compatible build backend for extensions.

Review Request #14140 — Created Sept. 4, 2024 and submitted

Information

Review Board
release-7.1.x

Reviewers

We now support building extensions entirely based on a pyproject.toml.
This will be the standard going forward, and will require the following
configuration:

[build-system]
requires = [
    'reviewboard~=<version>',
    'reviewboard[extension-packaging]',
]
build-backend = 'reviewboard.extensions.packaging.backend'

If there's an existing setup.py, then things will continue to work
as-is. If one doesn't exist, it will be generated during the lifecycle
of the build, calling into our own setup() method. This is the same
process that setuptools itself uses when building packages, since it
still uses its own machinery under the hood.

rbext create will now generate this file automatically, and no longer
generates setup.py.

The documentation has been updated to reference pyproject.toml and
show examples, replacing all old setup.py references, old references
to eggs, and old command line examples, in an effort to help modernize
some of this.

Generated new extensions and built them without issue.

Added a bare-bones pyproject.toml to an existing package, specifying
the new build backend, and verified it built.

Built the docs and went over the changes, making sure they didn't appear
broken.

Summary ID
Add and use a pyproject-compatible build backend for extensions.
We now support building extensions entirely based on a `pyproject.toml`. This will be the standard going forward, and will require the following configuration: [build-system] requires = [ 'reviewboard~=<version>`, 'reviewboard[extension-packaging]', ] build-backend = 'reviewboard.extensions.packaging.backend' If there's an existing `setup.py`, then things will continue to work as-is. If one doesn't exist, it will be generated during the lifecycle of the build, calling into our own `setup()` method. This is the same process that setuptools itself uses when building packages, since it still uses its own machinery under the hood. `rbext create` will now generate this file automatically, and no longer generates `setup.py`. The documentation has been updated to reference `pyproject.toml` and show examples, replacing all old `setup.py` references, old references to eggs, and old command line examples, in an effort to help modernize some of this.
c07213a454995960b2fe3c9194db2bf9d0b3673b
Description From Last Updated

We should give a short comment to describe why this is necessary. Would this ever need to change depending on …

maubinmaubin

Old typo here: "Once this is Python package is installed..."

maubinmaubin

module level import not at top of file Column: 1 Error code: E402

reviewbotreviewbot

This one wasn't added in 7.1.

maubinmaubin

module level import not at top of file Column: 1 Error code: E402

reviewbotreviewbot

module level import not at top of file Column: 1 Error code: E402

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

david
  1. Ship It!
  2. 
      
maubin
  1. 
      
  2. Show all issues

    We should give a short comment to describe why this is necessary. Would this ever need to change depending on the extension?

  3. Show all issues

    Old typo here: "Once this is Python package is installed..."

  4. reviewboard/cmdline/rbext.py (Diff revision 1)
     
     
     
     
     
     
    Show all issues

    This one wasn't added in 7.1.

  5. 
      
chipx86
Review request changed
Change Summary:
  • Added guidance comments in the pyproject.toml example.
  • Fixed some typos and wording for legacy backends.
  • Removed a Version Added: 7.1 for an existing argument.
Commits:
Summary ID
Add and use a pyproject-compatible build backend for extensions.
We now support building extensions entirely based on a `pyproject.toml`. This will be the standard going forward, and will require the following configuration: [build-system] requires = [ 'reviewboard~=<version>`, 'reviewboard[extension-packaging]', ] build-backend = 'reviewboard.extensions.packaging.backend' If there's an existing `setup.py`, then things will continue to work as-is. If one doesn't exist, it will be generated during the lifecycle of the build, calling into our own `setup()` method. This is the same process that setuptools itself uses when building packages, since it still uses its own machinery under the hood. `rbext create` will now generate this file automatically, and no longer generates `setup.py`. The documentation has been updated to reference `pyproject.toml` and show examples, replacing all old `setup.py` references, old references to eggs, and old command line examples, in an effort to help modernize some of this.
aaaf5c6486c5c4e8ef18c99f2afb45e443527a59
Add and use a pyproject-compatible build backend for extensions.
We now support building extensions entirely based on a `pyproject.toml`. This will be the standard going forward, and will require the following configuration: [build-system] requires = [ 'reviewboard~=<version>`, 'reviewboard[extension-packaging]', ] build-backend = 'reviewboard.extensions.packaging.backend' If there's an existing `setup.py`, then things will continue to work as-is. If one doesn't exist, it will be generated during the lifecycle of the build, calling into our own `setup()` method. This is the same process that setuptools itself uses when building packages, since it still uses its own machinery under the hood. `rbext create` will now generate this file automatically, and no longer generates `setup.py`. The documentation has been updated to reference `pyproject.toml` and show examples, replacing all old `setup.py` references, old references to eggs, and old command line examples, in an effort to help modernize some of this.
1101a6d850c3c49df6a820a94a8ac0b85cee5664

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

chipx86
Review request changed
Change Summary:

Removed the now-unused function for generating setup.py.

Commits:
Summary ID
Add and use a pyproject-compatible build backend for extensions.
We now support building extensions entirely based on a `pyproject.toml`. This will be the standard going forward, and will require the following configuration: [build-system] requires = [ 'reviewboard~=<version>`, 'reviewboard[extension-packaging]', ] build-backend = 'reviewboard.extensions.packaging.backend' If there's an existing `setup.py`, then things will continue to work as-is. If one doesn't exist, it will be generated during the lifecycle of the build, calling into our own `setup()` method. This is the same process that setuptools itself uses when building packages, since it still uses its own machinery under the hood. `rbext create` will now generate this file automatically, and no longer generates `setup.py`. The documentation has been updated to reference `pyproject.toml` and show examples, replacing all old `setup.py` references, old references to eggs, and old command line examples, in an effort to help modernize some of this.
1101a6d850c3c49df6a820a94a8ac0b85cee5664
Add and use a pyproject-compatible build backend for extensions.
We now support building extensions entirely based on a `pyproject.toml`. This will be the standard going forward, and will require the following configuration: [build-system] requires = [ 'reviewboard~=<version>`, 'reviewboard[extension-packaging]', ] build-backend = 'reviewboard.extensions.packaging.backend' If there's an existing `setup.py`, then things will continue to work as-is. If one doesn't exist, it will be generated during the lifecycle of the build, calling into our own `setup()` method. This is the same process that setuptools itself uses when building packages, since it still uses its own machinery under the hood. `rbext create` will now generate this file automatically, and no longer generates `setup.py`. The documentation has been updated to reference `pyproject.toml` and show examples, replacing all old `setup.py` references, old references to eggs, and old command line examples, in an effort to help modernize some of this.
c07213a454995960b2fe3c9194db2bf9d0b3673b

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

david
  1. Ship It!
  2. 
      
maubin
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-7.1.x (332fa1a)