sage --package create --pypi: Create a wheel package by default if possible#36794
Conversation
| source = 'normal' | ||
| except PyPiError: | ||
| source = 'normal' | ||
| pypi_version = PyPiVersion(package_name, source=source) |
There was a problem hiding this comment.
if source is None:
try:
- source = 'wheel'
- if not PyPiVersion(package_name, source='wheel').tarball.endswith('-none-any.whl'):
+ if PyPiVersion(package_name, source='wheel').tarball.endswith('-none-any.whl'):
+ source = 'wheel'
+ else
source = 'normal'
except PyPiError:a bit simpler code?
| parser_create.add_argument( | ||
| '--source', type=str, default='normal', help='Package source (one of normal, wheel, script, pip)') | ||
| '--source', type=str, default=None, help='Package source (one of normal, wheel, script, pip; default depends on provided arguments)') | ||
| parser_create.add_argument( |
There was a problem hiding this comment.
parser_create.add_argument(
- '--source', type=str, default=None, help='Package source (one of normal, wheel, script, pip; default depends on provided arguments)')
+ '--source', type=str, default=None, help='Package source (one of normal, wheel, script, pip); default depends on provided arguments')
parser_create.add_argument(
'--version', type=str, default=None, help='Package version')following the style of other arguments?
| @@ -1,4 +1,4 @@ | |||
| | $(PYTHON_TOOLCHAIN) $(PYTHON) | |||
| | pip $(PYTHON) | |||
|
|
|||
There was a problem hiding this comment.
PYTHON_TOOLCHAIN represents "a prerequisite to any pip-installed packages". It does not differentiate source and wheel python packages. Here changing it with just "pip" signals that PYTHON_TOOLCHAIN is only for source python packages. Is it?
On the other hand, packages in PYTHON_TOOLCHAIN are installed anyway because of other packages. So it seems that the change has no real benefit...
There was a problem hiding this comment.
changing it with just "pip" signals that
PYTHON_TOOLCHAINis only for source python packages. Is it?
Indeed. I have updated the documentation.
|
Documentation preview for this PR (built with commit 818468a; changes) is ready! 🎉 |
|
Thank you! |
sagemathgh-36794: `sage --package create --pypi`: Create a wheel package by default if possible <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> We change the default of `sage --package create --pypi` to create a wheel package (if the package has a platform-independent wheel on PyPI) instead of a normal package (built from source). This is simpler (no spkg-install.in script, no build dependencies) and a bit faster. As an illustration, we change one SPKG, `six`, from normal to wheel. <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] 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 <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#36794 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee, Matthias Köppe
sagemathgh-36802: Python toolchain as wheel packages <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> We switch several pure Python packages that are part of `PYTHON_TOOLCHAIN` from normal to wheel packages. The only time that we carried a patch for any of these packages was in 2014–2016, a patch for pyparsing. This reduces the complexity of our SPKGs, in line with previous PRs sagemath#36267, sagemath#36429, sagemath#36129, sagemath#36794. <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [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 accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#36802 Reported by: Matthias Köppe Reviewer(s): Dima Pasechnik
sagemathgh-36802: Python toolchain as wheel packages <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> We switch several pure Python packages that are part of `PYTHON_TOOLCHAIN` from normal to wheel packages. The only time that we carried a patch for any of these packages was in 2014–2016, a patch for pyparsing. This reduces the complexity of our SPKGs, in line with previous PRs sagemath#36267, sagemath#36429, sagemath#36129, sagemath#36794. <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [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 accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#36802 Reported by: Matthias Köppe Reviewer(s): Dima Pasechnik
We change the default of
sage --package create --pypito create a wheel package (if the package has a platform-independent wheel on PyPI) instead of a normal package (built from source).This is simpler (no spkg-install.in script, no build dependencies) and a bit faster.
As an illustration, we change one SPKG,
six, from normal to wheel.📝 Checklist
⌛ Dependencies