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

Commit

Permalink
also use patch-version for cache key, otherwise the virtualenv links …
Browse files Browse the repository at this point in the history
…to a wrong python executable (#45)
  • Loading branch information
syphar authored Jan 12, 2021
1 parent ddccaf4 commit d0a933d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ const test_requirement_hash =
test('get cache key', async () => {
expect(await utils.cache_key(test_requirement_files, 'custom')).toMatch(
new RegExp(
`${process.env.RUNNER_OS}-virtualenv-cache-py3\\d-custom-${test_requirement_hash}`
`${process.env.RUNNER_OS}-virtualenv-cache-py3\\d+-custom-${test_requirement_hash}`
)
)
})

test('get python version', async () => {
expect(await utils.python_version()).toMatch(new RegExp('3\\d'))
expect(await utils.python_version()).toMatch(new RegExp('3\\d+'))
})

test('get virtualenv directory', async () => {
Expand Down
2 changes: 1 addition & 1 deletion dist/restore/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/restore/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/save/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/save/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function python_version(): Promise<string> {

await exec.exec(
'python',
['-c', 'import sys;print("{}{}".format(*sys.version_info[:2]))'],
['-c', 'import sys;print("{}{}{}".format(*sys.version_info[:3]))'],
options
)

Expand Down

0 comments on commit d0a933d

Please sign in to comment.