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

Developer guide: Improve discussion of backport packages #37654

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

mkoeppe
Copy link
Contributor

@mkoeppe mkoeppe commented Mar 22, 2024

Here we improve the documentation in the section "Language standard" of the developer's guide so that it aligns with how the conditional dependencies are declared.

Based on changes split out from #37399.

📝 Checklist

  • 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 accordingly.

⌛ Dependencies

@mkoeppe mkoeppe self-assigned this Mar 22, 2024
@mkoeppe mkoeppe requested review from soehms, tornaria and orlitzky March 22, 2024 22:13
@mkoeppe mkoeppe force-pushed the backport_packages_clarification branch 2 times, most recently from f3f165f to 8a0812d Compare April 1, 2024 00:53
Copy link

github-actions bot commented Apr 1, 2024

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

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.

LGTM.

@tornaria
Copy link
Contributor

Can you make a list of the features from backport packages not available on python 3.9 that could be useful?

I think right now nothing in sagelib uses the backport pkgs, seems better to keep it that way.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 18, 2024

That's out of scope of this PR.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 18, 2024

Thanks for the review!

vbraun pushed a commit to vbraun/sage that referenced this pull request Apr 20, 2024
…kages

    
<!-- ^ 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". -->

- sagemath#35203 added these packages as unconditional dependencies
- prompted by a sporadic use of typing_extensions in the Sage library
(see sagemath#34831)
- motivated further by the demand to immediately drop support for Python
3.8 so that newer typing features can be used in the Sage library
(sagemath#35404)
- sagemath#36776 reduced the packages to
conditional dependencies

Here we improve the documentation in the section "Language standard" of
the developer's guide so that it aligns with how the conditional
dependencies are declared.

Based on changes split out from sagemath#37399.

### 📝 Checklist

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

- [ ] 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 accordingly.

### ⌛ 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#37654
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee, Matthias Köppe
Comment on lines +65 to +69

if sys.version_info < (3, 11):
# Use backport package providing Python 3.11 features
from importlib_resources import files
else:
from importlib.resources import files
Copy link
Contributor

Choose a reason for hiding this comment

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

This gives the impression that we recommend using the backport packages. IMO, we should discourage the backport packages. Right now, afaict, nothing in the sage library requires the backport packages and we should keep it that way.

The risk is that if someone uses the backport packages it might use a newer feature not available on current python. We've already pointed out that distros are not shipping some of the backport packages.

Please remove this suggestion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's documenting the status quo, which was established by positively reviewed PRs in the past.

@tornaria
Copy link
Contributor

Can you make a list of the features from backport packages not available on python 3.9 that could be useful?

I think right now nothing in sagelib uses the backport pkgs, seems better to keep it that way.

My point here is: if there is a concrete feature that justifies using the backport packages for python <= 3.11, it would be reasonable to compromise. But what is that feature?

I know importlib.resources does not support namespace packages on 3.9, but we can avoid that for the time being and 3.9 is on its way out soon. That is the only feature I'm aware of that might need a backport package. Am I missing something?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 21, 2024

@tornaria Once more, this is outside of the scope of this PR. It is improving the documentation of what is the current policy.

You are asking for a justification of the status quo and/or to change the policy. That's a separate issue -- and, most importantly, the burden of justifying the change is on you there.

@tornaria
Copy link
Contributor

@tornaria Once more, this is outside of the scope of this PR. It is improving the documentation of what is the current policy.

You are asking for a justification of the status quo and/or to change the policy. That's a separate issue -- and, most importantly, the burden of justifying the change is on you there.

What you document here is not the status quo: nothing in sagelib uses any backport package afaict. It's already agreed that the backport packages should not be used beyond python 3.11, but I don't think we really need them even for 3.9.

If there's a concrete feature that is available on 3.12 but not on 3.9 that we might want to use, it would be fine to refer to the specific feature.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 21, 2024

What you document here is not the status quo: nothing in sagelib uses any backport package afaict

The status quo is that nothing currently uses it and that developers can use it because it's a declared dependency.

@tornaria
Copy link
Contributor

The status quo is that nothing currently uses it and that developers can use it because it's a declared dependency.

I don't understand your position. If you need some feature for the modularization, just say so, and we can mention the particular feature. Otherwise, we all benefit from reducing dependencies, modularization as well.

At the very least add a warning that features not available on python 3.12 should not be used. But really: since we are not using it, just dropping it seems the best approach.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 22, 2024

The status quo is that nothing currently uses it and that developers can use it because it's a declared dependency.

I don't understand your position.

What "position"? You disagree that it is a correct description of the status quo?

@tornaria
Copy link
Contributor

I don't understand your position.

What "position"? You disagree that it is a correct description of the status quo?

Yes, I disagree. These packages were added as requirements to some other packages (jsonschema, virtualenv) on older versions of python. There is no status quo or policy about using these packages on sagemath itself.

Meanwhile, I believe it has already been agreed not to use them beyond python 3.11, so developers have to be at least warned about this (this is needs work).

If there is a useful feature available on 3.11 or 3.12 but not on older python, that might be a good reason. Otherwise, it's just simpler to discourage them altogether to avoid somebody inadvertently using some feature that causes trouble later. That is my position, but we don't know what is yours.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 23, 2024

Yes, I disagree. These packages were added as requirements to some other packages (jsonschema, virtualenv) on older versions of python. There is no status quo or policy about using these packages on sagemath itself.

But @tornaria, this is obviously false, as very first link in the PR description shows.

@tornaria
Copy link
Contributor

1414916
cc2f4ae
89289d0

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 23, 2024

Irrelevant, as I am sure you understand.

@vbraun
Copy link
Member

vbraun commented Apr 24, 2024

merge conflict

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants