mirror of
https://code.forgejo.org/actions/setup-python
synced 2025-06-08 04:18:19 +02:00
Fix poetry version (#445)
This commit is contained in:
parent
592a7a7a45
commit
49a521fa06
7 changed files with 80 additions and 19 deletions
|
@ -1,6 +1,7 @@
|
|||
import * as core from '@actions/core';
|
||||
import * as cache from '@actions/cache';
|
||||
import * as exec from '@actions/exec';
|
||||
import * as io from '@actions/io';
|
||||
import {getCacheDistributor} from '../src/cache-distributions/cache-factory';
|
||||
import * as utils from './../src/utils';
|
||||
|
||||
|
@ -37,6 +38,9 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py
|
|||
// exec spy
|
||||
let getExecOutputSpy: jest.SpyInstance;
|
||||
|
||||
// io spy
|
||||
let whichSpy: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
process.env['RUNNER_OS'] = process.env['RUNNER_OS'] ?? 'linux';
|
||||
|
||||
|
@ -77,6 +81,8 @@ virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/patrick/Library/Caches/py
|
|||
}
|
||||
);
|
||||
|
||||
whichSpy = jest.spyOn(io, 'which');
|
||||
whichSpy.mockImplementation(() => '/path/to/python');
|
||||
getLinuxOSReleaseInfoSpy = jest.spyOn(utils, 'getLinuxOSReleaseInfo');
|
||||
});
|
||||
|
||||
|
|
15
__tests__/data/pyproject.toml
Normal file
15
__tests__/data/pyproject.toml
Normal file
|
@ -0,0 +1,15 @@
|
|||
[tool.poetry]
|
||||
name = "testactiontasks"
|
||||
version = "0.1.0"
|
||||
description = ""
|
||||
authors = ["Your Name <you@example.com>"]
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.8"
|
||||
flake8 = "^4.0.1"
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core>=1.0.0"]
|
||||
build-backend = "poetry.core.masonry.api"
|
Loading…
Add table
Add a link
Reference in a new issue