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

Merge PEP 660 implementation into main #3488

Merged
merged 145 commits into from
Aug 11, 2022
Merged

Merge PEP 660 implementation into main #3488

merged 145 commits into from
Aug 11, 2022

Conversation

abravalheri
Copy link
Contributor

@abravalheri abravalheri commented Aug 5, 2022

The idea of this PR is just to mark the implementation as "complete enough" / "tested enough" that it can be merged into main.

The main concepts of the implementation were presented in #3265.

The development of this feature was split into several PRs previously submitted.
Anyone interested in checking these smaller PRs can have a look on the following searches:

Several discussions and feedback were collected in:

Hopefully the development was slow enough and the community engagement was broad enough that there were enough chances of involvement for feedback, design changes, etc... 🤞

Instructions for testing the feature before the PR is merged can be found in https://discuss.python.org/t/help-testing-pep-660-support-in-setuptools/16904.

Summary of changes

  • Added editable hooks according with PEP 660
  • Added a "strict" editable installation mode
  • Added a "compat" editable installation mode (this mode is transitional and will be removed in future versions of setuptools - my personal suggestion is to remove this mode after the end of the year).
  • Added mechanisms for custom build sub-commands to tap into the editable install mode and do the necessary adaptions.
  • Updated userguide/development_mode docs.
  • Changed build_py and build_ext to add a mechanism of getting a list of files being packages and to which original files they correspond to.
  • Improved handling of --build-option and --global-option in the config_settings argument of the build_meta hooks (to match the historic pip behaviour)
    • this is, at least in theory, backwards compatible and only warn the user when a given --global-option should actually be a --build-option, but accept it anyway.

Closes #2816

Pull Request Checklist

dholth and others added 30 commits February 4, 2022 15:19
Changes:

- Deprecate the --egg-base parameter for dist_info and add --output-dir as
  replacement

  (Since the egg format is mostly deprecated, it is nice to move away from
  this nomenclature...)
Avoid using the editables dependency
  - The current implementation is using it to simply place .pth file
    pointing to the project directory anyway...
  - Adding a dependency for creating a file with a single line is a bit
    overkill.

Avoid importing pkg_resources directly
- Setuptools wants to move away from pkg_resources

Replace custom wheel build with re-use of bdist_wheel
  - pro: avoid re-implementing the archiving logic and make sure it is
    compatible with the same archive format used by the final wheels.
  - con: the API of wheel is not exactly stable or exported as public.
This change is heavily inspired by the existing develop command

- Use namespaces.Installer to ensure legacy namespaces are handled.
- Improve the skeleton that would allow the separation between different
  editable strategies
- Extract strategy for static .pth files
- Recognise the static .pth file as the primary strategy for src-layout
  packages in a "non"-strict scenario
- Move test_editable_prefix from test_develop to test_editable_install
- Add more tests for editable install focusing on packages using
  namespaces (legacy or PEP 420)
casperdcl added a commit to AMYPAD/NumCu that referenced this pull request Aug 21, 2022
openstack-mirroring pushed a commit to openstack/pbr that referenced this pull request Nov 1, 2023
As with PEP-517 support, this is simply a shim over the setuptools
implementation added in setuptools v64.0.0 [1].

[1] pypa/setuptools#3488

Change-Id: I32f974db37e364cf634b050b40bf0820dce0a3a3
Signed-off-by: Stephen Finucane <[email protected]>
openstack-mirroring pushed a commit to openstack/openstack that referenced this pull request Nov 1, 2023
* Update pbr from branch 'master'
  to 457a89ffda32cb7a49fa680a71d8c043bd23b352
  - Add support for PEP-660
    
    As with PEP-517 support, this is simply a shim over the setuptools
    implementation added in setuptools v64.0.0 [1].
    
    [1] pypa/setuptools#3488
    
    Change-Id: I32f974db37e364cf634b050b40bf0820dce0a3a3
    Signed-off-by: Stephen Finucane <[email protected]>
SeanMooney added a commit to SeanMooney/openstack-pyproject-toml that referenced this pull request Nov 2, 2023
pip 23.1 removed the "setup.py install" fallback for projects
that do not have pyproject.toml and now uses a pyproject.toml
which is vendored in pip.
To address that, this change adds the minimal pyproject.toml
to enable pbr to be properly used to build editable wheels.

This is required to support installing devstack on
centos stream 9 and related distros with GLOBAL_VENV=True
Without this change the wsgi scripts are not generated in
editable mode. i.e. pip install -e /opt/stack/keystone

See https://pip.pypa.io/en/stable/news/#v23-1
and pypa/pip#8368 for more
details on the removal of the fallback support.

setuptools v64.0.0 is used to support editable installs
via its PEP-660 implmentation
pypa/setuptools#3488
openstack-mirroring pushed a commit to openstack/openstack that referenced this pull request Nov 29, 2023
* Update python-novaclient from branch 'master'
  to d9c1ba9a45d7e5265346f0f889ae7c12ff0ad466
  - Merge "add pyproject.toml to support pip 23.1"
  - add pyproject.toml to support pip 23.1
    
    pip 23.1 removed the "setup.py install" fallback for projects
    that do not have pyproject.toml and now uses a pyproject.toml
    which is vendored in pip.
    To address that, this change adds the minimal pyproject.toml
    to enable pbr to be properly used to build editable wheels.
    
    This is required to support installing devstack on
    centos stream 9 and related distros with GLOBAL_VENV=True
    Without this change the wsgi scripts are not generated in
    editable mode. i.e. pip install -e /opt/stack/keystone
    
    See https://pip.pypa.io/en/stable/news/#v23-1
    and pypa/pip#8368 for more
    details on the removal of the fallback support.
    
    setuptools v64.0.0 is used to support editable installs
    via its PEP-660 implmentation
    pypa/setuptools#3488
    
    Change-Id: Ieea0ac142e79a9de4d2fbf45fdad70d0ff079304
openstack-mirroring pushed a commit to openstack/python-novaclient that referenced this pull request Nov 29, 2023
pip 23.1 removed the "setup.py install" fallback for projects
that do not have pyproject.toml and now uses a pyproject.toml
which is vendored in pip.
To address that, this change adds the minimal pyproject.toml
to enable pbr to be properly used to build editable wheels.

This is required to support installing devstack on
centos stream 9 and related distros with GLOBAL_VENV=True
Without this change the wsgi scripts are not generated in
editable mode. i.e. pip install -e /opt/stack/keystone

See https://pip.pypa.io/en/stable/news/#v23-1
and pypa/pip#8368 for more
details on the removal of the fallback support.

setuptools v64.0.0 is used to support editable installs
via its PEP-660 implmentation
pypa/setuptools#3488

Change-Id: Ieea0ac142e79a9de4d2fbf45fdad70d0ff079304
openstack-mirroring pushed a commit to openstack/python-ironic-inspector-client that referenced this pull request Feb 1, 2024
pip 23.1 removed the "setup.py install" fallback for projects
that do not have pyproject.toml and now uses a pyproject.toml
which is vendored in pip.
To address that, this change adds the minimal pyproject.toml
to enable pbr to be properly used to build editable wheels.

This is required to support installing devstack on
centos stream 9 and related distros with GLOBAL_VENV=True
Without this change the wsgi scripts are not generated in
editable mode. i.e. pip install -e /opt/stack/keystone

See https://pip.pypa.io/en/stable/news/#v23-1
and pypa/pip#8368 for more
details on the removal of the fallback support.

setuptools v64.0.0 is used to support editable installs
via its PEP-660 implmentation
pypa/setuptools#3488

Change-Id: Ie31840df3c78013f49def3c5b95c8f79589ad830
openstack-mirroring pushed a commit to openstack/openstack that referenced this pull request Feb 1, 2024
* Update python-ironic-inspector-client from branch 'master'
  to 798d123db55248dc394ee92fc967ef3e04844d93
  - Merge "add pyproject.toml to support pip 23.1"
  - add pyproject.toml to support pip 23.1
    
    pip 23.1 removed the "setup.py install" fallback for projects
    that do not have pyproject.toml and now uses a pyproject.toml
    which is vendored in pip.
    To address that, this change adds the minimal pyproject.toml
    to enable pbr to be properly used to build editable wheels.
    
    This is required to support installing devstack on
    centos stream 9 and related distros with GLOBAL_VENV=True
    Without this change the wsgi scripts are not generated in
    editable mode. i.e. pip install -e /opt/stack/keystone
    
    See https://pip.pypa.io/en/stable/news/#v23-1
    and pypa/pip#8368 for more
    details on the removal of the fallback support.
    
    setuptools v64.0.0 is used to support editable installs
    via its PEP-660 implmentation
    pypa/setuptools#3488
    
    Change-Id: Ie31840df3c78013f49def3c5b95c8f79589ad830
openstack-mirroring pushed a commit to openstack/openstack that referenced this pull request Feb 14, 2024
* Update python-ironicclient from branch 'master'
  to 5f9ae76a018e2ce1e395e2bd5142d24dbf1116ea
  - Merge "add pyproject.toml to support pip 23.1"
  - add pyproject.toml to support pip 23.1
    
    pip 23.1 removed the "setup.py install" fallback for projects
    that do not have pyproject.toml and now uses a pyproject.toml
    which is vendored in pip.
    To address that, this change adds the minimal pyproject.toml
    to enable pbr to be properly used to build editable wheels.
    
    This is required to support installing devstack on
    centos stream 9 and related distros with GLOBAL_VENV=True
    Without this change the wsgi scripts are not generated in
    editable mode. i.e. pip install -e /opt/stack/keystone
    
    See https://pip.pypa.io/en/stable/news/#v23-1
    and pypa/pip#8368 for more
    details on the removal of the fallback support.
    
    setuptools v64.0.0 is used to support editable installs
    via its PEP-660 implmentation
    pypa/setuptools#3488
    
    Change-Id: Ib5fd98d58d282df24c86defd8cce50ed861f912c
openstack-mirroring pushed a commit to openstack/python-ironicclient that referenced this pull request Feb 14, 2024
pip 23.1 removed the "setup.py install" fallback for projects
that do not have pyproject.toml and now uses a pyproject.toml
which is vendored in pip.
To address that, this change adds the minimal pyproject.toml
to enable pbr to be properly used to build editable wheels.

This is required to support installing devstack on
centos stream 9 and related distros with GLOBAL_VENV=True
Without this change the wsgi scripts are not generated in
editable mode. i.e. pip install -e /opt/stack/keystone

See https://pip.pypa.io/en/stable/news/#v23-1
and pypa/pip#8368 for more
details on the removal of the fallback support.

setuptools v64.0.0 is used to support editable installs
via its PEP-660 implmentation
pypa/setuptools#3488

Change-Id: Ib5fd98d58d282df24c86defd8cce50ed861f912c
openstack-mirroring pushed a commit to openstack/openstack that referenced this pull request Apr 19, 2024
* Update os-traits from branch 'master'
  to c23f37c0e88ddec409f52c10ee404095340478d8
  - Merge "add pyproject.toml to support pip 23.1"
  - add pyproject.toml to support pip 23.1
    
    pip 23.1 removed the "setup.py install" fallback for projects
    that do not have pyproject.toml and now uses a pyproject.toml
    which is vendored in pip.
    To address that, this change adds the minimal pyproject.toml
    to enable pbr to be properly used to build editable wheels.
    
    This is required to support installing devstack on
    centos stream 9 and related distros with GLOBAL_VENV=True
    Without this change the wsgi scripts are not generated in
    editable mode. i.e. pip install -e /opt/stack/keystone
    
    See https://pip.pypa.io/en/stable/news/#v23-1
    and pypa/pip#8368 for more
    details on the removal of the fallback support.
    
    setuptools v64.0.0 is used to support editable installs
    via its PEP-660 implmentation
    pypa/setuptools#3488
    
    Change-Id: I50be314d6d2578fa5b7f3a46fb72502d9f38d5e8
openstack-mirroring pushed a commit to openstack/openstack that referenced this pull request Apr 19, 2024
* Update os-resource-classes from branch 'master'
  to 18e26529fbf7882b17256e7ce6c0cb708afd4b52
  - Merge "add pyproject.toml to support pip 23.1"
  - add pyproject.toml to support pip 23.1
    
    pip 23.1 removed the "setup.py install" fallback for projects
    that do not have pyproject.toml and now uses a pyproject.toml
    which is vendored in pip.
    To address that, this change adds the minimal pyproject.toml
    to enable pbr to be properly used to build editable wheels.
    
    This is required to support installing devstack on
    centos stream 9 and related distros with GLOBAL_VENV=True
    Without this change the wsgi scripts are not generated in
    editable mode. i.e. pip install -e /opt/stack/keystone
    
    See https://pip.pypa.io/en/stable/news/#v23-1
    and pypa/pip#8368 for more
    details on the removal of the fallback support.
    
    setuptools v64.0.0 is used to support editable installs
    via its PEP-660 implmentation
    pypa/setuptools#3488
    
    Change-Id: I04e254db3510f61b52b2ed753fb07e00150e288d
openstack-mirroring pushed a commit to openstack/os-resource-classes that referenced this pull request Apr 19, 2024
pip 23.1 removed the "setup.py install" fallback for projects
that do not have pyproject.toml and now uses a pyproject.toml
which is vendored in pip.
To address that, this change adds the minimal pyproject.toml
to enable pbr to be properly used to build editable wheels.

This is required to support installing devstack on
centos stream 9 and related distros with GLOBAL_VENV=True
Without this change the wsgi scripts are not generated in
editable mode. i.e. pip install -e /opt/stack/keystone

See https://pip.pypa.io/en/stable/news/#v23-1
and pypa/pip#8368 for more
details on the removal of the fallback support.

setuptools v64.0.0 is used to support editable installs
via its PEP-660 implmentation
pypa/setuptools#3488

Change-Id: I04e254db3510f61b52b2ed753fb07e00150e288d
openstack-mirroring pushed a commit to openstack/os-traits that referenced this pull request Apr 19, 2024
pip 23.1 removed the "setup.py install" fallback for projects
that do not have pyproject.toml and now uses a pyproject.toml
which is vendored in pip.
To address that, this change adds the minimal pyproject.toml
to enable pbr to be properly used to build editable wheels.

This is required to support installing devstack on
centos stream 9 and related distros with GLOBAL_VENV=True
Without this change the wsgi scripts are not generated in
editable mode. i.e. pip install -e /opt/stack/keystone

See https://pip.pypa.io/en/stable/news/#v23-1
and pypa/pip#8368 for more
details on the removal of the fallback support.

setuptools v64.0.0 is used to support editable installs
via its PEP-660 implmentation
pypa/setuptools#3488

Change-Id: I50be314d6d2578fa5b7f3a46fb72502d9f38d5e8
openstack-mirroring pushed a commit to openstack/openstack that referenced this pull request Apr 19, 2024
* Update osc-placement from branch 'master'
  to b9f711f44f0d2b3c79a4ce97cda7f84310f47f57
  - Merge "add pyproject.toml to support pip 23.1"
  - add pyproject.toml to support pip 23.1
    
    pip 23.1 removed the "setup.py install" fallback for projects
    that do not have pyproject.toml and now uses a pyproject.toml
    which is vendored in pip.
    To address that, this change adds the minimal pyproject.toml
    to enable pbr to be properly used to build editable wheels.
    
    This is required to support installing devstack on
    centos stream 9 and related distros with GLOBAL_VENV=True
    Without this change the wsgi scripts are not generated in
    editable mode. i.e. pip install -e /opt/stack/keystone
    
    See https://pip.pypa.io/en/stable/news/#v23-1
    and pypa/pip#8368 for more
    details on the removal of the fallback support.
    
    setuptools v64.0.0 is used to support editable installs
    via its PEP-660 implmentation
    pypa/setuptools#3488
    
    Change-Id: Iba16dde8ddb5b0da2bb191c38ab6a72c0b2db007
openstack-mirroring pushed a commit to openstack/osc-placement that referenced this pull request Apr 19, 2024
pip 23.1 removed the "setup.py install" fallback for projects
that do not have pyproject.toml and now uses a pyproject.toml
which is vendored in pip.
To address that, this change adds the minimal pyproject.toml
to enable pbr to be properly used to build editable wheels.

This is required to support installing devstack on
centos stream 9 and related distros with GLOBAL_VENV=True
Without this change the wsgi scripts are not generated in
editable mode. i.e. pip install -e /opt/stack/keystone

See https://pip.pypa.io/en/stable/news/#v23-1
and pypa/pip#8368 for more
details on the removal of the fallback support.

setuptools v64.0.0 is used to support editable installs
via its PEP-660 implmentation
pypa/setuptools#3488

Change-Id: Iba16dde8ddb5b0da2bb191c38ab6a72c0b2db007
openstack-mirroring pushed a commit to openstack/openstack that referenced this pull request Aug 29, 2024
* Update nova from branch 'master'
  to 7e082705de486c36cb221edce3e53463b514c617
  - Merge "add pyproject.toml to support pip 23.1"
  - add pyproject.toml to support pip 23.1
    
    pip 23.1 removed the "setup.py install" fallback for projects
    that do not have pyproject.toml and now uses a pyproject.toml
    which is vendored in pip.
    To address that, this change adds the minimal pyproject.toml
    to enable pbr to be properly used to build editable wheels.
    
    This is required to support installing devstack on
    centos stream 9 and related distros with GLOBAL_VENV=True
    Without this change the wsgi scripts are not generated in
    editable mode. i.e. pip install -e /opt/stack/keystone
    
    See https://pip.pypa.io/en/stable/news/#v23-1
    and pypa/pip#8368 for more
    details on the removal of the fallback support.
    
    setuptools v64.0.0 is used to support editable installs
    via its PEP-660 implmentation
    pypa/setuptools#3488
    
    Depends-On: https://review.opendev.org/c/openstack/devstack/+/902758
    Change-Id: I3255edb67fd7fe7a25b5871ec071c4b4c9d98ac2
openstack-mirroring pushed a commit to openstack/nova that referenced this pull request Aug 29, 2024
pip 23.1 removed the "setup.py install" fallback for projects
that do not have pyproject.toml and now uses a pyproject.toml
which is vendored in pip.
To address that, this change adds the minimal pyproject.toml
to enable pbr to be properly used to build editable wheels.

This is required to support installing devstack on
centos stream 9 and related distros with GLOBAL_VENV=True
Without this change the wsgi scripts are not generated in
editable mode. i.e. pip install -e /opt/stack/keystone

See https://pip.pypa.io/en/stable/news/#v23-1
and pypa/pip#8368 for more
details on the removal of the fallback support.

setuptools v64.0.0 is used to support editable installs
via its PEP-660 implmentation
pypa/setuptools#3488

Depends-On: https://review.opendev.org/c/openstack/devstack/+/902758
Change-Id: I3255edb67fd7fe7a25b5871ec071c4b4c9d98ac2
openstack-mirroring pushed a commit to openstack/openstack that referenced this pull request Nov 9, 2024
* Update ironic from branch 'master'
  to 488bc76cabdbd8b3d84709fc121b4ee0e2697a6a
  - Merge "add pyproject.toml to support pip 23.1"
  - add pyproject.toml to support pip 23.1
    
    pip 23.1 removed the "setup.py install" fallback for projects
    that do not have pyproject.toml and now uses a pyproject.toml
    which is vendored in pip.
    To address that, this change adds the minimal pyproject.toml
    to enable pbr to be properly used to build editable wheels.
    
    This is required to support installing devstack on
    centos stream 9 and related distros with GLOBAL_VENV=True
    Without this change the wsgi scripts are not generated in
    editable mode. i.e. pip install -e /opt/stack/keystone
    
    See https://pip.pypa.io/en/stable/news/#v23-1
    and pypa/pip#8368 for more
    details on the removal of the fallback support.
    
    setuptools v64.0.0 is used to support editable installs
    via its PEP-660 implmentation
    pypa/setuptools#3488
    
    This patch was taken nearly verbatim from the equivalent nova change.
    
    Co-Authored-By: Sean Mooney <[email protected]>
    Change-Id: I34888e8f87b4a3ab09546ba58ef5f2cf495bc7e3
openstack-mirroring pushed a commit to openstack/ironic that referenced this pull request Nov 9, 2024
pip 23.1 removed the "setup.py install" fallback for projects
that do not have pyproject.toml and now uses a pyproject.toml
which is vendored in pip.
To address that, this change adds the minimal pyproject.toml
to enable pbr to be properly used to build editable wheels.

This is required to support installing devstack on
centos stream 9 and related distros with GLOBAL_VENV=True
Without this change the wsgi scripts are not generated in
editable mode. i.e. pip install -e /opt/stack/keystone

See https://pip.pypa.io/en/stable/news/#v23-1
and pypa/pip#8368 for more
details on the removal of the fallback support.

setuptools v64.0.0 is used to support editable installs
via its PEP-660 implmentation
pypa/setuptools#3488

This patch was taken nearly verbatim from the equivalent nova change.

Co-Authored-By: Sean Mooney <[email protected]>
Change-Id: I34888e8f87b4a3ab09546ba58ef5f2cf495bc7e3
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.

[FR] Implement PEP 660 -- Editable Installations
4 participants