Skip to content
Snippets Groups Projects
Commit 3f14af3e authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix(pypi): skip compatibility check if not a version

Closes #6142
parent e531a934
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ import { parse } from 'node-html-parser';
import { logger } from '../../logger';
import { Http } from '../../util/http';
import { matches } from '../../versioning/pep440';
import * as pep440 from '../../versioning/pep440';
import { GetReleasesConfig, ReleaseResult } from '../common';
export const id = 'pypi';
......@@ -19,7 +20,7 @@ function compatibleVersions(
compatibility: Record<string, string>
): string[] {
const versions = Object.keys(releases);
if (!(compatibility && compatibility.python)) {
if (!(compatibility?.python && pep440.isVersion(compatibility.python))) {
return versions;
}
return versions.filter((version) =>
......
......@@ -47,7 +47,7 @@ export const isSingleVersion = (constraint: string): string =>
isVersion(constraint) ||
(constraint.startsWith('==') && isVersion(constraint.substring(2).trim()));
export { matches };
export { isVersion, matches };
export const api: VersioningApi = {
equals,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment