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 pypa/build instead of pip wheel #35618

Conversation

mkoeppe
Copy link
Contributor

@mkoeppe mkoeppe commented May 6, 2023

📚 Description

This is the next step of the long term effort to use the standard tools of modern Python packaging in the build system of the Sage distribution, enabled by making python_build a standard package. We add python_build to our PYTHON_TOOLCHAIN and replace the use of pip wheel by using python -m build.

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

⌛ Dependencies

@mkoeppe mkoeppe self-assigned this May 6, 2023
@mkoeppe mkoeppe force-pushed the t/34590/use_python_build_instead_of__pip_wheel_ branch from 76ac11b to 466dafb Compare November 19, 2023 23:12
@mkoeppe mkoeppe changed the title Use python-build instead of pip wheel Use pypa/build instead of pip wheel Nov 19, 2023
Copy link

github-actions bot commented Nov 19, 2023

Documentation preview for this PR (built with commit c8799b1; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@mkoeppe mkoeppe force-pushed the t/34590/use_python_build_instead_of__pip_wheel_ branch from 466dafb to 43e312c Compare November 19, 2023 23:48
@mkoeppe mkoeppe removed the pending label Apr 15, 2024
@mkoeppe mkoeppe force-pushed the t/34590/use_python_build_instead_of__pip_wheel_ branch from f6e88dd to 8074b79 Compare April 17, 2024 03:14
@mkoeppe mkoeppe marked this pull request as ready for review April 17, 2024 03:16
@mkoeppe mkoeppe force-pushed the t/34590/use_python_build_instead_of__pip_wheel_ branch from 10d1a26 to 603aea4 Compare April 27, 2024 17:41
vbraun pushed a commit to vbraun/sage that referenced this pull request Apr 28, 2024
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Removing this broken experimental package, as proposed in 2020.
- Closes sagemath#30156

Also removing the module providing outdated "standalone instructions" to
use Gambit.

Keeping the various references to Gambit tagged with `# optional -
gambit`. This will be updated in the follow-up PR"
- sagemath#37809


The motivation for opening this PR to remove `gambit` now (2024) is that
it removes a remaining use of the function `sdh_setup_bdist_wheel` (the
old gambit Python package could not be installed using pip). This a step
for the modernization of the build frontend for Python packages in the
Sage distribution:
- sagemath#35618

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#37810
Reported by: Matthias Köppe
Reviewer(s): John H. Palmieri
@kwankyu
Copy link
Collaborator

kwankyu commented Apr 29, 2024

This seems related

Using cached file /Users/kwankyu/GitHub/sage-dev/upstream/editables-0.5.tar.gz
Setting up build directory /Users/kwankyu/GitHub/sage-dev/local/var/lib/sage/venv-python3.12/var/tmp/sage/build/editables-0.5
No patch files found in ../patches
Host system: Darwin Hera.local 21.6.0 Darwin Kernel Version 21.6.0: Mon Feb 19 20:24:34 PST 2024; root:xnu-8020.240.18.707.4~1/RELEASE_X86_64 x86_64
C compiler: gcc, Apple clang version 14.0.0 (clang-1400.0.29.202), Target: x86_64-apple-darwin21.6.0, Thread model: posix, InstalledDir: /Library/Developer/CommandLineTools/usr/bin
No stamp file for package 'editables' in /Users/kwankyu/GitHub/sage-dev/local/var/lib/sage/venv-python3.12/var/lib/sage/installed
No spkg-legacy-uninstall script; nothing to do
[spkg-install] Installing editables-0.5
[spkg-install] /Users/kwankyu/GitHub/sage-dev/local/var/lib/sage/venv-python3.12/bin/python3: No module named build
[spkg-install] Warning: building with "python3 -m build --wheel --outdir=dist   ." failed.
[spkg-install] Retrying with "python3 -m build --wheel --outdir=dist --no-isolation --skip-dependency-check  .".
[spkg-install] /Users/kwankyu/GitHub/sage-dev/local/var/lib/sage/venv-python3.12/bin/python3: No module named build
[spkg-install] ********************************************************************************
[spkg-install] Error building a wheel for editables-0.5
[spkg-install] ********************************************************************************
************************************************************************
Error installing package editables-0.5    

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 29, 2024

Indeed. I've pushed a fix.

Copy link
Collaborator

@kwankyu kwankyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

working fine.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 29, 2024

Thank you!

vbraun pushed a commit to vbraun/sage that referenced this pull request May 2, 2024
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Removing this broken experimental package, as proposed in 2020.
- Closes sagemath#30156

Also removing the module providing outdated "standalone instructions" to
use Gambit.

Keeping the various references to Gambit tagged with `# optional -
gambit`. This will be updated in the follow-up PR"
- sagemath#37809


The motivation for opening this PR to remove `gambit` now (2024) is that
it removes a remaining use of the function `sdh_setup_bdist_wheel` (the
old gambit Python package could not be installed using pip). This a step
for the modernization of the build frontend for Python packages in the
Sage distribution:
- sagemath#35618

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#37810
Reported by: Matthias Köppe
Reviewer(s): John H. Palmieri
@vbraun vbraun merged commit f384783 into sagemath:develop May 2, 2024
16 of 35 checks passed
@mkoeppe mkoeppe added this to the sage-10.4 milestone May 2, 2024
@mkoeppe mkoeppe deleted the t/34590/use_python_build_instead_of__pip_wheel_ branch May 3, 2024 19:23
vbraun pushed a commit to vbraun/sage that referenced this pull request Jul 4, 2024
…ses of `python3 -m build`

    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

This is the next step in the modernization of our use of build front
ends for Python SPKGs, after sagemath#35618.

- New `sage-dist-helper` functions `sdh_build_wheel`,
`sdh_build_and_store_wheel` (split out from sagemath#36730)
- New option `--sdist-then-wheel` for `sdh_pip_install` (and the new
`sdh_build*wheel` functions)

By switching the packages `sagemath_environment` etc. from direct use of
`python3 -m build` to the `sdh_build_and_store_wheel` script, it now
falls back to `--no-build-isolation` when building with build isolation
fails.
- This fixes sagemath#38190

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [ ] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#38201
Reported by: Matthias Köppe
Reviewer(s):
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.

Use python-build instead of "pip wheel"
3 participants