| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -157,7 +157,7 @@ jobs: | |||
| 157 | 157 | fail-fast: false | |
| 158 | 158 | matrix: | |
| 159 | 159 | os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-22.04] | |
| 160 | - python: [3.5.4, 3.6.7, 3.7.5, 3.8.15, 3.9.13] | ||
| 160 | + python: [3.5.4, 3.6.7, 3.7.5, 3.8.15, 3.9.13, '==3.10.10'] | ||
| 161 | 161 | exclude: | |
| 162 | 162 | - os: ubuntu-22.04 | |
| 163 | 163 | python: 3.5.4 | |
@@ -190,7 +190,7 @@ jobs: | |||
| 190 | 190 | - name: Validate version | |
| 191 | 191 | run: | | |
| 192 | 192 | $pythonVersion = (python --version) | |
| 193 | - if ("Python ${{ matrix.python }}" -ne "$pythonVersion"){ | ||
| 193 | + if ("Python ${{ matrix.python }}".replace("==", "") -ne "$pythonVersion"){ | ||
| 194 | 194 | Write-Host "The current version is $pythonVersion; expected version is ${{ matrix.python }}" | |
| 195 | 195 | exit 1 | |
| 196 | 196 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -107,7 +107,7 @@ describe('Version from file test', () => { | |||
| 107 | 107 | await io.mkdirP(tempDir); | |
| 108 | 108 | const pythonVersionFileName = 'pyproject.toml'; | |
| 109 | 109 | const pythonVersionFilePath = path.join(tempDir, pythonVersionFileName); | |
| 110 | - const pythonVersion = '>=3.7'; | ||
| 110 | + const pythonVersion = '>=3.7.0'; | ||
| 111 | 111 | const pythonVersionFileContent = `[project]\nrequires-python = "${pythonVersion}"`; | |
| 112 | 112 | fs.writeFileSync(pythonVersionFilePath, pythonVersionFileContent); | |
| 113 | 113 | expect(_fn(pythonVersionFilePath)).toEqual([pythonVersion]); | |
@@ -119,7 +119,7 @@ describe('Version from file test', () => { | |||
| 119 | 119 | await io.mkdirP(tempDir); | |
| 120 | 120 | const pythonVersionFileName = 'pyproject.toml'; | |
| 121 | 121 | const pythonVersionFilePath = path.join(tempDir, pythonVersionFileName); | |
| 122 | - const pythonVersion = '>=3.7'; | ||
| 122 | + const pythonVersion = '>=3.7.0'; | ||
| 123 | 123 | const pythonVersionFileContent = `[tool.poetry.dependencies]\npython = "${pythonVersion}"`; | |
| 124 | 124 | fs.writeFileSync(pythonVersionFilePath, pythonVersionFileContent); | |
| 125 | 125 | expect(_fn(pythonVersionFilePath)).toEqual([pythonVersion]); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -70143,7 +70143,16 @@ function getVersionInputFromTomlFile(versionFile) { | |||
| 70143 | 70143 | versions.push(version); | |
| 70144 | 70144 | } | |
| 70145 | 70145 | core.info(`Extracted ${versions} from ${versionFile}`); | |
| 70146 | - return Array.from(versions, version => version.split(',').join(' ')); | ||
| 70146 | + const rawVersions = Array.from(versions, version => version.split(',').join(' ')); | ||
| 70147 | + const validatedVersions = rawVersions | ||
| 70148 | + .map(item => semver.validRange(item, true)) | ||
| 70149 | + .filter((versionRange, index) => { | ||
| 70150 | + if (!versionRange) { | ||
| 70151 | + core.debug(`The version ${rawVersions[index]} is not valid SemVer range`); | ||
| 70152 | + } | ||
| 70153 | + return !!versionRange; | ||
| 70154 | + }); | ||
| 70155 | + return validatedVersions; | ||
| 70147 | 70156 | } | |
| 70148 | 70157 | exports.getVersionInputFromTomlFile = getVersionInputFromTomlFile; | |
| 70149 | 70158 | /** | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -229,7 +229,21 @@ export function getVersionInputFromTomlFile(versionFile: string): string[] { | |||
| 229 | 229 | } | |
| 230 | 230 | ||
| 231 | 231 | core.info(`Extracted ${versions} from ${versionFile}`); | |
| 232 | - return Array.from(versions, version => version.split(',').join(' ')); | ||
| 232 | + const rawVersions = Array.from(versions, version => | ||
| 233 | + version.split(',').join(' ') | ||
| 234 | + ); | ||
| 235 | + const validatedVersions = rawVersions | ||
| 236 | + .map(item => semver.validRange(item, true)) | ||
| 237 | + .filter((versionRange, index) => { | ||
| 238 | + if (!versionRange) { | ||
| 239 | + core.debug( | ||
| 240 | + `The version ${rawVersions[index]} is not valid SemVer range` | ||
| 241 | + ); | ||
| 242 | + } | ||
| 243 | + | ||
| 244 | + return !!versionRange; | ||
| 245 | + }) as string[]; | ||
| 246 | + return validatedVersions; | ||
| 233 | 247 | } | |
| 234 | 248 | ||
| 235 | 249 | /** | |
| Back | FazBrowse Home | New Git URL |
0 commit comments