Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Fix handling of the Python version in the release scripts #315

Merged
merged 1 commit into from
Jan 2, 2022
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
4 changes: 2 additions & 2 deletions buildutils/src/release-bump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as utils from '@jupyterlab/buildutils';

import commander from 'commander';

import { postbump } from './utils';
import { getPythonVersion, postbump } from './utils';

// Specify the program signature.
commander
Expand All @@ -22,7 +22,7 @@ commander
.arguments('<spec>')
.action((spec: any, opts: any) => {
// Get the previous version.
const prev = utils.getPythonVersion();
const prev = getPythonVersion();
const isFinal = /\d+\.\d+\.\d+$/.test(prev);

// Whether to commit after bumping
Expand Down
4 changes: 2 additions & 2 deletions buildutils/src/release-patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as utils from '@jupyterlab/buildutils';

import commander from 'commander';

import { postbump } from './utils';
import { getPythonVersion, postbump } from './utils';

// Specify the program signature.
commander
Expand All @@ -20,7 +20,7 @@ commander
.option('--skip-commit', 'Whether to skip commit changes')
.action((options: any) => {
// Make sure we can patch release.
const pyVersion = utils.getPythonVersion();
const pyVersion = getPythonVersion();
if (
pyVersion.includes('a') ||
pyVersion.includes('b') ||
Expand Down
11 changes: 10 additions & 1 deletion buildutils/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import { getPythonVersion, run } from '@jupyterlab/buildutils';
import { run } from '@jupyterlab/buildutils';

/**
* Get the current version of RetroLab
*/
export function getPythonVersion(): string {
const cmd = 'python setup.py --version';
const lines = run(cmd, { stdio: 'pipe' }, true).split('\n');
return lines[lines.length - 1];
}

export function postbump(commit = true): void {
// run the integrity
Expand Down