Skip to content

Commit

Permalink
fix: update build flows python minor version regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
jsetton authored and Shreyas-vgr committed Dec 27, 2021
1 parent 879377b commit b08093b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/builtins/build-flows/python-pip.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class PythonPipBuildFlow extends AbstractBuildFlow {

_checkPythonVersion(python) {
const versionStr = childProcess.spawnSync(python, ['--version']).output.toString().trim();
const [version] = versionStr.match(/\d\.\d\.\d+/gm);
const [version] = versionStr.match(/\d\.\d+\.\d+/gm);
const isPython2 = version.startsWith('2.');
return { isPython2, version };
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/builtins/build-flows/python-pip-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('PythonPipBuildFlow test', () => {
debugStub = sinon.stub(AbstractBuildFlow.prototype, 'debug');
createZipStub = sinon.stub(AbstractBuildFlow.prototype, 'createZip').yields();
platformStub = sinon.stub(process, 'platform').value('darwin');
checkVersionStub = sinon.stub(childProcess, 'spawnSync').returns({ output: ', Python 3.7.2 ,' });
checkVersionStub = sinon.stub(childProcess, 'spawnSync').returns({ output: ', Python 3.10.1 ,' });
});
describe('# inspect correctness of execute', () => {
it('| should execute commands', (done) => {
Expand Down

0 comments on commit b08093b

Please sign in to comment.