Skip to content

Commit 73466ff

Browse files
committed
Fix style issues and build
Build the project using `npm run build` and run prettier using `npm run format`
1 parent bcf39c4 commit 73466ff

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

__tests__/utils.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,20 @@ jest.mock('@actions/core');
1212

1313
describe('parsePythonVersionFile', () => {
1414
it('handle the content of a .python-version file', () => {
15-
expect(parsePythonVersionFile('3.6')).toEqual('3.6')
15+
expect(parsePythonVersionFile('3.6')).toEqual('3.6');
1616
});
1717

1818
it('trims extra spaces at the end of the content', () => {
19-
expect(parsePythonVersionFile('3.7 ')).toEqual('3.7')
19+
expect(parsePythonVersionFile('3.7 ')).toEqual('3.7');
2020
});
2121

2222
it('parses correctly the content of .tool-version files', () => {
23-
expect(parsePythonVersionFile('python 3.7')).toEqual('3.7')
23+
expect(parsePythonVersionFile('python 3.7')).toEqual('3.7');
2424
});
25+
26+
it('parses correctly pypy version content of the .tool-version files', () => {
27+
expect(parsePythonVersionFile('python pypy3.9-7.3.10')).toEqual('pypy3.9-7.3.10')
28+
})
2529
});
2630

2731
describe('validatePythonVersionFormatForPyPy', () => {

docs/advanced-usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ jobs:
242242
The python-version-file input accepts a path to a file containing the version of Python to be used by a project, for example .python-version, or .tool-versions.
243243
If both the python-version and the python-version-file inputs are provided then the python-version input is used.
244244

245-
> In case both `python-version` and `python-version-file` inputs are supplied, the `python-version-file` input will be ignored due to its lower priority.
245+
>In case both `python-version` and `python-version-file` inputs are supplied, the `python-version-file` input will be ignored due to its lower priority.
246246

247247
```yaml
248248
steps:

src/setup-python.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ import * as path from 'path';
55
import * as os from 'os';
66
import fs from 'fs';
77
import {getCacheDistributor} from './cache-distributions/cache-factory';
8-
import {parsePythonVersionFile, isCacheFeatureAvailable, logWarning, IS_MAC} from './utils';
8+
import {
9+
parsePythonVersionFile,
10+
isCacheFeatureAvailable,
11+
logWarning,
12+
IS_MAC
13+
} from './utils';
914

1015
function isPyPyVersion(versionSpec: string) {
1116
return versionSpec.startsWith('pypy');
@@ -43,7 +48,9 @@ function resolveVersionInput() {
4348
);
4449
}
4550

46-
const version = parsePythonVersionFile(fs.readFileSync(versionFile, 'utf8'));
51+
const version = parsePythonVersionFile(
52+
fs.readFileSync(versionFile, 'utf8')
53+
);
4754
core.info(`Resolved ${versionFile} as ${version}`);
4855

4956
return [version];

0 commit comments

Comments
 (0)