mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 22:46:27 +00:00
parent
e531a934bf
commit
3f14af3ec2
2 changed files with 3 additions and 2 deletions
|
@ -4,6 +4,7 @@ import { parse } from 'node-html-parser';
|
||||||
import { logger } from '../../logger';
|
import { logger } from '../../logger';
|
||||||
import { Http } from '../../util/http';
|
import { Http } from '../../util/http';
|
||||||
import { matches } from '../../versioning/pep440';
|
import { matches } from '../../versioning/pep440';
|
||||||
|
import * as pep440 from '../../versioning/pep440';
|
||||||
import { GetReleasesConfig, ReleaseResult } from '../common';
|
import { GetReleasesConfig, ReleaseResult } from '../common';
|
||||||
|
|
||||||
export const id = 'pypi';
|
export const id = 'pypi';
|
||||||
|
@ -19,7 +20,7 @@ function compatibleVersions(
|
||||||
compatibility: Record<string, string>
|
compatibility: Record<string, string>
|
||||||
): string[] {
|
): string[] {
|
||||||
const versions = Object.keys(releases);
|
const versions = Object.keys(releases);
|
||||||
if (!(compatibility && compatibility.python)) {
|
if (!(compatibility?.python && pep440.isVersion(compatibility.python))) {
|
||||||
return versions;
|
return versions;
|
||||||
}
|
}
|
||||||
return versions.filter((version) =>
|
return versions.filter((version) =>
|
||||||
|
|
|
@ -47,7 +47,7 @@ export const isSingleVersion = (constraint: string): string =>
|
||||||
isVersion(constraint) ||
|
isVersion(constraint) ||
|
||||||
(constraint.startsWith('==') && isVersion(constraint.substring(2).trim()));
|
(constraint.startsWith('==') && isVersion(constraint.substring(2).trim()));
|
||||||
|
|
||||||
export { matches };
|
export { isVersion, matches };
|
||||||
|
|
||||||
export const api: VersioningApi = {
|
export const api: VersioningApi = {
|
||||||
equals,
|
equals,
|
||||||
|
|
Loading…
Reference in a new issue