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

Change the default Python version in documents to 3 instead of 2 #1318

Merged
merged 3 commits into from
Nov 21, 2024

Conversation

jordigh
Copy link
Contributor

@jordigh jordigh commented Nov 20, 2024

Original commit messages:

  • e513d6b workflows: install gvisor from Ubuntu repos

    This requires Ubuntu 24.04, as 22.04 doesn't package gvisor yet.

  • ba0355f test: normalise the test for SQLite infinity

    Older SQLite used 1.0e999 as the printf output for an IEEE784 Inf value,

    https://sqlite.org/printf.html

    whereas newer uses 9.0e+999. The difference doesn't matter for us, so
    let's normalise to the later version.

  • d88c424 ActiveDoc: make Python 3 the default version

    It's already default in various contexts, but sometimes there is
    nothing defining what the Python version, which makes it default to 2.
    This has broken some documents in the past. It's high time to change
    this default.

Context

It is sometimes possible to create Python 2 documents by default, such as older Grist Desktop. That default breaks in other contexts, such as Grist SaaS. It's best to default more strongly to Python 3. See here for a case where this affected users.

Proposed solution

Change the default to Python 3 if the PYTHON_VERSION isn't set.

Has this been tested?

  • 👍 yes, I added tests to the test suite (in an earlier commit).
  • 💭 no, because this PR is a draft and still needs work
  • 🙅 no, because this is not relevant here
  • 🙋 no, because I need help

@jordigh jordigh force-pushed the jordigh/make-python3-default branch 5 times, most recently from ea9de6a to ff808b6 Compare November 20, 2024 21:31
This requires Ubuntu 24.04, as 22.04 doesn't package gvisor yet.
Older SQLite used 1.0e999 as the printf output for an IEEE784 Inf value,

  https://sqlite.org/printf.html

whereas newer uses 9.0e+999. The difference doesn't matter for us, so
let's normalise to the later version.
It's already default in various contexts, but sometimes there is
nothing defining what the Python version, which makes it default to 2.
This has broken some documents in the past. It's high time to change
this default.
@jordigh jordigh force-pushed the jordigh/make-python3-default branch from ff808b6 to d88c424 Compare November 20, 2024 21:56
@jordigh jordigh changed the title wip Change the default Python version in documents to 3 instead of 2 Nov 20, 2024
Copy link
Member

@paulfitz paulfitz left a comment

Choose a reason for hiding this comment

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

I wonder if we'll need to tweak grist-saas? Anyway, this seems correct, Python2 as a default makes no sense anymore.

@jordigh jordigh merged commit da1abbe into main Nov 21, 2024
11 checks passed
@jordigh jordigh deleted the jordigh/make-python3-default branch November 21, 2024 03:03
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.

2 participants