-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
sage --package create --pypi
: Create a wheel package by default if possible
#36794
sage --package create --pypi
: Create a wheel package by default if possible
#36794
Conversation
if not PyPiVersion(package_name, source='wheel').tarball.endswith('-none-any.whl'): | ||
source = 'normal' | ||
except PyPiError: | ||
source = 'normal' | ||
pypi_version = PyPiVersion(package_name, source=source) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done in 818468a
@@ -319,7 +319,7 @@ def make_parser(): | |||
'package_name', default=None, type=str, | |||
help='Package name.') | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 818468a
@@ -1,4 +1,4 @@ | |||
| $(PYTHON_TOOLCHAIN) $(PYTHON) | |||
| pip $(PYTHON) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changing it with just "pip" signals that
PYTHON_TOOLCHAIN
is only for source python packages. Is it?
Indeed. I have updated the documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. OK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Documentation preview for this PR (built with commit 818468a; changes) is ready! 🎉 |
Thank you! |
…age 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
<!-- ^^^^^ 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
<!-- ^^^^^ 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 --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.📝 Checklist
⌛ Dependencies