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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
build_and_test:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
# it is helpful to know which sets of tests would have succeeded,
# even when there is a failure.
Expand Down Expand Up @@ -55,6 +55,9 @@ jobs:
- name: Install Node.js packages
run: yarn install

- name: Install gvisor
run: sudo apt install runsc

- name: Run eslint
if: contains(matrix.tests, ':lint:')
run: yarn run lint:ci
Expand Down
2 changes: 1 addition & 1 deletion app/server/lib/ActiveDoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2830,7 +2830,7 @@ export class ActiveDoc extends EventEmitter {

private async _makeEngine(): Promise<ISandbox> {
// Figure out what kind of engine we need for this document.
let preferredPythonVersion: '2' | '3' = process.env.PYTHON_VERSION === '3' ? '3' : '2';
let preferredPythonVersion: '2' | '3' = process.env.PYTHON_VERSION === '2' ? '2' : '3';

// Careful, migrations may not have run on this document and it may not have a
// documentSettings column. Failures are treated as lack of an engine preference.
Expand Down
13 changes: 9 additions & 4 deletions test/server/generateInitialDocSql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,14 @@ describe('generateInitialDocSql', function() {
await execFile(path.join(getAppRoot(), 'buildtools/update_schema.sh'), [
newSchemaTs, newSqlTs,
], { env: process.env });
assert.equal((await fse.readFile(newSchemaTs)).toString(),
(await fse.readFile(currentSchemaTs)).toString());
assert.equal((await fse.readFile(newSqlTs)).toString(),
(await fse.readFile(currentSqlTs)).toString());

assert.equal(normaliseSQLiteInfinity((await fse.readFile(newSchemaTs)).toString()),
normaliseSQLiteInfinity((await fse.readFile(currentSchemaTs)).toString()));
assert.equal(normaliseSQLiteInfinity((await fse.readFile(newSqlTs)).toString()),
normaliseSQLiteInfinity((await fse.readFile(currentSqlTs)).toString()));
});
});

function normaliseSQLiteInfinity(sql: string) {
return sql.replace(/\b1e\+?999\b/g, '9.0e+999');
}
Loading