mirror of
https://github.com/badges/shields.git
synced 2026-11-21 16:06:35 +03:00
* chore(deps): bump @renovatebot/pep440 from 4.2.2 to 5.0.0 Bumps [@renovatebot/pep440](https://github.com/renovatebot/pep440) from 4.2.2 to 5.0.0. - [Release notes](https://github.com/renovatebot/pep440/releases) - [Commits](https://github.com/renovatebot/pep440/compare/4.2.2...5.0.0) --- updated-dependencies: - dependency-name: "@renovatebot/pep440" dependency-version: 5.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * update @renovatebot/pep440 imports for v5.0.0 support --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: jNullj <15849761+jNullj@users.noreply.github.com>
28 lines
924 B
JavaScript
28 lines
924 B
JavaScript
import Joi from 'joi'
|
|
import { validRange } from '@renovatebot/pep440'
|
|
import { createServiceTester } from '../tester.js'
|
|
export const t = await createServiceTester()
|
|
|
|
const validatePep440 = (value, helpers) => {
|
|
if (!validRange(value)) {
|
|
return helpers.error('any.invalid')
|
|
}
|
|
return value
|
|
}
|
|
|
|
const isCommaSeparatedPythonVersions = Joi.string().custom(validatePep440)
|
|
|
|
t.create('python versions (valid)')
|
|
.get(
|
|
'/python/required-version-toml.json?tomlFilePath=https://raw.githubusercontent.com/numpy/numpy/main/pyproject.toml',
|
|
)
|
|
.expectBadge({ label: 'python', message: isCommaSeparatedPythonVersions })
|
|
|
|
t.create(
|
|
'python versions - valid toml with missing python-requires field (invalid)',
|
|
)
|
|
.get(
|
|
'/python/required-version-toml.json?tomlFilePath=https://raw.githubusercontent.com/psf/requests/v2.31.0/pyproject.toml',
|
|
)
|
|
.expectBadge({ label: 'python', message: 'invalid response data' })
|